Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings
nvim-java

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Hover action inconsistency#421

Answeredbylogrusx
goldeneas asked this question inQ&A
Discussion options

Hello.
I have just installed nvim-java. This is my current configuration:

return {    "nvim-java/nvim-java",    dependencies = { "neovim/nvim-lspconfig" },    config = function()        local java = require("java")        local lspconfig = require("lspconfig")        java.setup()        lspconfig.jdtls.setup({})    end,}

Whenever I open a java file sometimes the hover action shows two different entries for the jdtls server. I have attached a screenshot demonstrating this behaviour.
Screenshot from 2025-08-31 16-59-47

I have also noticed that sometimes only either of those is actually shown. I am running Ubuntu 24.04 LTS with nvim v0.11.3.

You must be logged in to vote

Remove the opts from mason-lspconfig.

Replies: 2 comments 4 replies

Comment options

Most likely misconfiguration.

What does :LspInfo say?

You must be logged in to vote
0 replies
Comment options

Here it is:

Screenshot from 2025-08-31 22-14-56
You must be logged in to vote
4 replies
@logrusx
Comment options

Yes, this is misconfiguration. Make sure mason-lspconfig is not setup before nvim-java. Use starter-kickstart project as a reference. If you can't figure it out, share your complete configuration.

@goldeneas
Comment options

I ended up doing this:

return {    "mason-org/mason-lspconfig.nvim",    opts = {        ensure_installed = {            "clangd",            "lua_ls",        },    },    dependencies = {        "nvim-java/nvim-java" // Added this to make nvim-java load before mason-lspconfig.nvim    }}

Althought I don't know if this is the correct choice. This does seem to fix the error, but if there's a 'better' solution then I'd like to hear it.
My other plugins' config files are made of just the installation part. For example:

return {    "williamboman/mason.nvim",    opts = {},}
@logrusx
Comment options

Remove the opts from mason-lspconfig.

Answer selected bygoldeneas
@goldeneas
Comment options

That seems to have fixed the two signatures showing up.
However I'd like to remove the URIs shown in this screenshot (starting with "jdt://...").
I believe this is possible as the first signature in my previous screenshot did not show these, and they take up lots of space making the docs harder to read.
Screenshot from 2025-09-01 11-08-57

I'll start another discussion and mark this as solved in the meantime. Thank you for your help.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@goldeneas@logrusx

[8]ページ先頭

©2009-2025 Movatter.jp