mirror of
https://github.com/kossLAN/nvim-flake.git
synced 2025-11-04 17:59:50 -05:00
java-lsp: fix small bug
This commit is contained in:
parent
1f51668236
commit
e1061ee305
2 changed files with 18 additions and 1 deletions
|
|
@ -99,7 +99,7 @@ with final.pkgs.lib; let
|
|||
# language servers, etc.
|
||||
lua-language-server
|
||||
clang-tools # provides clangd which is a c/c++ lsp
|
||||
gcc
|
||||
java-language-server
|
||||
nil # nix LSP
|
||||
|
||||
# autoformatters
|
||||
|
|
@ -109,6 +109,7 @@ with final.pkgs.lib; let
|
|||
|
||||
# misc
|
||||
nodejs # eww
|
||||
gcc
|
||||
];
|
||||
in {
|
||||
# This is the neovim derivation
|
||||
|
|
|
|||
16
nvim/ftplugin/java.lua
Normal file
16
nvim/ftplugin/java.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- Exit if the language server isn't available
|
||||
if vim.fn.executable('java-language-server') ~= 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local root_files = {
|
||||
'.git',
|
||||
'Main.java',
|
||||
}
|
||||
|
||||
vim.lsp.start {
|
||||
name = 'java_language_server',
|
||||
cmd = { 'java-language-server' },
|
||||
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
|
||||
capabilities = require('user.lsp').make_client_capabilities(),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue