Reworks ExplorerNode base class

Adds TextExplorerNode for messages
This commit is contained in:
Eric Amodio
2017-08-27 04:10:02 -04:00
parent ca089777db
commit bcd83566a1
10 changed files with 49 additions and 31 deletions

View File

@@ -9,9 +9,8 @@ export class CommitNode extends ExplorerNode {
readonly resourceType: ResourceType = 'commit';
constructor(public readonly commit: GitCommit, context: ExtensionContext, git: GitService) {
super(new GitUri(commit.uri, commit), context, git);
this.commit = commit;
constructor(public readonly commit: GitCommit, private template: string, protected readonly context: ExtensionContext, protected readonly git: GitService) {
super(new GitUri(commit.uri, commit));
}
async getChildren(): Promise<ExplorerNode[]> {
@@ -25,7 +24,7 @@ export class CommitNode extends ExplorerNode {
}
getTreeItem(): TreeItem {
const label = CommitFormatter.fromTemplate(this.git.config.gitExplorer.commitFormat, this.commit, this.git.config.defaultDateFormat);
const label = CommitFormatter.fromTemplate(this.template, this.commit, this.git.config.defaultDateFormat);
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed);
item.contextValue = this.resourceType;