From f18c51ad157630491e9d411a6fa02ad9f1a60eb6 Mon Sep 17 00:00:00 2001 From: Ellen Potter Date: Mon, 25 Sep 2023 13:46:05 +0100 Subject: [PATCH] fix: only show code action when there's no sum Tighten the ADDITION regex so that the 'Evaluate' code action only appears if there's no sum. Previously, after using the action, the lightbulb remained visible in VSCode and would keep appending the sum to the line, resulting in things like `1 + 1 = 2! 2! 2!` --- examples/servers/code_actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/servers/code_actions.py b/examples/servers/code_actions.py index 0613ce13..9784dcfa 100644 --- a/examples/servers/code_actions.py +++ b/examples/servers/code_actions.py @@ -29,7 +29,7 @@ ) -ADDITION = re.compile(r"^\s*(\d+)\s*\+\s*(\d+)\s*=") +ADDITION = re.compile(r"^\s*(\d+)\s*\+\s*(\d+)\s*=\s*$") server = LanguageServer("code-action-server", "v0.1")