@@ -19,42 +19,39 @@ import { DiagnosticCapability, IdentifierCapability, SymbolInformationCapability
1919
2020abstract class BaseProcedureElement < T extends ParserRuleContext > extends BaseContextSyntaxElement < T > implements HasDiagnosticCapability , HasSymbolInformationCapability {
2121 diagnosticCapability : DiagnosticCapability ;
22+ symbolInformationCapability : SymbolInformationCapability ;
2223 abstract identifierCapability : IdentifierCapability ;
23- abstract symbolInformationCapability : SymbolInformationCapability ;
2424
25- constructor ( ctx : T , doc : TextDocument ) {
25+ constructor ( ctx : T , doc : TextDocument , symbolKind : SymbolKind ) {
2626 super ( ctx , doc ) ;
2727 this . diagnosticCapability = new DiagnosticCapability ( this ) ;
28+ this . symbolInformationCapability = new SymbolInformationCapability ( this , symbolKind ) ;
2829 }
2930}
3031
3132
3233export class SubDeclarationElement extends BaseProcedureElement < SubroutineDeclarationContext > {
3334 identifierCapability : IdentifierCapability ;
34- symbolInformationCapability : SymbolInformationCapability ;
3535
3636 constructor ( ctx : SubroutineDeclarationContext , doc : TextDocument ) {
37- super ( ctx , doc ) ;
37+ super ( ctx , doc , SymbolKind . Method ) ;
3838 this . identifierCapability = new IdentifierCapability ( {
3939 element : this ,
4040 getNameContext : ( ) => ctx . subroutineName ( ) ?. ambiguousIdentifier ( ) ,
4141 } ) ;
42- this . symbolInformationCapability = new SymbolInformationCapability ( this , SymbolKind . Method ) ;
4342 }
4443}
4544
4645
4746export class FunctionDeclarationElement extends BaseProcedureElement < FunctionDeclarationContext > {
4847 identifierCapability : IdentifierCapability ;
49- symbolInformationCapability : SymbolInformationCapability ;
5048
5149 constructor ( ctx : FunctionDeclarationContext , doc : TextDocument ) {
52- super ( ctx , doc ) ;
50+ super ( ctx , doc , SymbolKind . Method ) ;
5351 this . identifierCapability = new IdentifierCapability ( {
5452 element : this ,
5553 getNameContext : ( ) => ctx . functionName ( ) ?. ambiguousIdentifier ( ) ,
5654 } ) ;
57- this . symbolInformationCapability = new SymbolInformationCapability ( this , SymbolKind . Method ) ;
5855 }
5956}
6057
@@ -81,18 +78,16 @@ export class PropertyDeclarationElement {
8178 */
8279abstract class BasePropertyDeclarationElement < T extends ParserRuleContext > extends BaseProcedureElement < T > {
8380 identifierCapability : IdentifierCapability ;
84- symbolInformationCapability : SymbolInformationCapability ;
8581
8682 private propertyType : string ;
8783 private nameContext ?: AmbiguousIdentifierContext ;
8884
8985 get propertyName ( ) : string { return `${ this . identifierCapability . name . split ( ' ' ) [ 1 ] } ` ; }
9086
9187 constructor ( ctx : T , doc : TextDocument , propertyType : string , nameCtx ?: AmbiguousIdentifierContext ) {
92- super ( ctx , doc ) ;
88+ super ( ctx , doc , SymbolKind . Property ) ;
9389 this . nameContext = nameCtx ;
9490 this . propertyType = propertyType ;
95- this . symbolInformationCapability = new SymbolInformationCapability ( this , SymbolKind . Property ) ;
9691 this . identifierCapability = new IdentifierCapability ( {
9792 element : this ,
9893 getNameContext : ( ) => this . nameContext ,
0 commit comments