extHost startDebugging minor polish

This commit is contained in:
isidor
2019-09-19 16:08:52 +02:00
parent c4a6fc1078
commit a9c67d8b82
3 changed files with 7 additions and 11 deletions

View File

@@ -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';
@@ -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'));