Skip to content
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

Closed
4 tasks done
isidorn opened this issue Jun 11, 2018 · 10 comments
Closed
4 tasks done

Readonly workspace folders #51585

isidorn opened this issue Jun 11, 2018 · 10 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues on-testplan release-notes Release notes issues
Milestone

Comments

@isidorn
Copy link
Contributor

isidorn commented Jun 11, 2018

  • add API that a FileSystemProvider can be readonly
  • open readonly files using readonly editors
  • disable all context menu commands in the explorer which do not make sense on a readonly resource
  • disable all actions (explorer title) that do not make sense on a readonly resource
@isidorn isidorn added feature-request Request for new features or functionality file-explorer Explorer widget issues labels Jun 11, 2018
@isidorn isidorn added this to the June 2018 milestone Jun 11, 2018
@isidorn isidorn self-assigned this Jun 11, 2018
@IlyaBiryukov
Copy link

What granularity is this read-only support going to be? Per workspace, per root, or per file?
There is a feature request for file-level read-onliness, #17670

How about other actions that can potentially mutate user state? Like find-and-replace or code actions?
Is debugging in scope?

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.

@isidorn
Copy link
Contributor Author

isidorn commented Jun 19, 2018

@IlyaBiryukov the read only will be per FileSystemProvider - which in practice means per root. Thus each file in that root will be read only. And extensions will be able to contribute this when they register a FileSystemProvider.

As for various actions we will try to support this property in as many places as possible - however this is currently work in progress.

@isidorn
Copy link
Contributor Author

isidorn commented Jun 21, 2018

We have done what we have planned for this milestone -> closing.
If there are subsequent feature requests we can treat them in new issues.

@IlyaBiryukov you can try it out in tomorrow's insiders

@isidorn isidorn closed this as completed Jun 21, 2018
@IlyaBiryukov
Copy link

@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.

@isidorn
Copy link
Contributor Author

isidorn commented Jun 27, 2018

@IlyaBiryukov he can re-register

@IlyaBiryukov
Copy link

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?

@IlyaBiryukov
Copy link

@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.

@IlyaBiryukov
Copy link

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.

@isidorn
Copy link
Contributor Author

isidorn commented Jun 28, 2018

@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
workbench.files.action.refreshFilesExplorer

Also please create seperate issues and ping me on them regarding other issues you hit.
Thanks a lot

@isidorn isidorn added the release-notes Release notes issues label Jun 28, 2018
@IlyaBiryukov
Copy link

workbench.files.action.refreshFilesExplorer command did not help.

Here are the issues:
#53256, #53257

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues on-testplan release-notes Release notes issues
Projects
None yet
Development

No branches or pull requests

2 participants