feat(nvim): setup jdtls
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
4f81012634
commit
39fb08bc48
2 changed files with 45 additions and 5 deletions
|
@ -18,6 +18,11 @@ in {
|
|||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
extraPackages = lib.mkIf neovimIde [
|
||||
pkgs.nodePackages.bash-language-server
|
||||
pkgs.shellcheck
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
lib.mkIf neovimIde
|
||||
/*
|
||||
|
@ -37,11 +42,6 @@ in {
|
|||
},
|
||||
}));
|
||||
'';
|
||||
|
||||
extraPackages = lib.mkIf neovimIde [
|
||||
pkgs.nodePackages.bash-language-server
|
||||
pkgs.shellcheck
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -38,6 +38,46 @@ in
|
|||
'';
|
||||
|
||||
plugins = [
|
||||
{
|
||||
# TOOD: setup debugger https://github.com/mfussenegger/nvim-jdtls#debugger-via-nvim-dap
|
||||
plugin = vimPlugins.nvim-jdtls;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
local startJdtls = function()
|
||||
local config = require('coq').lsp_ensure_capabilities({
|
||||
cmd = { '${pkgs.jdt-language-server}/bin/jdtls' },
|
||||
root_dir = vim.fs.dirname(vim.fs.find(
|
||||
{ 'gradlew', '.git', 'mvnw', 'pom.xml' },
|
||||
{ upward = true }
|
||||
)[1]),
|
||||
|
||||
settings = {
|
||||
java = {
|
||||
configuration = {
|
||||
runtimes = {
|
||||
{
|
||||
name = 'JavaSE-17',
|
||||
path = '${javaSdk}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
require('jdtls').start_or_attach(config);
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'java',
|
||||
callback = startJdtls,
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue