-
Notifications
You must be signed in to change notification settings - Fork 29.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
VSCode Extension: Disable tree items when enablement clause on linked command is false #102794
Comments
@sandy081 is this something that the VSCode team would be interested in at all in adding so the experience is more consistent? |
Forwarding to @alexr00 |
I think this makes sense as a feature request. If a tree item has a |
@alexr00 has this been confirmed as a feature to be put into your own backlog or what happens with the process next? I may have some time next week to see if I can try & get my hands dirty and do my first PR for this if this is not due to be picked up into your own backlog of work items for a while. |
Full info on how our backlog works in the wiki: https://github.com/microsoft/vscode/wiki/Issues-Triaging#assigning-a-milestone I like the feature idea but have no plans to do it anytime soon. If you want to make a PR you are welcome to, but this might not be a good first issue. Likely needs changes here https://github.com/Microsoft/vscode/blob/de39b1df90cdadab35fe6f2ee63b7aa0d87e3a90/src/vs/workbench/contrib/views/browser/treeView.ts#L724-L724 |
@alexr00, I'm afraid this is a bug, not a feature request, can it be re-labeled and re-prioritized?
The bug here is it doesn't work when a dynamic context value is used, unless something else causes the node to be re-rendered. It doesn't work if you use the global Here's an easy to reproduce example of why this is a bug. Make a command with Here's a GIF showing the buggy behavior:
Furthermore, it really seems |
Fixed by #157516 |
Goal/requirement
I am building a VSCode extension and currently creating a new custom view that will have tree items linked to commands.
The goal is to greyout/disable certain tree items when the enablement property on a command evaluates to true false.
This works fine when the commands that are added as menu items to the view and will grey out the icon & will not be able to be clicked, however, I would have expected the same result to happen with the items in the tree.
Screenshot
Example code
Package.json
My tree menu items are added to the view in the following way
And in the main extension entry point
The text was updated successfully, but these errors were encountered: