File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -120,13 +120,15 @@ export class IdentifierCapability extends BaseCapability {
120120 nameContext : ParserRuleContext | TerminalNode ;
121121 range : Range ;
122122 name : string ;
123+ isDefaultMode : boolean ;
123124
124125 constructor ( args : IdentifierArgs ) {
125126 super ( args . element ) ;
126127
127128 this . nameContext = ( ( args . getNameContext ?? ( ( ) => args . element . context . rule ) ) ( ) ?? args . element . context . rule ) ;
129+ this . isDefaultMode = ! ( ! ! args . getNameContext && ! ! args . getNameContext ( ) ) ;
128130
129- if ( ! ! this . nameContext ) {
131+ if ( ! this . isDefaultMode ) {
130132 // Use the context to set the values.
131133 this . name = ( args . formatName ?? ( ( name : string ) => name ) ) ( this . nameContext . getText ( ) ) ;
132134 this . range = this . nameContext . toRange ( args . element . context . document ) ;
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ abstract class BaseModuleElement<T extends ParserRuleContext> extends BaseIdenti
4444
4545 // Helpers
4646 protected addMissingAttributesDiagnostics ( diagnostics : Diagnostic [ ] ) : void {
47- if ( ! ! this . identifierCapability . nameContext ) return ;
47+ if ( ! this . identifierCapability . isDefaultMode ) return ;
4848 diagnostics . push ( new MissingAttributeDiagnostic (
4949 Range . create ( this . context . range . start , this . context . range . start ) ,
5050 'VB_NAME'
You can’t perform that action at this time.
0 commit comments