mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-28 09:35:41 -05:00
Reworks ExplorerNode base class
Adds TextExplorerNode for messages
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { Iterables } from '../system';
|
||||
import { ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'vscode';
|
||||
import { CommitNode } from './commitNode';
|
||||
import { ExplorerNode, ResourceType } from './explorerNode';
|
||||
import { ExplorerNode, ResourceType, TextExplorerNode } from './explorerNode';
|
||||
import { GitService, GitUri } from '../gitService';
|
||||
|
||||
export class FileHistoryNode extends ExplorerNode {
|
||||
@@ -10,15 +10,15 @@ export class FileHistoryNode extends ExplorerNode {
|
||||
static readonly rootType: ResourceType = 'file-history';
|
||||
readonly resourceType: ResourceType = 'file-history';
|
||||
|
||||
constructor(uri: GitUri, context: ExtensionContext, git: GitService) {
|
||||
super(uri, context, git);
|
||||
constructor(uri: GitUri, protected readonly context: ExtensionContext, protected readonly git: GitService) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
async getChildren(): Promise<CommitNode[]> {
|
||||
const log = await this.git.getLogForFile(this.uri.repoPath, this.uri.fsPath, this.uri.sha);
|
||||
if (log === undefined) return [];
|
||||
|
||||
return [...Iterables.map(log.commits.values(), c => new CommitNode(c, this.context, this.git))];
|
||||
return [...Iterables.map(log.commits.values(), c => new CommitNode(c, this.git.config.gitExplorer.commitFormat, this.context, this.git))];
|
||||
}
|
||||
|
||||
getTreeItem(): TreeItem {
|
||||
|
||||
Reference in New Issue
Block a user