add groovylsp

This commit is contained in:
2023-06-06 19:08:05 +03:00
parent 3dddf844ce
commit 4a47852f53
5 changed files with 70 additions and 21 deletions

1
.gitingore Normal file
View File

@@ -0,0 +1 @@
result

75
flake.lock generated
View File

@@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
@@ -36,10 +36,30 @@
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"groovyls": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1686055585,
@@ -57,11 +77,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1686043861,
"narHash": "sha256-duF1U12b7vVkf2Lt6noPYVeW8dVFw4CwJmQivhyZxYQ=",
"lastModified": 1686059680,
"narHash": "sha256-sp0WlCIeVczzB0G8f8iyRg3IYW7KG31mI66z7HIZwrI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "96f8f4a038a190f7511da79ef7e77bec5e4b811a",
"rev": "a558f7ac29f50c4b937fb5c102f587678ae1c9fb",
"type": "github"
},
"original": {
@@ -71,19 +91,24 @@
"type": "github"
}
},
"nixpkgs_2": {
"npm-groovy-lint": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1685539144,
"narHash": "sha256-BvIghafqDrQqWSbnWuDVLD6fiPWRE/foLWSupFM+Hho=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "afc48694f2aca366710295f027a4a423f3f339cc",
"lastModified": 1686066760,
"narHash": "sha256-RLx3ptgTvSdukaGNaaYZ7qnLja4kpErkllzY8Lpxdew=",
"owner": "miknikif",
"repo": "npm-groovy-lint",
"rev": "91e13f33a9815a827dfe26f2ec0bf15c157470ae",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-23.05",
"repo": "nixpkgs",
"owner": "miknikif",
"repo": "npm-groovy-lint",
"type": "github"
}
},
@@ -91,7 +116,8 @@
"inputs": {
"flake-utils": "flake-utils",
"groovyls": "groovyls",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs",
"npm-groovy-lint": "npm-groovy-lint"
}
},
"systems": {
@@ -123,6 +149,21 @@
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@@ -4,12 +4,16 @@
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
flake-utils.url = "github:numtide/flake-utils";
groovyls.url = "github:miknikif/groovyls";
groovyls.inputs.nixpkgs.follows = "nixpkgs";
npm-groovy-lint.url = "github:miknikif/npm-groovy-lint";
npm-groovy-lint.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
groovyls,
npm-groovy-lint,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
@@ -53,13 +57,14 @@
nodePackages.prettier # ditto
nodePackages.bash-language-server # bash lsp
nodePackages.vscode-json-languageserver # json lsp
pkgs.npm-groovy-lint # groovy lsp
python310Packages.python-lsp-server # todo: is specifying 310 an issue?
alejandra # nix formatter alternative
statix # linter for nix
vale # linter for prose
jdk # for groovy
groovy
groovyls # groovy lsp
pkgs.groovyls # groovy lsp
];
neovim-augmented = recursiveMerge [
pkgs.neovim-unwrapped

View File

@@ -2,6 +2,7 @@
overlays = [
(final: prev: {
inherit (inputs.groovyls.packages.${final.system}) groovyls;
inherit (inputs.npm-groovy-lint.packages.${final.system}) npm-groovy-lint;
})
];
}

View File

@@ -235,8 +235,9 @@ M.diagnostics = function(groovyls_cmd)
debug = false,
sources = {
-- formatting.lua_format,
formatting.alejandra, -- for nix
formatting.prismaFmt, -- for node prisma db orm
formatting.alejandra, -- for nix
formatting.prismaFmt, -- for node prisma db orm
formatting.npm_groovy_lint, -- groovy lsp
formatting.prettier.with {
-- extra_args = {
@@ -259,7 +260,7 @@ M.diagnostics = function(groovyls_cmd)
diagnostics.statix, -- for nix
null_ls.builtins.hover.dictionary, codeactions.shellcheck,
diagnostics.shellcheck,
diagnostics.npm_groovy_lint
diagnostics.npm_groovy_lint -- groovy lsp
-- removed formatting.rustfmt since rust_analyzer seems to do the same thing
},
on_attach = attached