Skip to content

Commit

Permalink
fix: only show code action when there's no sum
Browse files Browse the repository at this point in the history
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!`
  • Loading branch information
Ellen Potter authored and alcarney committed Sep 29, 2023
1 parent ec342a3 commit f18c51a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/servers/code_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down

0 comments on commit f18c51a

Please sign in to comment.