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

Expose FileSystemProvider stat information to the resource when clause #73576

Closed
plus- opened this issue May 10, 2019 · 4 comments
Closed

Expose FileSystemProvider stat information to the resource when clause #73576

plus- opened this issue May 10, 2019 · 4 comments
Assignees
Labels
file-io File I/O *out-of-scope Posted issue is not in scope of VS Code

Comments

@plus-
Copy link

plus- commented May 10, 2019

Feature Request:
Right now the when clause context for resources is limited to resourceScheme resourceFilename resourceExtname resourceLangId

When implementing a FileSystemProvider, it would be usefull to either be able to hook a function from the provider to the when clause context, or at least expose the result of the provider stat function for any given resource in order to use one of our custom boolean properties.

Use case example:
Implementing a remote fs that supports locking resources, I would like to implement explorer contextual menu actions (lock or unlock) that are filtered based on the lock status of the resource.
This is the same idea behind any permission based actions.

@jrieken
Copy link
Member

jrieken commented May 10, 2019

Implementing a remote fs that supports locking resources,

Hm, the fs provider API doesn't support locking... How would you represent that in the stat model?

@jrieken jrieken added file-io File I/O info-needed Issue requires more information from poster labels May 10, 2019
@plus-
Copy link
Author

plus- commented May 11, 2019

Well since any provider can extend the stat model it could be a non issue.

For example in my fileSystemProvider stat is returning my own implementation of the FileStat to add some custom properties like isCheckedOut

Now I'm not sure how the when clauses are evaluated (is there a templating engine?), but my thinking was we could expose the stat result to do something like:

stat.name == foo or in my previous example we could evaluate on the fly when we right click:

"menus": {
    "explorer/context": [{
        "command": "cmis.cancelCheckout",
        "when": "resourceScheme == cmis && stat.isCheckedOut"

Hope it make sense

@jrieken
Copy link
Member

jrieken commented May 11, 2019

Well since any provider can extend the stat model it could be a non issue.

It actually is because the extension runs in a different process than the UI - in which context keys are evaluated. So, this actually is the challenge...

@jrieken jrieken added *out-of-scope Posted issue is not in scope of VS Code and removed info-needed Issue requires more information from poster labels May 24, 2019
@vscodebot
Copy link

vscodebot bot commented May 24, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file-io File I/O *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

2 participants