Skip to content

Commit 10b39bc

Browse files
committed
Adds type-safety
1 parent 4edd753 commit 10b39bc

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/views/nodes/common.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class MessageNode extends ViewNode<'message'> {
1717
protected description?: string,
1818
protected tooltip?: string,
1919
protected iconPath?: TreeItem['iconPath'],
20-
protected contextValue?: string,
20+
protected contextValue?: ContextValues,
2121
protected resourceUri?: Uri,
2222
) {
2323
super('message', unknownGitUri, view, parent);
@@ -38,12 +38,6 @@ export class MessageNode extends ViewNode<'message'> {
3838
}
3939
}
4040

41-
export class GroupedHeaderNode extends MessageNode {
42-
constructor(view: View, parent: ViewNode, description?: string, label?: string) {
43-
super(view, parent, label ?? view.name, description, view.name, undefined, `gitlens:views:${view.type}`);
44-
}
45-
}
46-
4741
export class CommandMessageNode extends MessageNode {
4842
constructor(
4943
view: View,
@@ -53,7 +47,7 @@ export class CommandMessageNode extends MessageNode {
5347
description?: string,
5448
tooltip?: string,
5549
iconPath?: TreeItem['iconPath'],
56-
contextValue?: string,
50+
contextValue?: ContextValues,
5751
resourceUri?: Uri,
5852
) {
5953
super(view, parent, message, description, tooltip, iconPath, contextValue, resourceUri);
@@ -90,7 +84,7 @@ export class ActionMessageNode extends CommandMessageNode {
9084
description?: string,
9185
tooltip?: string,
9286
iconPath?: TreeItem['iconPath'],
93-
contextValue?: string,
87+
contextValue?: ContextValues,
9488
resourceUri?: Uri,
9589
) {
9690
const command = { command: `gitlens.node.action:${actionCommandCounter.next()}`, title: 'Execute action' };
@@ -108,7 +102,7 @@ export class ActionMessageNode extends CommandMessageNode {
108102
description?: string | null;
109103
tooltip?: string | null;
110104
iconPath?: TreeItem['iconPath'] | null;
111-
contextValue?: string | null;
105+
contextValue?: ContextValues | null;
112106
resourceUri?: Uri | null;
113107
}): void {
114108
this.message = options.message ?? this.message;

0 commit comments

Comments
 (0)