Skip to content

Fix command-only code action serialization#220

Open
Arunsiva003 wants to merge 1 commit into
nwolverson:mainfrom
Arunsiva003:fix-codeaction-optional-fields
Open

Fix command-only code action serialization#220
Arunsiva003 wants to merge 1 commit into
nwolverson:mainfrom
Arunsiva003:fix-codeaction-optional-fields

Conversation

@Arunsiva003
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Neovim "Sort/reformat imports" code action returns WorkspaceEdit with null/empty edit field

2 participants