internal/lsp: add toggle surrounding struct braces code action
Add a third brace-manipulation code action, "Toggle surrounding struct
braces", alongside the existing "Add..." and "Remove..." primitives.
The toggle commits to the 0 <-> 1 brace cycle so it can be bound to a
single keystroke: if the cursor is inside removable braces it applies
the remove edit; otherwise it applies the add edit. The two primitives
remain available for users who want to deepen nesting explicitly.
Fixes #4333.
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I8f616c2a08505caa3e59503e971b4609523266bb
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1236070
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
authored by