fix: better root finding for jdtls

This commit is contained in:
əlemi 2023-12-13 13:00:15 +01:00
parent 5ffa0d858c
commit ff4ddfda48
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -1,11 +1,12 @@
local nvim_jdtls = require("jdtls") local nvim_jdtls = require("jdtls")
nvim_jdtls.start_or_attach({ nvim_jdtls.start_or_attach({
cmd = { 'jdtls' }, cmd = { 'jdtls' },
root_dir = vim.fs.dirname(vim.fs.find({'.gradlew', '.git', 'mvnw'}, {upward = true})[1]), root_dir = require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}),
}) })
require('keybinds'):set_lsp_keys({buffer = 0}) require('keybinds'):set_lsp_keys({buffer = 0})
-- Allow decompiling classes coming from the language server too -- Allow decompiling classes coming from the language server too
-- TODO should probably move elsewhere
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
'Javap', 'Javap',
function(args) function(args)