8000 Implements dryRun for workbench.extensions.action.debugExtensionHost · githubnext/vscode@1f6f8fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f6f8fb

Browse files
committed
Implements dryRun for workbench.extensions.action.debugExtensionHost
1 parent 4caa46a commit 1f6f8fb

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/vs/workbench/contrib/extensions/electron-sandbox/debugExtensionHostAction.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export class DebugExtensionHostAction extends Action {
2828
super(DebugExtensionHostAction.ID, DebugExtensionHostAction.LABEL, DebugExtensionHostAction.CSS_CLASS);
2929
}
3030

31-
override async run(): Promise<any> {
32-
31+
override async run(args: unknown): Promise<any> {
3332
const inspectPorts = await this._extensionService.getInspectPorts(ExtensionHostKind.LocalProcess, false);
3433
if (inspectPorts.length === 0) {
3534
const res = await this._dialogService.confirm({
@@ -49,11 +48,15 @@ export class DebugExtensionHostAction extends Action {
4948
console.warn(`There are multiple extension hosts available for debugging. Picking the first one...`);
5049
}
5150

52-
return this._debugService.startDebugging(undefined, {
53-
type: 'node',
54-
name: nls.localize('debugExtensionHost.launch.name', "Attach Extension Host"),
55-
request: 'attach',
56-
port: inspectPorts[0].port,
57-
});
51+
if (args !== undefined && (args as any)[0].dryRun) {
52+
return { inspectPorts };
53+
} else {
54+
return this._debugService.startDebugging(undefined, {
55+
type: 'node',
56+
name: nls.localize('debugExtensionHost.launch.name', "Attach Extension Host"),
57+
request: 'attach',
58+
port: inspectPorts[0].port,
59+
});
60+
}
5861
}
5962
}

src/vs/workbench/contrib/extensions/electron-sandbox/extensions.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ workbenchRegistry.registerWorkbenchContribution(ExtensionsAutoProfiler, Lifecycl
7777
workbenchRegistry.registerWorkbenchContribution(RemoteExtensionsInitializerContribution, LifecyclePhase.Restored);
7878
// Register Commands
7979

80-
CommandsRegistry.registerCommand(DebugExtensionHostAction.ID, (accessor: ServicesAccessor) => {
80+
CommandsRegistry.registerCommand(DebugExtensionHostAction.ID, (accessor: ServicesAccessor, ...args) => {
8181
const instantiationService = accessor.get(IInstantiationService);
82-
instantiationService.createInstance(DebugExtensionHostAction).run();
82+
return instantiationService.createInstance(DebugExtensionHostAction).run(args);
8383
});
8484

8585
CommandsRegistry.registerCommand(StartExtensionHostProfileAction.ID, (accessor: ServicesAccessor) => {

0 commit comments

Comments
 (0)
0