Compare commits
5 commits
e59c277cdd
...
0fbce67a99
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fbce67a99 | |||
| e3d7847679 | |||
| 3a66e25ae2 | |||
| c23185ef25 | |||
| bc64e43590 |
5 changed files with 44 additions and 51 deletions
|
|
@ -105,7 +105,7 @@ in
|
|||
nixpkgs-fmt
|
||||
|
||||
# Shell
|
||||
shellcheck
|
||||
nodePackages.bash-language-server
|
||||
shfmt
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,6 +29,14 @@ if utils.is_executable("clangd") then
|
|||
})
|
||||
end
|
||||
|
||||
-- Haskell
|
||||
if utils.is_executable("haskell-language-server-wrapper") then
|
||||
lspconfig.hls.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
|
||||
-- Nix
|
||||
if utils.is_executable("nil") then
|
||||
lspconfig.nil_ls.setup({
|
||||
|
|
@ -52,6 +60,13 @@ if utils.is_executable("pyright") then
|
|||
})
|
||||
end
|
||||
|
||||
if utils.is_executable("ruff-lsp") then
|
||||
lspconfig.ruff_lsp.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
|
||||
-- Rust
|
||||
if utils.is_executable("rust-analyzer") then
|
||||
lspconfig.rust_analyzer.setup({
|
||||
|
|
@ -59,3 +74,12 @@ if utils.is_executable("rust-analyzer") then
|
|||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
|
||||
-- Shell
|
||||
if utils.is_executable("bash-language-server") then
|
||||
lspconfig.bashls.setup({
|
||||
filetypes = { "bash", "sh", "zsh" },
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp.on_attach,
|
||||
})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -28,14 +28,6 @@ null_ls.register({
|
|||
}),
|
||||
})
|
||||
|
||||
-- Haskell
|
||||
null_ls.register({
|
||||
null_ls.builtins.formatting.brittany.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("brittany"),
|
||||
}),
|
||||
})
|
||||
|
||||
-- Nix
|
||||
null_ls.register({
|
||||
null_ls.builtins.formatting.nixpkgs_fmt.with({
|
||||
|
|
@ -50,16 +42,6 @@ null_ls.register({
|
|||
|
||||
-- Python
|
||||
null_ls.register({
|
||||
null_ls.builtins.diagnostics.flake8.with({
|
||||
-- Only used if available, but prefer pflake8 if available
|
||||
condition = function()
|
||||
return utils.is_executable("flake8") and not utils.is_executable("pflake8")
|
||||
end,
|
||||
}),
|
||||
null_ls.builtins.diagnostics.pyproject_flake8.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("pflake8"),
|
||||
}),
|
||||
null_ls.builtins.diagnostics.mypy.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("mypy"),
|
||||
|
|
@ -81,22 +63,6 @@ null_ls.register({
|
|||
|
||||
-- Shell (non-POSIX)
|
||||
null_ls.register({
|
||||
null_ls.builtins.code_actions.shellcheck.with({
|
||||
-- Restrict to bash and zsh
|
||||
filetypes = { "bash", "zsh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.diagnostics.shellcheck.with({
|
||||
-- Show error code in message
|
||||
diagnostics_format = "[#{c}] #{m}",
|
||||
-- Require explicit empty string test, use bash dialect
|
||||
extra_args = { "-s", "bash", "-o", "avoid-nullary-conditions" },
|
||||
-- Restrict to bash and zsh
|
||||
filetypes = { "bash", "zsh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
-- Indent with 4 spaces, simplify the code, indent switch cases,
|
||||
-- add space after redirection, use bash dialect
|
||||
|
|
@ -110,22 +76,6 @@ null_ls.register({
|
|||
|
||||
-- Shell (POSIX)
|
||||
null_ls.register({
|
||||
null_ls.builtins.code_actions.shellcheck.with({
|
||||
-- Restrict to POSIX sh
|
||||
filetypes = { "sh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.diagnostics.shellcheck.with({
|
||||
-- Show error code in message
|
||||
diagnostics_format = "[#{c}] #{m}",
|
||||
-- Require explicit empty string test
|
||||
extra_args = { "-o", "avoid-nullary-conditions" },
|
||||
-- Restrict to POSIX sh
|
||||
filetypes = { "sh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shellcheck"),
|
||||
}),
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
-- Indent with 4 spaces, simplify the code, indent switch cases,
|
||||
-- add space after redirection, use POSIX
|
||||
|
|
|
|||
4
overlays/none-ls-shellcheck-nvim/default.nix
Normal file
4
overlays/none-ls-shellcheck-nvim/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
self: prev:
|
||||
{
|
||||
vimPlugins = prev.vimPlugins.extend (self.callPackage ./generated.nix { });
|
||||
}
|
||||
15
overlays/none-ls-shellcheck-nvim/generated.nix
Normal file
15
overlays/none-ls-shellcheck-nvim/generated.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ vimUtils, fetchFromGitHub }:
|
||||
_final: _prev:
|
||||
{
|
||||
none-ls-shellcheck-nvim = vimUtils.buildVimPlugin {
|
||||
pname = "none-ls-shellcheck.nvim";
|
||||
version = "2024-02-28";
|
||||
src = fetchFromGitHub {
|
||||
owner = "gbprod";
|
||||
repo = "none-ls-shellcheck.nvim";
|
||||
rev = "1eed283a7ede771b522a0a9f30bb604f02f51d64";
|
||||
sha256 = "1hs0q9a0xwyqml0bfmplk89f1dk4nyg6aapfarnx44zqiw1183kn";
|
||||
};
|
||||
meta.homepage = "https://github.com/gbprod/none-ls-shellcheck.nvim/";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue