Compare commits
3 commits
0b64c9caa7
...
01059616bf
| Author | SHA1 | Date | |
|---|---|---|---|
| 01059616bf | |||
| 8a78ce8520 | |||
| 102dc4cc76 |
1 changed files with 17 additions and 1 deletions
|
|
@ -6,6 +6,18 @@ null_ls.setup({
|
|||
on_attach = lsp.on_attach,
|
||||
})
|
||||
|
||||
-- Bazel
|
||||
null_ls.register({
|
||||
null_ls.builtins.diagnostics.buildifier.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("buildifier"),
|
||||
}),
|
||||
null_ls.builtins.formatting.buildifier.with({
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("buildifier"),
|
||||
}),
|
||||
})
|
||||
|
||||
-- C, C++
|
||||
null_ls.register({
|
||||
null_ls.builtins.formatting.clang_format.with({
|
||||
|
|
@ -29,7 +41,9 @@ null_ls.register({
|
|||
null_ls.builtins.formatting.nixpkgs_fmt.with({
|
||||
-- Only used if available, but prefer rnix if available
|
||||
condition = function()
|
||||
return utils.is_executable("nixpkgs-fmt") and not utils.is_executable("rnix-lsp")
|
||||
return utils.is_executable("nixpkgs-fmt")
|
||||
and not utils.is_executable("rnix-lsp")
|
||||
and not utils.is_executable("nil")
|
||||
end,
|
||||
}),
|
||||
})
|
||||
|
|
@ -116,6 +130,8 @@ null_ls.register({
|
|||
-- Indent with 4 spaces, simplify the code, indent switch cases,
|
||||
-- add space after redirection, use POSIX
|
||||
extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "posix" },
|
||||
-- Restrict to POSIX sh
|
||||
filetypes = { "sh" },
|
||||
-- Only used if available
|
||||
condition = utils.is_executable_condition("shfmt"),
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue