-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Readonly workspace folders #51585
Comments
What granularity is this read-only support going to be? Per workspace, per root, or per file? How about other actions that can potentially mutate user state? Like find-and-replace or code actions? Extensions should be able to contribute to how VS Code detects read only status of files. FileSystemProvider is a good place where it could query if a given file (or the whole file system) is read-only. |
@IlyaBiryukov the read only will be per As for various actions we will try to support this property in as many places as possible - however this is currently work in progress. |
We have done what we have planned for this milestone -> closing. @IlyaBiryukov you can try it out in tomorrow's insiders |
@isidorn How a file system provider can change its read-only state once it has been opened by VSCode? The scenario is when read-only limit is lifted or imposed mid session. |
@IlyaBiryukov he can re-register |
I tried that and didn't see any effect (the file system provider was in use when I disposed the old one and registered the new one). How can I re-register it when VSCode has already opened a work space that uses this scheme? |
@isidorn, In particular, open documents tend to stick with read-only status they were opened with. If underlying file system provider changes, open documents do not change their read-only status, and there is no way to tell them do that. Even if I close and re-open them, they do not update their read-only status. |
Other issue I see is that when an extension applies edits to the documents opened from a read-only file provider, the document becomes marked as 'dirty' but saving it always fails with an error "Failed to save 'bar.js': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.", retrying as administrator does nothing and repeats the error. |
@IlyaBiryukov thanks for the feedback. This milestone we have done the initial work for the readonly workspaces, dynamic registration is possible in theory but in practice there are limitations as you have noticed. The current issue is that once a file is resolved and it is readonly it will not change. Thus as a workaround for now I suggest that your extension after re-registering a file system provider forces an explorer refresh by executing this command Also please create seperate issues and ping me on them regarding other issues you hit. |
The text was updated successfully, but these errors were encountered: