From a33a2ae8d8d9151422fc07f99ef26a05bf2dd41c Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 28 Jul 2024 22:06:51 +0200 Subject: [PATCH] copy from basic setup with mason install path --- lua/kickstart/plugins/lspconfig.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 10470b1..b58e7b9 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -199,6 +199,14 @@ return { }, } + local function jdtls_setup() + local config = { + cmd = { require('mason-registry').get_package('jdtls'):get_install_path() .. '/bin/jdtls' }, + root_dir = vim.fs.dirname(vim.fs.find({ 'gradlew', '.git', 'mvnw' }, { upward = true })[1]), + } + require('jdtls').start_or_attach(config) + end + -- Ensure the servers and tools above are installed -- To check the current status of installed tools and/or manually install -- other tools, you can run @@ -226,6 +234,7 @@ return { handlers = { function(server_name) if server_name == 'jdtls' then + jdtls_setup() return end