Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a master list / documentation for when clauses for vscode keybindings? [closed]

Is there a master list / documentation for when clauses for vscode keybindings?

I can not find this documented anywhere. If I wanted to specify a different action. Say I wanted to have Ctrl+B start a build task when not in a task 'context' and terminate when I am in a task context.

I went through the file and wrote down every when I could find, but nothing looked like 'the thing'.

// Place your key bindings in this file to overwrite the defaults
[{
    "key": "cmd+b",
    "command": "workbench.action.tasks.build",
    "when": "editorTextFocus"
},{
    "key": "ctrl+c",
    "command": "workbench.action.tasks.terminate",
    "when": "???"
}
]
  • inDebugMode
  • inQuickOpen
  • editorTextFocus
  • suggestWidgetVisible
  • suggestionSupportsAcceptOnKey
  • editorLangId == 'xxx'
  • searchViewletVisible
  • renameInputVisible
  • accessibilityHelpWidgetVisible
  • quickFixWidgetVisible
  • parameterHintsVisible
  • referenceSearchVisible
  • !config.editor.stablePeek
  • markersNavigationVisible
  • editorFocus
  • inSnippetMode
  • breakpointWidgetVisible
  • findWidgetVisible
  • editorTabMovesFocus
  • editorHasSelection
  • editorHasMultipleSelections
  • inReferenceSearchEditor

(Also after writing this I found this post where a similar list is posted, but there is no way to be sure that we have the entire list

like image 239
ehiller Avatar asked Oct 18 '22 06:10

ehiller


1 Answers

Although I'm sure it's not definitive, this is the list provided by Microsoft .../when-clause-contexts

like image 124
Phil Hauser Avatar answered Oct 21 '22 04:10

Phil Hauser