Skip to content

Add a setting to mark a set of files as readonly #161715

@jackpunt

Description

@jackpunt

There are classes of files (generated files, tsc .js output [goto-source], log files, others) that are OS-writeable,
but are semantically intended to be 'readonly' (not editable);

Need a way, in configuration settings.json to indicate which files/directories (globs) are to be treated as readonly.


The associated PR interposes on TextEditorModel.isReadonly() to mark glob-designated files as readonly
providing a 99% solution for #4873 (6 yrs & 378 upvotes)

This first PR is without a 'mode' or interactive 'keyboard command'; (altho, yes: I love the feature in gnuemacs)
but users can quickly edit settings.json to change state of individual files,
or when sufficiently motivated, write an extension command to auto-edit settings.json.

Update: code to support interactive command to set or toggle readonly now available (see below)
Update: code to recognize and mark files that are chmod-readonly in the filesystem.

Also: #17670, #33823, #12227, #67622, #82748, #99322

Metadata

Metadata

Assignees

No one assigned

    Labels

    *duplicateIssue identified as a duplicate of another issue(s)feature-requestRequest for new features or functionalityfile-ioFile I/Oworkbench-editorsManaging of editor widgets in workbench window

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions