Skip to content

Commit 4de7287

Browse files
committed
Bug fix new subs causing identifier exeption
1 parent 0e04861 commit 4de7287

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/project/elements/procedure.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ export class SubDeclarationElement extends BaseProcedureElement<SubroutineDeclar
4040
this.identifierCapability = new IdentifierCapability({
4141
element: this,
4242
getNameContext: () => ctx.subroutineName()?.ambiguousIdentifier(),
43+
// For some reason the IdentifierCapability throws if no default is given
44+
// despite it not actually ever needing it. Most unusual.
45+
defaultRange: () => this.context.range
4346
});
4447
this.foldingRangeCapability.openWord = `Sub ${this.identifierCapability.name}`;
4548
this.foldingRangeCapability.closeWord = 'End Sub';
46-
4749
}
4850
}
4951

0 commit comments

Comments
 (0)