You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit package.json to require a newer version of vscode than the sample's default. I changed "vscode": "^1.23.0" to "vscode": "^1.31.0". This is necessary in order to get use of the isReadonly option on vscode.workspace.registerFileSystemProvider
npm install in Terminal
Edit src/extension.ts to add that isReadonly: true to the options parameter.
F5
When Extension Development Host window opens, switch to it, press F1 and run 'MemFS: Setup Workspace', then F1 again and 'MemFS: Create Files'.
Switch to Explorer view.
Single-click on one of the files, e.g. file.js and observe that the tab caption lacks the '(read-only)' suffix.
Try typing into the document and verify it is correctly read-only.
Doubleclick on the tab to persist it. The caption now gets the expected '(read-only)' suffix.
Also notice the weird doubled-up '(read-only) (read-only)' on the titlebar. Is this intentional?
The text was updated successfully, but these errors were encountered:
But until there's a repaint of the tab (a simple click on it is sufficient) it doesn't have the ' (read-only)' suffix.
I wasn't able to work out how to trigger this from code after the above line has updated the readOnly option of textEditor. If you can give me a pointer maybe I can submit a PR.
@gjsjohnmurray do you still see this? If yes we should make a change here
What is missing it seems is the textFileService should have an event which fires when the model becomes readonly. fyi @bpasero
Steps to Reproduce:
Obtain the MemFS sample (git clone https://github.com/Microsoft/vscode-extension-samples and then go to the fsprovider-sample subdir)
Edit package.json to require a newer version of vscode than the sample's default. I changed
"vscode": "^1.23.0"
to"vscode": "^1.31.0"
. This is necessary in order to get use of the isReadonly option onvscode.workspace.registerFileSystemProvider
npm install
in TerminalEdit src/extension.ts to add that
isReadonly: true
to the options parameter.F5
When Extension Development Host window opens, switch to it, press F1 and run 'MemFS: Setup Workspace', then F1 again and 'MemFS: Create Files'.
Switch to Explorer view.
Single-click on one of the files, e.g. file.js and observe that the tab caption lacks the '(read-only)' suffix.
Try typing into the document and verify it is correctly read-only.
Doubleclick on the tab to persist it. The caption now gets the expected '(read-only)' suffix.
Also notice the weird doubled-up '(read-only) (read-only)' on the titlebar. Is this intentional?
The text was updated successfully, but these errors were encountered: