Skip to content

Make it clear to not edit generated files #2082

Closed

Description

@hadley

e.g.

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/complete.R
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

It would be great if the IDE exposed this very clearly so you don't accidentally edit generated files

Activity

  1. kevinushey commented on Jan 29, 2018

    @kevinushey
    Collaborator

    What if the user really, truly does want to edit one of these files?

    Are you imagining an extra UI affordance (e.g. a warning bar), or something more drastic like making the editor read-only when opening these files?

  2. jjallaire commented on Jan 29, 2018

    @jjallaire
    Member

    We could just use our standard warning band treatment here (and not actually make it impossible to edit the file)

  3. jmcphers commented on Jan 29, 2018

    @jmcphers
    Member

    Ideally I think we'd do the following:

    1. Make the editor read-only

    2. Show a warning bar over the top of the editor that says something like. "This file is generated and should not be edited by hand.", with an action button on the right that says "Edit Anyway"

    3. Clicking Edit Anyway removes the warning bar and enables the editor

    That way you have to acknowledge the warning before editing, so it's very hard to change anything accidentally, but you still have an escape hatch if you really need to make a change.

  4. hadley commented on Jan 29, 2018

    @hadley
    MemberAuthor

    I was thinking mostly of a warning bar, but @jmcphers' suggestion sounds perfect.

  5. jmcphers commented on Feb 3, 2018

    @jmcphers
    Member

    @kevinushey added a warning bar in #2085.

  6. ronblum commented on Feb 16, 2018

    @ronblum
    Contributor

    Verified in 1.2.349.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions