Skip to content

Commit

Permalink
fix: completion of properties in calcs (#396)
Browse files Browse the repository at this point in the history
Fix completion of properties in calcs
  • Loading branch information
vetlek authored Nov 22, 2023
1 parent 19ee438 commit a40877c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions server/src/septic/algParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,19 @@ export class AlgParser extends Parser<AlgTokenType, AlgExpr> {
this.advance();
end = this.previous().end;
content += ".";
this.advance();
let nextToken = this.variable();
if (nextToken.start === end) {
content += nextToken.content;
end = nextToken.end;
let nextToken = this.peek();
if (nextToken?.start === end) {
if (
nextToken?.type === AlgTokenType.identifier ||
nextToken?.type === AlgTokenType.jinja
) {
this.advance();
let nextVariable = this.variable();
content += nextVariable.content;
end = nextVariable.end;
}
}
}

return {
start: token.start,
end: end,
Expand Down

0 comments on commit a40877c

Please sign in to comment.