From 1fe6d3da4961e1ddba2c6fbeab9198398771bbb1 Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 19 Jun 2017 11:11:26 +0200 Subject: [PATCH] A hint on a Source is a pure presentation style fixes #28938 --- .../workbench/parts/debug/browser/debugContentProvider.ts | 2 +- src/vs/workbench/parts/debug/common/debug.ts | 4 ++-- src/vs/workbench/parts/debug/common/debugModel.ts | 4 ++-- src/vs/workbench/parts/debug/common/debugSource.ts | 6 ++---- .../workbench/parts/debug/electron-browser/debugService.ts | 4 ++-- src/vs/workbench/parts/debug/test/common/mockDebug.ts | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts b/src/vs/workbench/parts/debug/browser/debugContentProvider.ts index 7bb2d9ee15b..37ca325f419 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 310e20a0d22..141e4b3d0db 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 02fae2419dc..86aef921d66 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 18d8149f874..a1a7a1e0db7 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 610377f48fe..7b7dec560c6 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 55b41b025e6..ef3f4886a03 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 { -- GitLab