diff --git a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts index 090bc8b2401..3b2bb1f06c7 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts @@ -143,8 +143,9 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape { return TPromise.wrap(undefined); } - public $startDebugging(folderUri: uri | undefined, nameOrConfiguration: string | IConfig): TPromise { - const folder = folderUri ? this.contextService.getWorkspace().folders.filter(wf => wf.uri.toString() === folderUri.toString()).pop() : undefined; + public $startDebugging(_folderUri: uri | undefined, nameOrConfiguration: string | IConfig): TPromise { + const folderUriString = _folderUri ? uri.revive(_folderUri).toString() : undefined; + const folder = folderUriString ? this.contextService.getWorkspace().folders.filter(wf => wf.uri.toString() === folderUriString).pop() : undefined; return this.debugService.startDebugging(folder, nameOrConfiguration).then(x => { return true; }, err => { diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 4ef64fdb735..7ef268ba9ac 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -31,6 +31,7 @@ import * as modes from 'vs/editor/common/modes'; import { ITextSource } from 'vs/editor/common/model/textSource'; import { IConfigurationData, ConfigurationTarget, IConfigurationModel } from 'vs/platform/configuration/common/configuration'; +import { IConfig } from 'vs/workbench/parts/debug/common/debug'; import { IPickOpenEntry, IPickOptions } from 'vs/platform/quickOpen/common/quickOpen'; import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles'; @@ -446,7 +447,7 @@ export type DebugSessionUUID = string; export interface MainThreadDebugServiceShape extends IDisposable { $registerDebugConfigurationProvider(type: string, hasProvideMethod: boolean, hasResolveMethod: boolean, handle: number): TPromise; $unregisterDebugConfigurationProvider(handle: number): TPromise; - $startDebugging(folder: URI | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise; + $startDebugging(folder: UriComponents | undefined, nameOrConfig: string | vscode.DebugConfiguration): TPromise; $customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): TPromise; $appendDebugConsole(value: string): TPromise; $startBreakpointEvents(): TPromise; @@ -691,7 +692,7 @@ export interface IBreakpointData { export interface ISourceBreakpointData extends IBreakpointData { type: 'source'; - uri: URI; + uri: UriComponents; line: number; character: number; } @@ -708,8 +709,8 @@ export interface IBreakpointsDelta { } export interface ExtHostDebugServiceShape { - $resolveDebugConfiguration(handle: number, folder: URI | undefined, debugConfiguration: any): TPromise; - $provideDebugConfigurations(handle: number, folder: URI | undefined): TPromise; + $resolveDebugConfiguration(handle: number, folder: UriComponents | undefined, debugConfiguration: IConfig): TPromise; + $provideDebugConfigurations(handle: number, folder: UriComponents | undefined): TPromise; $acceptDebugSessionStarted(id: DebugSessionUUID, type: string, name: string): void; $acceptDebugSessionTerminated(id: DebugSessionUUID, type: string, name: string): void; $acceptDebugSessionActiveChanged(id: DebugSessionUUID | undefined, type?: string, name?: string): void; @@ -733,7 +734,7 @@ export interface ExtHostWindowShape { export const MainContext = { MainThreadCommands: >createMainId('MainThreadCommands'), MainThreadConfiguration: createMainId('MainThreadConfiguration', ProxyType.CustomMarshaller), - MainThreadDebugService: createMainId('MainThreadDebugService', ProxyType.CustomMarshaller), + MainThreadDebugService: createMainId('MainThreadDebugService'), MainThreadDecorations: createMainId('MainThreadDecorations'), MainThreadDiagnostics: createMainId('MainThreadDiagnostics'), MainThreadDialogs: createMainId('MainThreadDiaglogs'), @@ -764,7 +765,7 @@ export const ExtHostContext = { ExtHostCommands: createExtId('ExtHostCommands'), ExtHostConfiguration: createExtId('ExtHostConfiguration', ProxyType.CustomMarshaller), ExtHostDiagnostics: createExtId('ExtHostDiagnostics'), - ExtHostDebugService: createExtId('ExtHostDebugService', ProxyType.CustomMarshaller), + ExtHostDebugService: createExtId('ExtHostDebugService'), ExtHostDecorations: createExtId('ExtHostDecorations'), ExtHostDocumentsAndEditors: createExtId('ExtHostDocumentsAndEditors'), ExtHostDocuments: createExtId('ExtHostDocuments'), diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts index 075719057c8..3276d4348ea 100644 --- a/src/vs/workbench/api/node/extHostDebugService.ts +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -11,7 +11,7 @@ import { MainContext, MainThreadDebugServiceShape, ExtHostDebugServiceShape, Deb import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import * as vscode from 'vscode'; -import URI from 'vs/base/common/uri'; +import URI, { UriComponents } from 'vs/base/common/uri'; import { Disposable, Position, Location, SourceBreakpoint, FunctionBreakpoint } from 'vs/workbench/api/node/extHostTypes'; @@ -138,7 +138,8 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { if (bp.type === 'function') { return new FunctionBreakpoint(bp.enabled, bp.condition, bp.hitCondition, bp.functionName); } - return new SourceBreakpoint(bp.enabled, bp.condition, bp.hitCondition, new Location(bp.uri, new Position(bp.line, bp.character))); + const uri = URI.revive(bp.uri); + return new SourceBreakpoint(bp.enabled, bp.condition, bp.hitCondition, new Location(uri, new Position(bp.line, bp.character))); } public registerDebugConfigurationProvider(type: string, provider: vscode.DebugConfigurationProvider): vscode.Disposable { @@ -156,7 +157,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { }); } - public $provideDebugConfigurations(handle: number, folderUri: URI | undefined): TPromise { + public $provideDebugConfigurations(handle: number, folderUri: UriComponents | undefined): TPromise { let handler = this._handlers.get(handle); if (!handler) { return TPromise.wrapError(new Error('no handler found')); @@ -167,7 +168,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { return asWinJsPromise(token => handler.provideDebugConfigurations(this.getFolder(folderUri), token)); } - public $resolveDebugConfiguration(handle: number, folderUri: URI | undefined, debugConfiguration: vscode.DebugConfiguration): TPromise { + public $resolveDebugConfiguration(handle: number, folderUri: UriComponents | undefined, debugConfiguration: vscode.DebugConfiguration): TPromise { let handler = this._handlers.get(handle); if (!handler) { return TPromise.wrapError(new Error('no handler found')); @@ -232,10 +233,11 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { this._onDidReceiveDebugSessionCustomEvent.fire(ee); } - private getFolder(folderUri: URI | undefined) { - if (folderUri) { + private getFolder(_folderUri: UriComponents | undefined) { + if (_folderUri) { + const folderUriString = URI.revive(_folderUri).toString(); const folders = this._workspace.getWorkspaceFolders(); - const found = folders.filter(f => f.uri.toString() === folderUri.toString()); + const found = folders.filter(f => f.uri.toString() === folderUriString); if (found && found.length > 0) { return found[0]; }