fix(refactor): remove retired diagnostics API by khaneliman · Pull Request #506 · nvim-java/nvim-java · GitHub
Skip to content

fix(refactor): remove retired diagnostics API - #506

Open
khaneliman wants to merge 1 commit into
nvim-java:mainfrom
khaneliman:fix/refactor-diagnostics-api
Open

fix(refactor): remove retired diagnostics API#506
khaneliman wants to merge 1 commit into
nvim-java:mainfrom
khaneliman:fix/refactor-diagnostics-api

Conversation

@khaneliman

Copy link
Copy Markdown

Summary

Remove a refactor call to the retired vim.lsp.diagnostic API.

Why

nvim-java requires Neovim 0.11.5 or newer. That version no longer provides vim.lsp.diagnostic.get_line_diagnostics(), so refactor commands fail before sending a code-action request.

What changed

  • Let vim.lsp.buf.code_action() populate diagnostics through the current API.
  • Add a regression test for the requested action and omitted diagnostics.

Testing

  • nix run nixpkgs#stylua -- --check lua/java-refactor/api/refactor.lua tests/specs/refactor_spec.lua
  • nix run nixpkgs#lua51Packages.luacheck -- lua tests/specs
  • nix shell nixpkgs#gnumake -c make test FILE=tests/specs/refactor_spec.lua, 1 test passed

Related Issue(s)

None found.

Let vim.lsp.buf.code_action populate diagnostics.

The vim.lsp.diagnostic API no longer exists.
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.

1 participant