AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.04k stars 214 forks source link

fix(java): use builtin nvim 0.10 "go to definition/declaration" function #975

Closed Juniar-Rakhman closed 1 month ago

Juniar-Rakhman commented 1 month ago

📑 Description

Using Neovim 0.10 and java-pack, the default keybinding for go to definition "gd" and go to declaration "gD" is no longer working.

The following error message is shown:

[telescope.builtin.lsp_*]: server does not support definitionProvider

To fix this the default "gd" and "gD" need to be mapped to the following command:

vim.lsp.buf.definition()
vim.lsp.buf.declaration()

List of changes:

github-actions[bot] commented 1 month ago

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

Uzaaft commented 1 month ago

are these functions only available on neovim 0.10?

Juniar-Rakhman commented 1 month ago

@Uzaaft

I thought it was new to 0.10 but it was also available in 0.9.5. I never had to look for it in 0.9.5 as it was working just fine.

After some more googling, I think this is more of a Telescope issue: https://github.com/nvim-telescope/telescope.nvim/issues/2898#issuecomment-2117962082

I'm fine with this changes not included in the pack. I can modify my own keymaps until Telescope release a fix.

I'm not sure if this is affecting other LSP's though. If it is then maybe we should change default "gd" and "gD" behavior in the core?

mehalter commented 1 month ago

Telescope has released a new version with this fix

Juniar-Rakhman commented 1 month ago

@mehalter Sorry, but this issue is still happening in telescope v0.1.7. Tested on jdtls and gopls project, got the same error. Works fine with ts/js project though.

Edit: nvm it works after I did a clean reinstallation of astronvim :)