提交 1fe6d3da 编写于 作者: I isidor

A hint on a Source is a pure presentation style

fixes #28938
上级 240bf96f
...@@ -51,7 +51,7 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC ...@@ -51,7 +51,7 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC
return model; return model;
}, (err: DebugProtocol.ErrorResponse) => { }, (err: DebugProtocol.ErrorResponse) => {
this.debugService.deemphasizeSource(resource); this.debugService.sourceIsNotAvailable(resource);
const modePromise = this.modeService.getOrCreateMode(MIME_TEXT); const modePromise = this.modeService.getOrCreateMode(MIME_TEXT);
const model = this.modelService.createModel(err.message, modePromise, resource); const model = this.modelService.createModel(err.message, modePromise, resource);
......
...@@ -539,9 +539,9 @@ export interface IDebugService { ...@@ -539,9 +539,9 @@ export interface IDebugService {
stopProcess(process: IProcess): TPromise<any>; stopProcess(process: IProcess): TPromise<any>;
/** /**
* 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. * Gets the current debug model.
......
...@@ -1054,10 +1054,10 @@ export class Model implements IModel { ...@@ -1054,10 +1054,10 @@ export class Model implements IModel {
this._onDidChangeWatchExpressions.fire(); this._onDidChangeWatchExpressions.fire();
} }
public deemphasizeSource(uri: uri): void { public sourceIsNotAvailable(uri: uri): void {
this.processes.forEach(p => { this.processes.forEach(p => {
if (p.sources.has(uri.toString())) { if (p.sources.has(uri.toString())) {
p.sources.get(uri.toString()).presentationHint = 'deemphasize'; p.sources.get(uri.toString()).available = false;
} }
}); });
this._onDidChangeCallStack.fire(); this._onDidChangeCallStack.fire();
......
...@@ -12,12 +12,14 @@ const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source"); ...@@ -12,12 +12,14 @@ const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source");
export class Source { export class Source {
public uri: uri; public uri: uri;
public available: boolean;
constructor(public raw: DebugProtocol.Source, public presentationHint: string) { constructor(public raw: DebugProtocol.Source, public presentationHint: string) {
if (!raw) { if (!raw) {
this.raw = { name: UNKNOWN_SOURCE_LABEL }; this.raw = { name: UNKNOWN_SOURCE_LABEL };
} }
const path = this.raw.path || this.raw.name; 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); this.uri = this.raw.sourceReference > 0 ? uri.parse(`${DEBUG_SCHEME}:${path}`) : uri.file(path);
} }
...@@ -33,10 +35,6 @@ export class Source { ...@@ -33,10 +35,6 @@ export class Source {
return this.raw.sourceReference; return this.raw.sourceReference;
} }
public get available() {
return this.raw.name !== UNKNOWN_SOURCE_LABEL && this.presentationHint !== 'deemphasize';
}
public get inMemory() { public get inMemory() {
return this.uri.toString().indexOf(`${DEBUG_SCHEME}:`) === 0; return this.uri.toString().indexOf(`${DEBUG_SCHEME}:`) === 0;
} }
......
...@@ -894,8 +894,8 @@ export class DebugService implements debug.IDebugService { ...@@ -894,8 +894,8 @@ export class DebugService implements debug.IDebugService {
}); });
} }
public deemphasizeSource(uri: uri): void { public sourceIsNotAvailable(uri: uri): void {
this.model.deemphasizeSource(uri); this.model.sourceIsNotAvailable(uri);
} }
public restartProcess(process: debug.IProcess, restartData?: any): TPromise<any> { public restartProcess(process: debug.IProcess, restartData?: any): TPromise<any> {
......
...@@ -97,7 +97,7 @@ export class MockDebugService implements debug.IDebugService { ...@@ -97,7 +97,7 @@ export class MockDebugService implements debug.IDebugService {
public logToRepl(value: string): void { } public logToRepl(value: string): void { }
public deemphasizeSource(uri: uri): void { } public sourceIsNotAvailable(uri: uri): void { }
} }
export class MockSession implements debug.ISession { export class MockSession implements debug.ISession {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册