import { Range , SymbolInformation , TreeItem , TreeItemCollapsibleState } from "vscode" ; import { ITypeRootNodeData } from "../java/typeRootNodeData" ; import { BaseSymbolNode } from "./baseSymbolNode" ; import { ExplorerNode } from "./explorerNode" ; import { PrimaryTypeNode } from "./PrimaryTypeNode" ; export class SymbolNode extends BaseSymbolNode { private _children ? : SymbolInformation [ ] ; constructor ( symbolInfo , parent ) { super ( symbolInfo , parent ) ; } public getChildren ( ) { const res = [ ] ; if ( this . _children ?. length ) { this . _children . forEach ( ( child ) => { res . push ( new SymbolNode ( child , this . getParent ( ) as PrimaryTypeNode ) ) ; } ) ; } return res ; } public getTreeItem ( ) { const parentData = < ITypeRootNodeData > ( < PrimaryTypeNode > this . getParent ( ) ) . nodeData ; if ( parentData && parentData . symbolTree ) { this . _children = parentData . symbolTree . get ( this . symbolInfo . name ) ; } const item = new TreeItem ( this . symbolInfo . name , ( this . _children && this . _children . length ) ? TreeItemCollapsibleState . Collapsed : TreeItemCollapsibleState . None ) ; item . iconPath = this . iconPath ; item . command = this . command ; return item ; } protected get range ( ) : Range { return ( < SymbolInformation > this . symbolInfo ) . location . range ; } }