import { DocumentSymbolProvider , SymbolInformation , CancellationToken , TextDocument , Uri , SymbolKind , Location , Position , workspace } from 'vscode' ; import { SystemVerilogParser } from '../parser' ; import { SystemVerilogSymbol } from '../symbol' ; export class SystemVerilogDocumentSymbolProvider implements DocumentSymbolProvider { private parser : SystemVerilogParser ; private precision : string ; private depth : number = - 1 ; constructor ( parser ) { this . parser = parser ; const settings = workspace . getConfiguration ( ) ; this . precision = settings . get ( 'systemverilog.documentSymbolsPrecision' ) ; if ( this . precision !== 'full' ) { this . depth = 1 ; } } param document param _token return public provideDocumentSymbols ( document , _token ? ) { return new Promise ( ( resolve ) => { resolve ( this . parser . get_all_recursive ( document , this . precision , this . depth ) ) ; } ) ; } } function show_SymbolKinds ( uri ) { return new Array < SymbolInformation > ( new SymbolInformation ( "File" , SymbolKind . File , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Module" , SymbolKind . Module , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Namespace" , SymbolKind . Namespace , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Package" , SymbolKind . Package , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Class" , SymbolKind . Class , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Method" , SymbolKind . Method , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Property" , SymbolKind . Property , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Field" , SymbolKind . Field , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Constructor" , SymbolKind . Constructor , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Enum" , SymbolKind . Enum , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Interface" , SymbolKind . Interface , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Function" , SymbolKind . Function , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Variable" , SymbolKind . Variable , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Constant" , SymbolKind . Constant , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "String" , SymbolKind . String , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Number" , SymbolKind . Number , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Boolean" , SymbolKind . Boolean , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Array" , SymbolKind . Array , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Object" , SymbolKind . Object , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Key" , SymbolKind . Key , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Null" , SymbolKind . Null , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "EnumMember" , SymbolKind . EnumMember , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Struct" , SymbolKind . Struct , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Event" , SymbolKind . Event , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "Operator" , SymbolKind . Operator , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) , new SymbolInformation ( "TypeParameter" , SymbolKind . TypeParameter , "" , new Location ( uri , new Position ( 0 , 0 ) ) ) ) ; }