Skip to content

Commit a9c67d8

Browse files
committed
extHost startDebugging minor polish
1 parent c4a6fc1 commit a9c67d8

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/vs/workbench/api/browser/mainThreadDebugService.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { DisposableStore } from 'vs/base/common/lifecycle';
7-
import { URI as uri } from 'vs/base/common/uri';
7+
import { URI as uri, UriComponents } from 'vs/base/common/uri';
88
import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, IDebugAdapter, IDebugAdapterDescriptorFactory, IDebugSession, IDebugAdapterFactory, IDataBreakpoint, IDebugSessionOptions } from 'vs/workbench/contrib/debug/common/debug';
99
import {
1010
ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID, MainContext,
11-
IExtHostContext, IBreakpointsDeltaDto, ISourceMultiBreakpointDto, ISourceBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto, IDataBreakpointDto, IStartDebuggingOptions
11+
IExtHostContext, IBreakpointsDeltaDto, ISourceMultiBreakpointDto, ISourceBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto, IDataBreakpointDto, IStartDebuggingOptions, IDebugConfiguration
1212
} from 'vs/workbench/api/common/extHost.protocol';
1313
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
1414
import severity from 'vs/base/common/severity';
@@ -218,15 +218,15 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
218218
return undefined;
219219
}
220220

221-
public $startDebugging(options: IStartDebuggingOptions): Promise<boolean> {
222-
const folderUri = options.folder ? uri.revive(options.folder) : undefined;
221+
public $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise<boolean> {
222+
const folderUri = folder ? uri.revive(folder) : undefined;
223223
const launch = this.debugService.getConfigurationManager().getLaunch(folderUri);
224224
const debugOptions: IDebugSessionOptions = {
225225
noDebug: false,
226226
parentSession: this.getSession(options.parentSessionID),
227227
repl: options.repl
228228
};
229-
return this.debugService.startDebugging(launch, options.nameOrConfig, debugOptions).then(success => {
229+
return this.debugService.startDebugging(launch, nameOrConfig, debugOptions).then(success => {
230230
return success;
231231
}, err => {
232232
return Promise.reject(new Error(err && err.message ? err.message : 'cannot start debugging'));

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,6 @@ export interface IDebugConfiguration {
714714
}
715715

716716
export interface IStartDebuggingOptions {
717-
folder: UriComponents | undefined;
718-
nameOrConfig: string | IDebugConfiguration;
719717
parentSessionID?: DebugSessionUUID;
720718
repl?: IDebugSessionReplMode;
721719
}
@@ -730,7 +728,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
730728
$registerDebugAdapterDescriptorFactory(type: string, handle: number): Promise<void>;
731729
$unregisterDebugConfigurationProvider(handle: number): void;
732730
$unregisterDebugAdapterDescriptorFactory(handle: number): void;
733-
$startDebugging(options: IStartDebuggingOptions): Promise<boolean>;
731+
$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise<boolean>;
734732
$setDebugSessionName(id: DebugSessionUUID, name: string): void;
735733
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
736734
$appendDebugConsole(value: string): void;

src/vs/workbench/api/node/extHostDebugService.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@ export class ExtHostDebugService implements IExtHostDebugService, ExtHostDebugSe
253253
}
254254

255255
public startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration, options: vscode.DebugSessionOptions): Promise<boolean> {
256-
return this._debugServiceProxy.$startDebugging({
257-
folder: folder ? folder.uri : undefined,
258-
nameOrConfig,
256+
return this._debugServiceProxy.$startDebugging(folder ? folder.uri : undefined, nameOrConfig, {
259257
parentSessionID: options.parentSession ? options.parentSession.id : undefined,
260258
repl: options.consoleMode === DebugConsoleMode.MergeWithParent ? 'mergeWithParent' : 'separate'
261259
});

0 commit comments

Comments
 (0)