internal/lsp: implement ConvertFromStruct code action
This is the opposite of https://cue.gerrithub.io/c/cue-lang/cue/+/1230699
Rather than converting
a: b: whatever
to
a: {
b: whatever
}
we now support the opposite: for a structlit with exactly 1 field where
the struct has braces, the new code action removes the braces, and
shuffles the field up so it starts at the location of the original {
Fixes #4073
Signed-off-by: Matthew Sackman <matthew@cue.works>
Change-Id: Ieda3aade7df48bef4dcde5763e60e856a60530bb
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1230710
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>