Docs > when clause contexts > view identifiers: workbench.view.scm is not correct, workbench.scm is
See original GitHub issueDoes this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.73.1, Electron 19.0.17, Node 16.14.2, Chromium 102.0.5005.167,
- OS Version: Windows_NT x64 10.0.22000
Referring to this: https://code.visualstudio.com/api/references/when-clause-contexts#activefocused-view-or-panel-when-clause-context
When clause contexts’ Source Control’s view identifier is not workbench.view.scm
as docs state, but is actually workbench.scm
. I discovered this while writing
key binding with focusedView == workbench.view.scm
, it would never be true,
but it works correctly with focusedView == workbench.scm
. I got this value from
Developer: Inspect context keys command.
Steps to Reproduce:
- Try to create any keybind with focusedView == ‘workbench.view.scm’, shouldn’t work Try adding this for example:
{
"key": "escape",
"command": "workbench.explorer.fileView.focus",
"when": "focusedView == workbench.view.scm"
},
- Change when clause to focusedView == ‘workbench.scm’ should work now
{
"key": "escape",
"command": "workbench.explorer.fileView.focus",
"when": "focusedView == workbench.scm"
},
Looks like a “typo” while writing the docs, or internally view identifiers changed and docs were not updated.
I did not check if other IDs are correct, like workbench.view.search
etc,
they might be wrong in the same way as well.
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
Thanks @sandy081 for the clarifications. Could you please work with @gregvanl to update the page? Thank you!
I see the confusion here - we have view containers (viewlets/panels) and views. There are following three contexts
activeViewlet
- which expects viewlet/view container idactivePanel
- which expects panel/view container idfocusedView
- which expects view idProbably we shall update the doc by listing viewlets and views ids.