-
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
Add in
operator support to when clauses
#97544
Comments
This can not be solved just to be specific to the explorer, thus unassing myself. |
Hi, Looks great to me! would solve allot of problems. |
This comment has been minimized.
This comment has been minimized.
Hi, |
@idoprz I've opened a PR for this feature. Hopefully we can get it in soon. |
Amazing! Thanks for following through. |
Refs: #96927
There is a desire to be able to show a context menu command conditionally on explorer folders (or others) based on computed/determined criteria. For example, lets say I have a folder with a certain file type in it (or all of the same type) and I want to offer a command to only show up for folders that match that criteria. Today this isn't possible, since we don't offer any trigger on selection in the explorer tree (so you can't set a "global" context value), nor is it possible to lookup a context value using another context value.
To address this I propose a new
in
operator to be supported. Thisin
operator would allow using an existing context key as a lookup key into another context value. The target of thein
would be either an array or an object.For example:
Given something like the following context key,
foldersToShowCommandFor: [ 'test', 'src/foo', 'src/foo/bar' ];
You'd then be able to use the following
when
on a command:@idoprz Please add any more details or specifics about your use case too.
//cc @alexdima @jrieken
The text was updated successfully, but these errors were encountered: