-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'(read-only)' suffix no longer added to tab labels of files served by readonly filesystem #82964
Comments
(Experimental duplicate detection) |
Branch at https://github.com/gjsjohnmurray/vscode-extension-samples/tree/show-82964 simply amends the MemFS sample so it registers as a readonly FileSystemProvider. The files created by first running |
The issue here is as I have already mentioned in an older issue: |
@isidorn yeah makes sense to me. we would probably not be able to detect this change unless the tab gets loaded again because there is no file event when this happens. |
I'm not clear why it worked OK before 1.39. Even now it's not (yet) possible to set an individual file as read-only. All we can do is register a FileSystemProvider with |
Isi would maybe know under which condition this can happen. |
It was working because we were caching the title less agressivly. |
@isidorn I hope you agree that we at least need to initialize the cached value correctly. If a file is opened from a readonly FileSystemProvider it is correctly treated as readonly in VSCode. But since this change we have lost the indicator text. Surely a regression, no? |
@isidorn I think this is unrelated to the file model, but rather we might need to have another event that causes all file editor inputs to loose their caches when a file system provider becomes available? The way I see it:
The model layer is too late because most tabs that visually appear in the editor are not loaded until you click them. |
This makes sense. |
@isidorn no, that hasn't fixed the issue for me. I just tested with the following using the MemFS example branch previously notified:
|
Thanks for letting us know, let me reopen and setup your reproducable steps |
I am open for ideas. Maybe we need a new event when a new model is added to the |
@isidorn @gjsjohnmurray this should no longer be a problem in latest because for a couple of days now editor inputs have a
Can you verify? PS: I still wonder if we need to catch the case of a file system provider suddenly becoming readonly or not. |
@bpasero verified using my https://github.com/gjsjohnmurray/vscode-extension-samples/tree/show-82964 branch. Thanks! Version: 1.41.0-insider (user setup) |
Thanks for verifiying, adding verified label |
@bpasero I'm unclear what you mean here. IIRC a FileSystemProvider can only declare itself readonly when it registers. I guess if it registered with readOnly: false there'd be nothing stopping it from later making all of its files report themselves as readonly. |
@gjsjohnmurray yeah nevermind, internally we allow changes to capabilities but I think that is just not surfaced as extension API. |
Issue Type: Bug
Looks like the work in 54c3db1 by @isidorn maybe resulted in the '(read-only)' suffix no longer getting added to the tab label of a file opened from a readonly filesystem. This used to work correctly in 1.38, though only after an additional click (see #69651).
The issue also exists in the latest Insiders.
I will prepare a branch of the MemFS sample to repro the issue.
VS Code version: Code 1.39.2 (6ab5985, 2019-10-15T15:35:18.241Z)
OS version: Windows_NT x64 10.0.17134
The text was updated successfully, but these errors were encountered: