mfussenegger / nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
GNU General Public License v3.0
1.09k stars 62 forks source link

Not full list of the assert completions #467

Closed kenkoro closed 1 year ago

kenkoro commented 1 year ago

LSP client configuration

My config here. Before this issue, I just run :PackerSync and update some lsp in Mason. Is it some kind of new feature from update jdtls?

Eclipse.jdt.ls version

v1.22.0

Steps to Reproduce

Type some assert (JUnit Jupiter) keywords in Java.

Expected Result

Full list of completion (depends on build.gradle or pom.xml). And each line was like
<Name-of-class-or-snippet-or-somethinge-else> <Where-it-comes-from> <Sign-of-class-or-something-else>. For example, it was like LinkedList java.util LSP and so on.

Actual Result

Not full list of completions is showed at once (Unlike it did before). And also each line contains only a name of class or something else (e.g. assertTrue) and then what it is (LSP).

https://user-images.githubusercontent.com/85745790/232656831-c6c61590-3aa1-450e-9eca-c6f0cbcc37fe.mp4

mfussenegger commented 1 year ago

This is probably due to your completion plugin. nvim-jdtls has no custom completion logic.

eclipse.jdt.ls also recently added labelDetails support: https://github.com/eclipse/eclipse.jdt.ls/pull/2556, maybe that affects how your completion plugin works.

kenkoro commented 1 year ago

@mfussenegger and for anybody else if you want to get back to your previous style of labelDetails like I did, you can install the previous version of jdtls.

:MasonUninstall jdtls       --> delete your current version (my v1.22.0)
:MasonInstall jdtls@v1.21.0 --> install the previous version (v1.21.0)

Here's the result. Thank godness 🙏🏻 😄

Screenshot from 2023-04-18 14-06-35

mfussenegger commented 1 year ago

Instead of downgrading you could also disable the labelDetailsSupport.

local config = {

    ... - other options from the README

    capabilities = vim.tbl_deep_extend(
        "force",
        vim.lsp.protocol.make_client_capabilities(),
        {
            textDocument = {
                completion = {
                    completionItem = {
                        labelDetailsSupport = false,
                    }
                }
            }
        }
    )
}
kenkoro commented 1 year ago

Thanks a lot! I'll try it