Duplicate JDTLS attachement

Hi,
I have mfussenegger/nvim-jdtls setup as a ftplugin and I use lsp-config for all my other LSP.

I have used Mason to install the language server dependencies, but I get two LSPs attached to the buffer, one for the my ftplugin, the other from lsp-config, even though I don’t have jdtls included in my lsp-config setup.

Is there a way I can understand what might be triggering lsp-config to attach an additional LSP to the bufer?

:thinking: What makes you think lsp-config is responsible for the second instance? Have you tried disabling lsp-config entirely to see if the duplicate servers persists?

Well, I removed my entire lsp setup and just went with the filetype file to confirm, and yes, the second lsp stopped attaching.

I actually think it is mason-lspconfig performing automatic setup of handlers based on mason installed LSPs.

I need to see if there is a hook where I can allow it to be installed, but not configure it.

Hi! I’ve got the same problem. Have you found a solution?

Hello,
Me too, I’ve got the same problem. Have you found a solution?

It was exactly what I said above, mason-lspconfig sets up attachment by default based on filetypes. I needed to manually hook into the setup routines to skip jdtls so I could do it via a ftplugin

I ended up building code based on how LazyVim does it.