Nvim: add jdtls 🚀

This commit is contained in:
Marko Korhonen 2022-02-24 18:08:59 +02:00
parent d695658146
commit 9e0399fbed
4 changed files with 31 additions and 3 deletions

View file

@ -49,8 +49,10 @@ local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- Register a handler that will be called for all installed servers.
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
lsp_installer.on_server_ready(function(server)
-- Don't setup jdtls here since it is done by nvim-jdtls
if server.name == "jdtls" then return end
local opts = {}
-- Lua specific settings
@ -79,6 +81,6 @@ lsp_installer.on_server_ready(function(server)
end
opts.on_attach = buf_map_keys
opts.capabilities = capabilities
opts.capabilities = capabilities
server:setup(opts)
end)

View file

@ -64,6 +64,9 @@ require('packer').startup(function()
-- Install LSP server executables
use 'williamboman/nvim-lsp-installer'
-- Additional LSP features for Java
use 'mfussenegger/nvim-jdtls'
-- Completion
use 'hrsh7th/nvim-cmp' -- Autocompletion plugin
use 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp