From 34fe02c4c6dc4563d1eb19199a4dccc9e076ce7a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 10 Aug 2020 10:14:03 -0700 Subject: [PATCH] Move environmentVariableCollection into stable samples --- terminal-sample/package-lock.json | 6 +++--- terminal-sample/package.json | 4 ++-- terminal-sample/src/extension.ts | 22 +++++++++++----------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/terminal-sample/package-lock.json b/terminal-sample/package-lock.json index 6856019a..8ada9d36 100644 --- a/terminal-sample/package-lock.json +++ b/terminal-sample/package-lock.json @@ -55,9 +55,9 @@ "dev": true }, "@types/vscode": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.33.0.tgz", - "integrity": "sha512-JSmGiValbrcG5g20jjCfKakLiuWyrcjVezj+SEAEZ4klXQktE5EtowuGlkLVqbkiBK4iY5wy/4yW8OjecuHnjQ==", + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.47.0.tgz", + "integrity": "sha512-nJA37ykkz9FYA0ZOQUSc3OZnhuzEW2vUhUEo4MiduUo82jGwwcLfyvmgd/Q7b0WrZAAceojGhZybg319L24bTA==", "dev": true }, "@typescript-eslint/eslint-plugin": { diff --git a/terminal-sample/package.json b/terminal-sample/package.json index b3ed32e4..d5510d4f 100644 --- a/terminal-sample/package.json +++ b/terminal-sample/package.json @@ -5,7 +5,7 @@ "version": "0.0.1", "publisher": "vscode-samples", "engines": { - "vscode": "^1.33.0" + "vscode": "^1.47.0" }, "enableProposedApi": true, "categories": [ @@ -111,7 +111,7 @@ }, "devDependencies": { "@types/node": "^12.12.0", - "@types/vscode": "^1.33.0", + "@types/vscode": "^1.47.0", "@typescript-eslint/eslint-plugin": "^3.0.2", "@typescript-eslint/parser": "^3.0.2", "eslint": "^7.1.0", diff --git a/terminal-sample/src/extension.ts b/terminal-sample/src/extension.ts index 17a370ea..384876ba 100644 --- a/terminal-sample/src/extension.ts +++ b/terminal-sample/src/extension.ts @@ -127,6 +127,17 @@ export function activate(context: vscode.ExtensionContext) { selectTerminal(); })); + // ExtensionContext.environmentVariableCollection + context.subscriptions.push(vscode.commands.registerCommand('terminalTest.updateEnvironment', () => { + const collection = context.environmentVariableCollection; + collection.replace('FOO', 'BAR'); + collection.append('PATH', '/test/path'); + })); + + context.subscriptions.push(vscode.commands.registerCommand('terminalTest.clearEnvironment', () => { + context.environmentVariableCollection.clear(); + })); + // vvv Proposed APIs below vvv // vscode.window.onDidWriteTerminalData @@ -144,17 +155,6 @@ export function activate(context: vscode.ExtensionContext) { console.log(`onDidChangeTerminalDimensions: terminal:${event.terminal.name}, columns=${event.dimensions.columns}, rows=${event.dimensions.rows}`); }); })); - - context.subscriptions.push(vscode.commands.registerCommand('terminalTest.updateEnvironment', () => { - const collection = (context as any).environmentVariableCollection; - collection.replace('FOO', 'BAR'); - collection.append('PATH', '/test/path'); - })); - - context.subscriptions.push(vscode.commands.registerCommand('terminalTest.clearEnvironment', () => { - const collection = (context as any).environmentVariableCollection; - collection.clear(); - })); } function colorText(text: string): string {