From 1205fc42eadc9cfba4ab75ec9d81a9d55276aefd Mon Sep 17 00:00:00 2001 From: James Westman Date: Sat, 3 May 2025 14:25:34 -0500 Subject: [PATCH] completions: Fix completions in identifiers --- blueprintcompiler/completions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blueprintcompiler/completions.py b/blueprintcompiler/completions.py index 55d719b..73dc27f 100644 --- a/blueprintcompiler/completions.py +++ b/blueprintcompiler/completions.py @@ -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