mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Move environmentVariableCollection into stable samples
This commit is contained in:
6
terminal-sample/package-lock.json
generated
6
terminal-sample/package-lock.json
generated
@ -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": {
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user