add groovyls
This commit is contained in:
71
flake.lock
generated
71
flake.lock
generated
@@ -18,7 +18,60 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1686055585,
|
||||
"narHash": "sha256-e+hjiIvQZ6Dmow7cJlGTS0LmJh8vNRhyU/HDHPOIqi0=",
|
||||
"owner": "miknikif",
|
||||
"repo": "groovyls",
|
||||
"rev": "cb877e243f5b3c2e725ac2d50a6f70c184161d4a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "miknikif",
|
||||
"repo": "groovyls",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1686043861,
|
||||
"narHash": "sha256-duF1U12b7vVkf2Lt6noPYVeW8dVFw4CwJmQivhyZxYQ=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "96f8f4a038a190f7511da79ef7e77bec5e4b811a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "release-23.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1685539144,
|
||||
"narHash": "sha256-BvIghafqDrQqWSbnWuDVLD6fiPWRE/foLWSupFM+Hho=",
|
||||
@@ -37,7 +90,8 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"groovyls": "groovyls",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
@@ -54,6 +108,21 @@
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"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",
|
||||
|
||||
10
flake.nix
10
flake.nix
@@ -3,16 +3,24 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
groovyls.url = "github:miknikif/groovyls";
|
||||
};
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
groovyls,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
inherit
|
||||
(import ./overlays.nix {
|
||||
inherit inputs;
|
||||
})
|
||||
overlays
|
||||
;
|
||||
};
|
||||
|
||||
recursiveMerge = attrList: let
|
||||
@@ -51,6 +59,7 @@
|
||||
vale # linter for prose
|
||||
jdk # for groovy
|
||||
groovy
|
||||
groovyls # groovy lsp
|
||||
];
|
||||
neovim-augmented = recursiveMerge [
|
||||
pkgs.neovim-unwrapped
|
||||
@@ -70,6 +79,7 @@
|
||||
''
|
||||
lua << EOF
|
||||
package.path = "${self}/?.lua;" .. package.path
|
||||
groovyls_cmd = { "${pkgs.jdk}/bin/java", "-jar", "${pkgs.groovyls}/groovyls-all.jar" }
|
||||
''
|
||||
+ pkgs.lib.readFile ./init.lua
|
||||
+ ''
|
||||
|
||||
2
init.lua
2
init.lua
@@ -12,7 +12,7 @@ require('pwnvim.options').gui()
|
||||
require('pwnvim.mappings')
|
||||
require('pwnvim.abbreviations')
|
||||
require('pwnvim.plugins').ui()
|
||||
require('pwnvim.plugins').diagnostics()
|
||||
require('pwnvim.plugins').diagnostics(groovyls_cmd) -- groovyls_cmd is dynamically created by nix
|
||||
require('pwnvim.plugins').telescope()
|
||||
require('pwnvim.plugins').completions()
|
||||
require('pwnvim.plugins').notes()
|
||||
|
||||
7
overlays.nix
Normal file
7
overlays.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{inputs, ...}: {
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
inherit (inputs.groovyls.packages.${final.system}) groovyls;
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -36,7 +36,7 @@ M.config = function()
|
||||
autocmd("FileType",
|
||||
{
|
||||
pattern = { "c", "ruby", "php", "php3", "perl", "python", "mason", "vim", "sh", "zsh", "scala", "javascript",
|
||||
"javascriptreact", "typescript", "typescriptreact", "html", "svelte", "css", "nix", "terraform" },
|
||||
"javascriptreact", "typescript", "typescriptreact", "html", "svelte", "css", "nix", "terraform", "groovy", "java" },
|
||||
callback = function() require('pwnvim.options').programming() end,
|
||||
group = filetypes
|
||||
})
|
||||
|
||||
@@ -34,7 +34,7 @@ M.ui = function()
|
||||
end -- UI setup
|
||||
|
||||
----------------------- DIAGNOSTICS --------------------------------
|
||||
M.diagnostics = function()
|
||||
M.diagnostics = function(groovyls_cmd)
|
||||
-- IMPORTANT: make sure to setup neodev BEFORE lspconfig
|
||||
require("neodev").setup({
|
||||
-- help for neovim lua api
|
||||
@@ -258,7 +258,8 @@ M.diagnostics = function()
|
||||
codeactions.eslint_d, codeactions.gitsigns, codeactions.statix, -- for nix
|
||||
diagnostics.statix, -- for nix
|
||||
null_ls.builtins.hover.dictionary, codeactions.shellcheck,
|
||||
diagnostics.shellcheck
|
||||
diagnostics.shellcheck,
|
||||
diagnostics.npm_groovy_lint
|
||||
-- removed formatting.rustfmt since rust_analyzer seems to do the same thing
|
||||
},
|
||||
on_attach = attached
|
||||
@@ -350,9 +351,9 @@ M.diagnostics = function()
|
||||
},
|
||||
capabilities = capabilities
|
||||
}
|
||||
lspconfig.terraformls.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
||||
lspconfig.tflint.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
||||
lspconfig.groovyls.setup { on_attach = attached, capabilities = capabilities } -- groovy lsp
|
||||
lspconfig.terraformls.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
||||
lspconfig.tflint.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
||||
lspconfig.groovyls.setup { on_attach = attached, capabilities = capabilities, cmd = groovyls_cmd } -- groovy lsp
|
||||
|
||||
require 'lspsaga'.init_lsp_saga({
|
||||
use_saga_diagnostic_sign = not SimpleUI,
|
||||
|
||||
Reference in New Issue
Block a user