question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs > when clause contexts > view identifiers: workbench.view.scm is not correct, workbench.scm is

See original GitHub issue

Does 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:

  1. 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"
  },
  1. 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:open
  • Created 10 months ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lszomorucommented, Dec 20, 2022

Thanks @sandy081 for the clarifications. Could you please work with @gregvanl to update the page? Thank you!

1reaction
sandy081commented, Dec 20, 2022

I see the confusion here - we have view containers (viewlets/panels) and views. There are following three contexts

  • activeViewlet - which expects viewlet/view container id
  • activePanel - which expects panel/view container id
  • focusedView - which expects view id

Probably we shall update the doc by listing viewlets and views ids.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docs > when clause contexts > view identifiers: workbench ...
Docs > when clause contexts > view identifiers: workbench.view.scm is not correct, workbench.scm is · Run details · Usage · Workflow file.
Read more >
when clause contexts | Visual Studio Code Extension API
You can have a when clause that checks if a specific view or panel is visible. View Identifiers: workbench. view.
Read more >
CA Harvest Software Change Manager Messages Guide
Cannot delete version %s1 of %s2; this version is active in another view. Reason: CA Harvest SCM will not delete versions that are...
Read more >
Key Bindings for Visual Studio Code - vscode-docs-arc
You can view any user modified keyboard shortcuts in VS Code in the Keyboard Shortcuts ... workbench.view.scm - Source Control; workbench.view.debug - Run ......
Read more >
Open Workbench User Guide
Documentation is proprietary information of CA and may not be copied, transferred, ... Define Open Workbench View Display Colors .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found