add WorkspaceFolder to proposed debug API

This commit is contained in:
Andre Weinand
2017-07-22 23:55:06 +02:00
parent 9da0fa19e8
commit a9d463248a
5 changed files with 13 additions and 8 deletions

View File

@@ -472,8 +472,8 @@ export function createApiFactory(
get activeDebugSession() {
return extHostDebugService.activeDebugSession;
},
startDebugging: proposedApiFunction(extension, (nameOrConfig: string | vscode.DebugConfiguration) => {
return extHostDebugService.startDebugging(nameOrConfig);
startDebugging: proposedApiFunction(extension, (folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration) => {
return extHostDebugService.startDebugging(folder, nameOrConfig);
}),
startDebugSession(config: vscode.DebugConfiguration) {
return extHostDebugService.startDebugSession(config);

View File

@@ -347,7 +347,7 @@ export abstract class MainThreadSCMShape {
export type DebugSessionUUID = string;
export abstract class MainThreadDebugServiceShape {
$startDebugging(nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> { throw ni(); }
$startDebugging(folder: URI | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> { throw ni(); }
$startDebugSession(config: vscode.DebugConfiguration): TPromise<DebugSessionUUID> { throw ni(); }
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): TPromise<any> { throw ni(); }
}

View File

@@ -11,6 +11,7 @@ import { IThreadService } from 'vs/workbench/services/thread/common/threadServic
import { MainContext, MainThreadDebugServiceShape, ExtHostDebugServiceShape, DebugSessionUUID } from 'vs/workbench/api/node/extHost.protocol';
import * as vscode from 'vscode';
import URI from 'vs/base/common/uri';
export class ExtHostDebugService extends ExtHostDebugServiceShape {
@@ -45,9 +46,9 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
this._debugServiceProxy = threadService.get(MainContext.MainThreadDebugService);
}
public startDebugging(nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> {
public startDebugging(folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> {
return this._debugServiceProxy.$startDebugging(nameOrConfig);
return this._debugServiceProxy.$startDebugging(folder ? <URI>folder.uri : undefined, nameOrConfig);
}
public startDebugSession(config: vscode.DebugConfiguration): TPromise<vscode.DebugSession> {