Skip to content

Is it possible to open c/c++ or any text file with readonly mode in thiea #14083

Answered by msujew
wss29 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @wss29,

yes, see:

return new FileResource(uri, this.fileService, {
readOnly: readOnly,
shouldOverwrite: () => this.shouldOverwrite(uri),
shouldOpenAsText: error => this.shouldOpenAsText(uri, error)
});

See also this command in our example app that makes the whole file system readonly:

commands.registerCommand({
id: 'toggleFileSystemReadonly',
label: 'Toggle File System Readonly'
}, {
execute: () => {
const readonly = (this

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wss29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants