Skip to content

Enablement using listDoubleSelection and listMultiSelection not working in contributed view #99767

@aeisenberg

Description

@aeisenberg

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 values listMultiSelection and listDoubleSelection 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:

  1. unzip the workspace above
  2. open workspace in vscode
  3. run the extension
  4. open the view with the icon like this: package_json_—_multi-select-bug
  5. select one or multiple items in the list view and right click. Notice that the enablement of the commands does not follow what is in the package.json file.

VS Code version: Code 1.45.1 (5763d90, 2020-05-14T08:33:47.663Z)
OS version: Darwin x64 19.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
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
Load (avg) 2, 3, 3
Memory (System) 64.00GB (34.46GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (22)
Extension Author (truncated) Version
vscode-markdownlint Dav 0.36.0
vscode-eslint dba 2.1.5
gitlens eam 10.2.1
tsl-problem-matcher eam 0.2.0
vscode-html-css ecm 0.2.3
prettier-vscode esb 5.0.0
vscode-diff fab 1.4.0
wolfram-language fli 0.1.0
vscode-codeql Git 1.2.2
vscode-pull-request-github Git 0.16.0
vscode-test-explorer hbe 2.19.1
mysql-syntax jak 1.3.1
vscode-edit-csv jan 0.2.9
code-beautifier mic 2.3.3
vscode-docker ms- 1.2.1
azure-account ms- 0.8.11
vscode-typescript-tslint-plugin ms- 1.2.3
vsliveshare ms- 1.0.2274
debugger-for-chrome msj 4.12.8
vscode-react-native msj 0.16.0
vscode-zipexplorer sle 0.3.1
html-css-class-completion Zig 1.19.0

(1 theme extensions excluded)

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code Insiderstree-viewsExtension tree view issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions