Skip to content

Commit

Permalink
extHost startDebugging minor polish
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Sep 19, 2019
1 parent c4a6fc1 commit a9c67d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/vs/workbench/api/browser/mainThreadDebugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
*--------------------------------------------------------------------------------------------*/

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

public $startDebugging(options: IStartDebuggingOptions): Promise<boolean> {
const folderUri = options.folder ? uri.revive(options.folder) : undefined;
public $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise<boolean> {
const folderUri = folder ? uri.revive(folder) : undefined;
const launch = this.debugService.getConfigurationManager().getLaunch(folderUri);
const debugOptions: IDebugSessionOptions = {
noDebug: false,
parentSession: this.getSession(options.parentSessionID),
repl: options.repl
};
return this.debugService.startDebugging(launch, options.nameOrConfig, debugOptions).then(success => {
return this.debugService.startDebugging(launch, nameOrConfig, debugOptions).then(success => {
return success;
}, err => {
return Promise.reject(new Error(err && err.message ? err.message : 'cannot start debugging'));
Expand Down
4 changes: 1 addition & 3 deletions src/vs/workbench/api/common/extHost.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,6 @@ export interface IDebugConfiguration {
}

export interface IStartDebuggingOptions {
folder: UriComponents | undefined;
nameOrConfig: string | IDebugConfiguration;
parentSessionID?: DebugSessionUUID;
repl?: IDebugSessionReplMode;
}
Expand All @@ -730,7 +728,7 @@ export interface MainThreadDebugServiceShape extends IDisposable {
$registerDebugAdapterDescriptorFactory(type: string, handle: number): Promise<void>;
$unregisterDebugConfigurationProvider(handle: number): void;
$unregisterDebugAdapterDescriptorFactory(handle: number): void;
$startDebugging(options: IStartDebuggingOptions): Promise<boolean>;
$startDebugging(folder: UriComponents | undefined, nameOrConfig: string | IDebugConfiguration, options: IStartDebuggingOptions): Promise<boolean>;
$setDebugSessionName(id: DebugSessionUUID, name: string): void;
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): Promise<any>;
$appendDebugConsole(value: string): void;
Expand Down
4 changes: 1 addition & 3 deletions src/vs/workbench/api/node/extHostDebugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,7 @@ export class ExtHostDebugService implements IExtHostDebugService, ExtHostDebugSe
}

public startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration, options: vscode.DebugSessionOptions): Promise<boolean> {
return this._debugServiceProxy.$startDebugging({
folder: folder ? folder.uri : undefined,
nameOrConfig,
return this._debugServiceProxy.$startDebugging(folder ? folder.uri : undefined, nameOrConfig, {
parentSessionID: options.parentSession ? options.parentSession.id : undefined,
repl: options.consoleMode === DebugConsoleMode.MergeWithParent ? 'mergeWithParent' : 'separate'
});
Expand Down

0 comments on commit a9c67d8

Please sign in to comment.