提交 e1e3051d 编写于 作者: A Andre Weinand

add root folder to startDebugSession

上级 67222edf
......@@ -5469,12 +5469,14 @@ declare module 'vscode' {
/**
* Start a debug session based on the given configuration.
* The configuration's type is used to select the debug adapter and then is directly passed to the adapter without modification.
* The configuration's type is used to select the debug adapter and then the configuration is directly passed to this adapter.
* This function should only be called in the context of a 'startSession' command, e.g. after verifying or massaging the configuration.
* Folder specific variables used in the configuration (e.g. '${workspaceRoot}') are resolved against the given folder.
* @param folder The workspace folder for resolving variables used in the configuration or undefined.
* @param configuration The debug configuration that is directly passed to the debug adapter.
* @return A thenable that resolves when the debug session could be successfully started.
*/
export function startDebugSession(configuration: DebugConfiguration): Thenable<DebugSession>;
export function startDebugSession(folder: WorkspaceFolder | undefined, configuration: DebugConfiguration): Thenable<DebugSession>;
/**
* The currently active debug session or `undefined`. The active debug session is the one
......
......@@ -45,7 +45,7 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
this._toDispose = dispose(this._toDispose);
}
public $startDebugging(folder: URI | undefined, nameOrConfiguration: string | IConfig): TPromise<boolean> {
public $startDebugging(folderUri: URI | undefined, nameOrConfiguration: string | IConfig): TPromise<boolean> {
return this.debugService.startDebugging(nameOrConfiguration).then(x => {
return true;
}, err => {
......@@ -53,7 +53,7 @@ export class MainThreadDebugService extends MainThreadDebugServiceShape {
});
}
public $startDebugSession(configuration: IConfig): TPromise<DebugSessionUUID> {
public $startDebugSession(folderUri: URI | undefined, configuration: IConfig): TPromise<DebugSessionUUID> {
if (configuration.request !== 'launch' && configuration.request !== 'attach') {
return TPromise.wrapError(new Error(`only 'launch' or 'attach' allowed for 'request' attribute`));
}
......
......@@ -475,8 +475,8 @@ export function createApiFactory(
startDebugging: proposedApiFunction(extension, (folder: vscode.WorkspaceFolder | undefined, nameOrConfig: string | vscode.DebugConfiguration) => {
return extHostDebugService.startDebugging(folder, nameOrConfig);
}),
startDebugSession(config: vscode.DebugConfiguration) {
return extHostDebugService.startDebugSession(config);
startDebugSession(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration) {
return extHostDebugService.startDebugSession(folder, config);
},
onDidStartDebugSession(listener, thisArg?, disposables?) {
return extHostDebugService.onDidStartDebugSession(listener, thisArg, disposables);
......
......@@ -347,8 +347,8 @@ export abstract class MainThreadSCMShape {
export type DebugSessionUUID = string;
export abstract class MainThreadDebugServiceShape {
$startDebugging(folder: URI | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> { throw ni(); }
$startDebugSession(config: vscode.DebugConfiguration): TPromise<DebugSessionUUID> { throw ni(); }
$startDebugging(folderUri: URI | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise<boolean> { throw ni(); }
$startDebugSession(folderUri: URI | undefined, config: vscode.DebugConfiguration): TPromise<DebugSessionUUID> { throw ni(); }
$customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): TPromise<any> { throw ni(); }
}
......
......@@ -51,9 +51,9 @@ export class ExtHostDebugService extends ExtHostDebugServiceShape {
return this._debugServiceProxy.$startDebugging(folder ? <URI>folder.uri : undefined, nameOrConfig);
}
public startDebugSession(config: vscode.DebugConfiguration): TPromise<vscode.DebugSession> {
public startDebugSession(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration): TPromise<vscode.DebugSession> {
return this._debugServiceProxy.$startDebugSession(config).then((id: DebugSessionUUID) => {
return this._debugServiceProxy.$startDebugSession(folder ? <URI>folder.uri : undefined, config).then((id: DebugSessionUUID) => {
const debugSession = new ExtHostDebugSession(this._debugServiceProxy, id, config.type, config.name);
this._debugSessions.set(id, debugSession);
return debugSession;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册