Skip to content

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

Merged
s1n7ax merged 2 commits into
nvim-java:mainfrom
khaneliman:fix/refactor-diagnostics-api
Sep 12, 2026
Merged

s1n7ax merged 2 commits into
nvim-java:mainfrom
khaneliman:fix/refactor-diagnostics-api

Conversation

@khaneliman

Copy link
Copy Markdown
Contributor

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.

khaneliman and others added 2 commits September 1, 2026 08:55
Let vim.lsp.buf.code_action populate diagnostics.

The vim.lsp.diagnostic API no longer exists.
@s1n7ax
s1n7ax merged commit db5536b into nvim-java:main Sep 12, 2026
8 checks passed
@khaneliman
khaneliman deleted the fix/refactor-diagnostics-api branch September 12, 2026 05:36
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.

2 participants