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.

Keybindings: provide some guidance on when-clause support

See original GitHub issue

I find when clauses are one of the most powerful features in VSCode keybinding story, but we have only very limited support for understanding it from the product itself.

We very likely have duplicates already for supporting intellisense etc. for contexts, but at the very minimum can we at least somehow link to https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts from the keybindings editor?

image

image

Maybe with some link in the table and maybe with an extra menu item close to the entry for “Change when expression”?

//cc @misolori @alexandrudima

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ArturoDentcommented, Aug 9, 2019

An example of my confusion: the new when-clause "when": "focusedView == nodeDependencies" (which hasn’t made it to https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts yet). Are the only possible views those identified in that link?

workbench.view.explorer - File Explorer workbench.view.search - Search workbench.view.scm - Source Control workbench.view.debug - Debug workbench.view.extensions - Extensions

and nothing more? Except presumably extension-contributed views like nodeDependencies.

What is the outline in the explorer? It doesn’t seem to be a view or at least I couldn’t get it to work with focusedView. And what is the difference between a view and a viewlet?

1reaction
infokillercommented, Sep 20, 2020

I also struggled with figuring out what conditions are available and what are their values in every context. I ended up debugging VSCode and storing the values which solved the issues I had, see here for details and a long list of available variables in when clauses for a few contexts: https://github.com/infokiller/config-public/tree/master/.config/Code/User/reference

Read more comments on GitHub >

github_iconTop Results From Across the Web

when clause contexts | Visual Studio Code Extension API
when clause contexts. Visual Studio Code sets various context keys and specific values depending on what elements are visible and active in the...
Read more >
Keybindings: Is there a `when` clause for the index of ...
Here's my current bindings: { "key": "ctrl+.", "command": "workbench.action.nextEditorInGroup", "when ...
Read more >
VS Code keyboard-fu: custom keyboard shortcuts that will ...
Keyboard shortcuts can help you achieve tasks quicker, and with less ... This is not intended to be a guide on keybindings in...
Read more >
Key Bindings for Visual Studio Code - vscode-docs1
Visual Studio Code provides a rich and easy keyboard shortcuts editing ... To help with this, File > Preferences > Keymap Extensions shows...
Read more >
Key Bindings - Onivim 2 User Manual
There are a set of default rules provided by Onivim, but the customized rules ... The key parameter supports both Vim style and...
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