@@ -2,24 +2,24 @@ import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
22import { GitUri } from '../../git/gitUri' ;
33import type { HierarchicalItem } from '../../system/array' ;
44import type { View } from '../viewBase' ;
5- import { BranchNode } from './branchNode' ;
5+ import type { BranchNode } from './branchNode' ;
66import type { TagNode } from './tagNode' ;
77import { ContextValues , getViewNodeId , ViewNode } from './viewNode' ;
88
9- export class BranchOrTagFolderNode extends ViewNode {
9+ export class BranchOrTagFolderNode extends ViewNode < 'branch-tag-folder' > {
1010 constructor (
1111 view : View ,
1212 protected override readonly parent : ViewNode ,
13- public readonly type : 'branch' | 'remote-branch' | 'tag' ,
13+ public readonly folderType : 'branch' | 'remote-branch' | 'tag' ,
1414 public readonly root : HierarchicalItem < BranchNode | TagNode > ,
1515 public readonly repoPath : string ,
1616 public readonly folderName : string ,
1717 public readonly relativePath : string | undefined ,
1818 private readonly _expanded : boolean = false ,
1919 ) {
20- super ( GitUri . fromRepoPath ( repoPath ) , view , parent ) ;
20+ super ( 'branch-tag-folder' , GitUri . fromRepoPath ( repoPath ) , view , parent ) ;
2121
22- this . _uniqueId = getViewNodeId ( `${ type } -folder +${ relativePath ?? folderName } ` , this . context ) ;
22+ this . _uniqueId = getViewNodeId ( `${ this . type } + ${ folderType } +${ relativePath ?? folderName } ` , this . context ) ;
2323 }
2424
2525 override get id ( ) : string {
@@ -38,12 +38,12 @@ export class BranchOrTagFolderNode extends ViewNode {
3838 for ( const folder of this . root . children . values ( ) ) {
3939 if ( folder . value === undefined ) {
4040 // If the folder contains the current branch, expand it by default
41- const expanded = folder . descendants ?. some ( n => n instanceof BranchNode && n . current ) ;
41+ const expanded = folder . descendants ?. some ( n => n . is ( 'branch' ) && n . current ) ;
4242 children . push (
4343 new BranchOrTagFolderNode (
4444 this . view ,
4545 this . folderName ? this : this . parent ,
46- this . type ,
46+ this . folderType ,
4747 folder ,
4848 this . repoPath ,
4949 folder . name ,
0 commit comments