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?
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?
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.
Hi! I was able to solve this by adding a skip for jdtls language server when setting up the mason_lspconfig. When setting up default lsp configuration I added the following in my config.
– default handler for installed servers
function(server_name)
if server_name == “jdtls” then
return true
end
lspconfig[server_name].setup({
capabilities = capabilities,
})
end,