vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

Highlight "do not edit by hand" in scripts

Open statnmap opened this issue 4 years ago • 5 comments

I was wondering if it could be possible to add a banner or at least highlight text "do not edit by hand" that appears on top of R/Rmd files so that the user can identify files in Read-only mode.

That would be useful for NAMESPACE file for instance when developing packages, that gets this lines automatically with {roxygen2}

statnmap avatar Dec 21 '21 09:12 statnmap

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Dec 22 '22 01:12 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jan 05 '23 01:01 github-actions[bot]

If possible, I would like to reopen this issue.

statnmap avatar Jun 14 '23 10:06 statnmap

Recently, the support for individually configured read-only editors was added (https://code.visualstudio.com/updates/v1_79#_readonly-mode). One way to achieve (roughly) what you described would be the following config entry. Note that it sets all temporary R files (following the Rtmp... naming pattern) as read-only, though.

    "files.readonlyInclude": {
        "NAMESPACE": true,
        "**/Rtmp*/*.R": true
    }

There does not seem to be much of an API yet to automatically set editors as read-only, apart from the commands "Set Active Editor Readonly in Session" etc., but maybe those will be added in the future and then we can set documents to read-only from within the extension.

ManuelHentschel avatar Jun 22 '23 14:06 ManuelHentschel

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Jun 23 '24 01:06 github-actions[bot]