瀏覽代碼

Adds dbg info to view node tooltips when debugging

main
Eric Amodio 5 年之前
父節點
當前提交
38bf21ccb2
共有 1 個檔案被更改,包括 18 行新增0 行删除
  1. +18
    -0
      src/views/nodes/viewNode.ts

+ 18
- 0
src/views/nodes/viewNode.ts 查看文件

@ -69,6 +69,16 @@ export abstract class ViewNode {
constructor(uri: GitUri, public readonly view: TView, protected readonly parent?: ViewNode) {
this._instanceId = getViewNodeInstanceId();
this._uri = uri;
if (Logger.isDebugging) {
const fn = this.getTreeItem;
this.getTreeItem = async function(this: ViewNode<TView>) {
const item = await fn.apply(this);
item.tooltip = `${item.tooltip || item.label}\n\nDBG: ${this.toString()}`;
return item;
};
}
}
toString() {
@ -111,10 +121,18 @@ export abstract class ViewRefNode extends ViewNode
get repoPath(): string {
return this.uri.repoPath!;
}
toString() {
return `${super.toString()}: ${this.ref}`;
}
}
export abstract class ViewRefFileNode<TView extends View = View> extends ViewRefNode<TView> {
abstract get fileName(): string;
toString() {
return `${super.toString()}:${this.fileName}`;
}
}
export interface PageableViewNode {

Loading…
取消
儲存