Skip to content

Commit

Permalink
chore: adopt new terminal profile contribution point
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Jun 1, 2021
1 parent 9a4ed83 commit 5303fa0
Show file tree
Hide file tree
Showing 7 changed files with 2,743 additions and 1,786 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This changelog records changes to stable releases since 1.50.2. "TBA" changes he
- feat: allow limited adjustment of launch config options during restart ([ref](https://github.com/microsoft/vscode/issues/118196))
- fix: worker processes breaking sessions when attaching multiple times ([ref](https://github.com/microsoft/vscode/issues/124045))
- fix: wrong name of autogenerated edge debug config
- chore: adopt new terminal profile contribution point ([ref](https://github.com/microsoft/vscode/issues/120369))

## v1.56 (April 2021)

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
"onDebugInitialConfigurations",
"onDebugResolve:node",
"onDebugResolve:extensionHost",
"onDebugResolve:chrome"
"onDebugResolve:chrome",
"onTerminalProfile:extension.js-debug.debugTerminal"
],
"extensionKind": [
"workspace"
Expand Down Expand Up @@ -203,9 +204,9 @@
}
],
"terminal": {
"types": [
"profiles": [
{
"command": "extension.js-debug.createDebuggerTerminal",
"id": "extension.js-debug.debugTerminal",
"title": "%debug.terminal.label%",
"icon": "$(debug)"
}
Expand Down
11 changes: 10 additions & 1 deletion src/targets/node/terminalNodeLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ export class TerminalNodeLauncher extends NodeLauncherBase<ITerminalLaunchConfig
fileCallback: this.callbackFile,
});

const terminal = vscode.window.createTerminal({
const terminal = await this.createTerminal({
name: runData.params.name,
cwd: runData.params.cwd,
// todo: add icon once https://github.com/microsoft/vscode/issues/125137 is fixed
// iconPath: new vscode.ThemeIcon("debug"),
env: hideDebugInfoFromConsole(binary, env).defined(),
});
this.terminalCreatedEmitter.fire(terminal);
Expand All @@ -150,6 +152,13 @@ export class TerminalNodeLauncher extends NodeLauncherBase<ITerminalLaunchConfig
});
}

/**
* Creates a terminal with the requested options.
*/
protected createTerminal(options: vscode.TerminalOptions) {
return Promise.resolve(vscode.window.createTerminal(options));
}

/**
* @inheritdoc
*/
Expand Down
1 change: 1 addition & 0 deletions src/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ export class TestRoot {
isVsCode: true,
context: upcastPartial<ExtensionContext>({
workspaceState: {
keys: [],
get<T>(key: string, defaultValue?: T) {
return workspaceState.get(key) ?? defaultValue;
},
Expand Down
Loading

0 comments on commit 5303fa0

Please sign in to comment.