From f3e04fbbabe2887542a9bb57fffcabc7cb50d406 Mon Sep 17 00:00:00 2001 From: vsrs Date: Wed, 27 May 2020 19:40:13 +0300 Subject: Add `inRustProject` when-clause for commands. --- editors/code/src/util.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'editors/code/src/util.ts') diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index 793c481fb68..352ef9162f3 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts @@ -94,3 +94,8 @@ export function isValidExecutable(path: string): boolean { return res.status === 0; } + +/** Sets ['when'](https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts) clause contexts */ +export function setContextValue(key: string, value: any): Thenable { + return vscode.commands.executeCommand('setContext', key, value); +} -- cgit 1.4.1-3-g733a5