completions: Fix completions in identifiers

This commit is contained in:
James Westman 2025-05-03 14:25:34 -05:00
parent e9206809d6
commit 1205fc42ea
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6

View file

@ -81,10 +81,10 @@ def complete(
if tokens[token_idx].type == TokenType.IDENT:
idx = tokens[token_idx].start
token_idx -= 1
else:
while tokens[token_idx].type == TokenType.WHITESPACE:
idx = tokens[token_idx].start
token_idx -= 1
while tokens[token_idx].type == TokenType.WHITESPACE:
idx = tokens[token_idx].start
token_idx -= 1
child_node = ast_node.get_child_at(idx)
# If the cursor is at the end of a node, completions should be for the next child of the parent, unless the node