purescript-language-server
purescript-language-server copied to clipboard
Fix command-only code action serialization
What changed
- Represent CodeAction edit and command as undefined-or-present fields instead of nullable fields.
- Keep command-only code actions serializing without an edit property.
- Add a regression test for the sort imports code action wire shape.
Why it changed
Neovim treats edit: null as an invalid LSP code action response because edit is optional, not nullable. Omitting the field keeps the response aligned with the LSP shape while preserving the command.
Fixes #219
Tests run
- XDG_CACHE_HOME=/tmp /Users/arunkumar.a/.nvm/versions/node/v16.20.2/bin/spago test
- XDG_CACHE_HOME=/tmp npm run build