Skip to content

Commit 25aa7e0

Browse files
committed
Add check to ensure current token is valid
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 0302124 commit 25aa7e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extension/server/src/providers/completionItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default async function completionItemProvider(handler: CompletionParams):
6161
let currentDef: Declaration | undefined;
6262

6363
for (tokenIndex; tokenIndex < tokens.length; tokenIndex++) {
64-
if ([`block`, `dot`, `newline`].includes(tokens[tokenIndex].type)) {
64+
if (tokens[tokenIndex] === undefined || [`block`, `dot`, `newline`].includes(tokens[tokenIndex].type)) {
6565
continue;
6666
}
6767

0 commit comments

Comments
 (0)