-
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
Enablement using listDoubleSelection and listMultiSelection not working in contributed view #99767
Comments
This is not quite working yet due to microsoft/vscode#99767
It looks like |
They should 🤔 : vscode/src/vs/platform/list/browser/listService.ts Lines 867 to 868 in cadabab
Must be a bug in some place. I would put my $$$ on which context key service the query is run on. |
@alexr00 Where is that |
I see it read here:
Then that precondition gets read in many places. Not sure which one is applicable here, but can do some digging.
|
This is probably related: I've been trying to achieve the same thing (showing/hiding specific commands in a custom tree view based on whether there are multiple items selected) by using If it is in fact possible to show/hide |
This is not quite ideal due to microsoft/vscode#99767 Allow multiselection in the query-history view. For commands that shouldn't accept multiple options, show a user message to that effect. For remove query, allow multiple removals at once. For compare query, allow selecting of exactly two queries. Otherwise, throw an error. Also, verify that the selected queries are compatible to compare.
This is not quite ideal due to microsoft/vscode#99767 Allow multiselection in the query-history view. For commands that shouldn't accept multiple options, show a user message to that effect. For remove query, allow multiple removals at once. For compare query, allow selecting of exactly two queries. Otherwise, throw an error. Also, verify that the selected queries are compatible to compare.
This is not quite ideal due to microsoft/vscode#99767 Allow multiselection in the query-history view. For commands that shouldn't accept multiple options, show a user message to that effect. For remove query, allow multiple removals at once. For compare query, allow selecting of exactly two queries. Otherwise, throw an error. Also, verify that the selected queries are compatible to compare.
@alexr00 I would've made some $$$ here. 💸 |
@joaomoreno indeed you would. Thanks for the context key service idea! |
1. Clicking on query history menu items when nothing is selected. Error message is clearer. It would be better to disable when nothing is selected, but waiting on microsoft/vscode#99767 to be released. 2. Trying to run query with a missing or invalid qlpack has better message. 3. Better hover text for "Open query".
1. Clicking on query history menu items when nothing is selected. Error message is clearer. It would be better to disable when nothing is selected, but waiting on microsoft/vscode#99767 to be released. 2. Trying to run query with a missing or invalid qlpack has better message. 3. Better hover text for "Open query".
1. Clicking on query history menu items when nothing is selected. Error message is clearer. It would be better to disable when nothing is selected, but waiting on microsoft/vscode#99767 to be released. 2. Trying to run query with a missing or invalid qlpack has better message. 3. Better hover text for "Open query". Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
1. Clicking on query history menu items when nothing is selected. Error message is clearer. It would be better to disable when nothing is selected, but waiting on microsoft/vscode#99767 to be released. 2. Trying to run query with a missing or invalid qlpack has better message. 3. Better hover text for "Open query". Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com>
Issue Type: Bug
I am creating an extension with a custom view. I am trying to make sure that certain commands are only enabled when there are two items selected and other commands when only a single item is selected.
I have tried using
"enablement": "listDoubleSelection"
and"enablement": "!listMultiSelection"
in the command declaration for these cases. However, it looks like the valueslistMultiSelection
andlistDoubleSelection
are always false.Perhaps I'm doing something wrong, but I'm pretty sure I'm following the docs.
I'm attaching a zip of a sample project that illustrates the problem I'm having.
multi-select-bug.zip
To reproduce:
VS Code version: Code 1.45.1 (5763d90, 2020-05-14T08:33:47.663Z)
OS version: Darwin x64 19.5.0
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Extensions (22)
(1 theme extensions excluded)
The text was updated successfully, but these errors were encountered: