From 945998524509f8f3c867955462e6d74f3bcbe2e4 Mon Sep 17 00:00:00 2001 From: Jason Poon Date: Sat, 29 Dec 2018 12:20:18 -0800 Subject: [PATCH 1/2] feat: add on as alias for only --- src/cmd_line/subparser.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd_line/subparser.ts b/src/cmd_line/subparser.ts index 44b28416387..a656f86e17b 100644 --- a/src/cmd_line/subparser.ts +++ b/src/cmd_line/subparser.ts @@ -88,6 +88,7 @@ export const commandParsers = { vne: fileCmd.parseEditNewFileInNewVerticalWindowCommandArgs, vnew: fileCmd.parseEditNewFileInNewVerticalWindowCommandArgs, + on: parseOnlyCommandArgs, only: parseOnlyCommandArgs, set: parseOptionsCommandArgs, From ae4a3b9bd094ed5451f4fb83486a3049d68568c3 Mon Sep 17 00:00:00 2001 From: Jason Poon Date: Sat, 29 Dec 2018 12:22:59 -0800 Subject: [PATCH 2/2] docs: add comments to vscode-context --- src/util/vscode-context.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/vscode-context.ts b/src/util/vscode-context.ts index dfbbb5a8ada..a2f4af6eb85 100644 --- a/src/util/vscode-context.ts +++ b/src/util/vscode-context.ts @@ -1,6 +1,11 @@ import * as vscode from 'vscode'; -export class VsCodeContextImpl { +/** + * Wrapper around VS Code's `setContext`. + * The API call takes several milliseconds to seconds to complete, + * so let's cache the values and only call the API when necessary. + */ +class VsCodeContextImpl { contextMap: { [key: string]: any } = {}; public async Set(key: string, value: any): Promise {