diff --git a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts b/src/vs/workbench/parts/debug/browser/debugContentProvider.ts index 7bb2d9ee15b046f6b27e9f39dedd587a9cc8f34a..37ca325f419886bf47c23d56bb13ce08e83d6318 100644 --- a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts +++ b/src/vs/workbench/parts/debug/browser/debugContentProvider.ts @@ -51,7 +51,7 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC return model; }, (err: DebugProtocol.ErrorResponse) => { - this.debugService.deemphasizeSource(resource); + this.debugService.sourceIsNotAvailable(resource); const modePromise = this.modeService.getOrCreateMode(MIME_TEXT); const model = this.modelService.createModel(err.message, modePromise, resource); diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 310e20a0d22e381d5256e5b98cbc659de5b2951a..141e4b3d0db27795032d162f01e7f88173368536 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -539,9 +539,9 @@ export interface IDebugService { stopProcess(process: IProcess): TPromise; /** - * Deemphasizes all sources with the passed uri. Source will appear as grayed out in callstack view. + * Makes unavailable all sources with the passed uri. Source will appear as grayed out in callstack view. */ - deemphasizeSource(uri: uri): void; + sourceIsNotAvailable(uri: uri): void; /** * Gets the current debug model. diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 02fae2419dcdc3ccf7b7d93f52456fbffe4888e7..86aef921d6620c7fcef0e27c71a41b6e198f9134 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -1054,10 +1054,10 @@ export class Model implements IModel { this._onDidChangeWatchExpressions.fire(); } - public deemphasizeSource(uri: uri): void { + public sourceIsNotAvailable(uri: uri): void { this.processes.forEach(p => { if (p.sources.has(uri.toString())) { - p.sources.get(uri.toString()).presentationHint = 'deemphasize'; + p.sources.get(uri.toString()).available = false; } }); this._onDidChangeCallStack.fire(); diff --git a/src/vs/workbench/parts/debug/common/debugSource.ts b/src/vs/workbench/parts/debug/common/debugSource.ts index 18d8149f874bdde4e2c68e957ab80a0e549af8eb..a1a7a1e0db7865162e726f5771a8f32f841f26ad 100644 --- a/src/vs/workbench/parts/debug/common/debugSource.ts +++ b/src/vs/workbench/parts/debug/common/debugSource.ts @@ -12,12 +12,14 @@ const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source"); export class Source { public uri: uri; + public available: boolean; constructor(public raw: DebugProtocol.Source, public presentationHint: string) { if (!raw) { this.raw = { name: UNKNOWN_SOURCE_LABEL }; } const path = this.raw.path || this.raw.name; + this.available = this.raw.name !== UNKNOWN_SOURCE_LABEL; this.uri = this.raw.sourceReference > 0 ? uri.parse(`${DEBUG_SCHEME}:${path}`) : uri.file(path); } @@ -33,10 +35,6 @@ export class Source { return this.raw.sourceReference; } - public get available() { - return this.raw.name !== UNKNOWN_SOURCE_LABEL && this.presentationHint !== 'deemphasize'; - } - public get inMemory() { return this.uri.toString().indexOf(`${DEBUG_SCHEME}:`) === 0; } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 610377f48fec3ad2d757f0513b5eb44567ae0a35..7b7dec560c61e7f8bcd2ba9004f5e8309551b879 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -894,8 +894,8 @@ export class DebugService implements debug.IDebugService { }); } - public deemphasizeSource(uri: uri): void { - this.model.deemphasizeSource(uri); + public sourceIsNotAvailable(uri: uri): void { + this.model.sourceIsNotAvailable(uri); } public restartProcess(process: debug.IProcess, restartData?: any): TPromise { diff --git a/src/vs/workbench/parts/debug/test/common/mockDebug.ts b/src/vs/workbench/parts/debug/test/common/mockDebug.ts index 55b41b025e644900747ca9a47ac6ff33ee71e98e..ef3f4886a03fd189038e173483d31c5c60e6cd2d 100644 --- a/src/vs/workbench/parts/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/parts/debug/test/common/mockDebug.ts @@ -97,7 +97,7 @@ export class MockDebugService implements debug.IDebugService { public logToRepl(value: string): void { } - public deemphasizeSource(uri: uri): void { } + public sourceIsNotAvailable(uri: uri): void { } } export class MockSession implements debug.ISession {