Skip to content

Commit

Permalink
Move environmentVariableCollection into stable samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Aug 10, 2020
1 parent 22d5639 commit 34fe02c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions terminal-sample/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions terminal-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.0.1",
"publisher": "vscode-samples",
"engines": {
"vscode": "^1.33.0"
"vscode": "^1.47.0"
},
"enableProposedApi": true,
"categories": [
Expand Down Expand Up @@ -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",
Expand Down
22 changes: 11 additions & 11 deletions terminal-sample/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 34fe02c

Please sign in to comment.