neovim: add spring-boot ls

This commit is contained in:
Dmitriy Pleshevskiy 2024-08-14 01:20:44 +03:00
parent b3554bdb76
commit d915336df4
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
3 changed files with 45 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
let inherit (lib.nix2lua) call; in
{
@ -48,7 +48,9 @@ let inherit (lib.nix2lua) call; in
root_dir = call "${config.plugin.nvim-lspconfig.varName}.util.root_pattern" [ "deno.json" "deno.jsonc" ];
};
# java
jdtls = { cmd = [ "jdtls" ]; };
jdtls = {
cmd = [ "${pkgs.jdt-language-server}/bin/jdtls" ];
};
# json
jsonls = { };
# css, scss, less

View file

@ -1,5 +1,6 @@
{
imports = [
./ollama.nix
./spring-boot.nix
];
}

View file

@ -0,0 +1,40 @@
{ config, pkgs, lib, ... }:
let
inherit (lib.nix2lua) pipe1 call0 call1;
inherit (pkgs) vimUtils fetchFromGitHub;
spring-boot-nvim = vimUtils.buildVimPlugin {
pname = "spring-boot";
version = "2024-08-10";
src = fetchFromGitHub {
owner = "JavaHello";
repo = "spring-boot.nvim";
rev = "995a705becbc711b703f9ab344745ececf6471a3";
hash = "sha256-Hri6WQnWTmFwlOUCVG8O1eELn9FhlvVpUC9lt+uIGkc=";
};
};
in
{
plugin.spring-boot-nvim = {
enable = true;
package = spring-boot-nvim;
name = "spring_boot";
};
plugin.nvim-lspconfig.beforeSetup = [
(pipe1 config.plugin.spring-boot-nvim.var (call1 "setup" {
java_cmd = "${pkgs.jdk22}/bin/java";
log_file = "/tmp/spring-boot.log";
}))
(pipe1 config.plugin.spring-boot-nvim.var (call0 "init_lsp_commands"))
];
plugins.language-server.lspconfig.serverSettings.jdtls = {
init_options = {
bundles = (pipe1 config.plugin.spring-boot-nvim.var (call0 "java_extensions"));
};
};
}