cue
cue copied to clipboard
lsp: implement cueimports behaviour under config for Format
Go has goimports:
goimports updates your Go import lines, adding missing ones and removing unreferenced ones.
Indeed this behaviour is also available via gopls via a config option.
CUE should have something similar.
Prior art here is @asdine's https://github.com/asdine/cueimports.
We should provide a config option and mode for this in cue lsp.
Note: this will require that cache of parsed artefacts, because the local resolution must inspect files in the same package to verify that it is unresolved.
Worth noting that gopls does this as a separate "organize imports" code action; I'm not sure if there was a strong reason to separate that from the regular "format" operation.