2024-03-01 13:24:14 +01:00
|
|
|
{
|
2023-03-14 22:52:53 +01:00
|
|
|
# Empty configuration
|
|
|
|
empty = {
|
2023-10-13 11:43:42 -06:00
|
|
|
plugins.none-ls.enable = true;
|
2023-03-14 22:52:53 +01:00
|
|
|
};
|
|
|
|
|
2023-03-22 07:42:02 +01:00
|
|
|
# Broken:
|
2023-10-13 11:43:42 -06:00
|
|
|
# error: The option `plugins.none-ls.sources.formatting.beautysh' does not exist.
|
2023-03-22 07:42:02 +01:00
|
|
|
#
|
|
|
|
# beautysh = {
|
2023-10-13 11:43:42 -06:00
|
|
|
# plugins.none-ls = {
|
2023-03-22 07:42:02 +01:00
|
|
|
# enable = true;
|
|
|
|
# sources.formatting.beautysh.enable = true;
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
|
2023-11-28 09:47:29 +01:00
|
|
|
with-lsp-format = {
|
|
|
|
plugins = {
|
2023-12-06 15:27:37 +01:00
|
|
|
lsp.enable = true;
|
2023-11-28 09:47:29 +01:00
|
|
|
lsp-format.enable = true;
|
|
|
|
none-ls = {
|
|
|
|
enable = true;
|
2024-06-18 16:39:09 +01:00
|
|
|
# This is implied:
|
|
|
|
# enableLspFormat = true;
|
2023-11-28 09:47:29 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-18 16:39:09 +01:00
|
|
|
defaults = {
|
|
|
|
plugins.none-ls = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
border = null;
|
|
|
|
cmd = [ "nvim" ];
|
|
|
|
debounce = 250;
|
|
|
|
debug = false;
|
|
|
|
default_timeout = 5000;
|
|
|
|
diagnostic_config = { };
|
|
|
|
diagnostics_format = "#{m}";
|
|
|
|
fallback_severity.__raw = "vim.diagnostic.severity.ERROR";
|
|
|
|
log_level = "warn";
|
|
|
|
notify_format = "[null-ls] %s";
|
|
|
|
on_attach = null;
|
|
|
|
on_init = null;
|
|
|
|
on_exit = null;
|
|
|
|
root_dir = "require('null-ls.utils').root_pattern('.null-ls-root', 'Makefile', '.git')";
|
|
|
|
root_dir_async = null;
|
|
|
|
should_attach = null;
|
|
|
|
sources = null;
|
|
|
|
temp_dir = null;
|
|
|
|
update_in_insert = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
example = {
|
|
|
|
plugins.none-ls = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
diagnostics_format = "[#{c}] #{m} (#{s})";
|
|
|
|
on_attach = ''
|
|
|
|
function(client, bufnr)
|
|
|
|
-- Integrate lsp-format with none-ls
|
|
|
|
-- Disabled because plugins.lsp-format is not enabled
|
|
|
|
-- require('lsp-format').on_attach(client, bufnr)
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
on_exit = ''
|
|
|
|
function()
|
|
|
|
print("Goodbye, cruel world!")
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
on_init = ''
|
|
|
|
function(client, initialize_result)
|
|
|
|
print("Hello, world!")
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
root_dir = ''
|
|
|
|
function(fname)
|
|
|
|
return fname:match("my-project") and "my-project-root"
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
root_dir_async = ''
|
|
|
|
function(fname, cb)
|
|
|
|
cb(fname:match("my-project") and "my-project-root")
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
should_attach = ''
|
|
|
|
function(bufnr)
|
|
|
|
return not vim.api.nvim_buf_get_name(bufnr):match("^git://")
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
temp_dir = "/tmp";
|
|
|
|
update_in_insert = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
with-sources = {
|
2024-07-11 19:07:54 +01:00
|
|
|
module =
|
|
|
|
{
|
|
|
|
config,
|
|
|
|
options,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
plugins.none-ls = {
|
|
|
|
# sandbox-exec: pattern serialization length 159032 exceeds maximum (65535)
|
|
|
|
enable = !pkgs.stdenv.isDarwin;
|
2024-03-01 13:24:14 +01:00
|
|
|
|
2024-07-11 19:07:54 +01:00
|
|
|
sources =
|
|
|
|
let
|
|
|
|
disabled =
|
|
|
|
[
|
|
|
|
# As of 2024-03-22, pkgs.d2 is broken
|
|
|
|
# TODO: re-enable this test when fixed
|
|
|
|
"d2_fmt"
|
|
|
|
# TODO: can this be re-enabled?
|
|
|
|
"yamlfix"
|
|
|
|
]
|
|
|
|
++ (lib.optionals (pkgs.stdenv.isDarwin && pkgs.stdenv.isx86_64) [
|
|
|
|
# As of 2024-03-27, pkgs.graalvm-ce (a dependency of pkgs.clj-kondo) is broken on x86_64-darwin
|
|
|
|
# TODO: re-enable this test when fixed
|
|
|
|
"clj_kondo"
|
|
|
|
])
|
|
|
|
++ (lib.optionals pkgs.stdenv.isDarwin [
|
|
|
|
# As of 2024-05-22, python311Packages.k5test (one of ansible-lint's dependenvies) is broken on darwin
|
|
|
|
# TODO: re-enable this test when fixed
|
|
|
|
"ansible_lint"
|
|
|
|
"clazy"
|
|
|
|
"gdformat"
|
|
|
|
"gdlint"
|
|
|
|
"haml_lint"
|
|
|
|
# As of 2024-06-29, pkgs.rubyfmt is broken on darwin
|
|
|
|
# TODO: re-enable this test when fixed
|
|
|
|
"rubyfmt"
|
|
|
|
"verilator"
|
|
|
|
"verible_verilog_format"
|
|
|
|
])
|
|
|
|
++ (lib.optionals pkgs.stdenv.isAarch64 [
|
|
|
|
"semgrep"
|
|
|
|
"smlfmt"
|
|
|
|
# As of 2024-03-11, swift-format is broken on aarch64
|
|
|
|
# TODO: re-enable this test when fixed
|
|
|
|
"swift_format"
|
|
|
|
]);
|
|
|
|
in
|
|
|
|
# Enable every none-ls source that has an option
|
|
|
|
lib.mapAttrs (
|
|
|
|
_:
|
|
|
|
lib.mapAttrs (
|
|
|
|
sourceName: opts:
|
|
|
|
{
|
|
|
|
# Enable unless disabled above
|
|
|
|
enable = !(lib.elem sourceName disabled);
|
|
|
|
}
|
|
|
|
# Some sources have a package option with no default
|
|
|
|
// lib.optionalAttrs (opts ? package && !(opts.package ? default)) { package = null; }
|
|
|
|
)
|
|
|
|
) options.plugins.none-ls.sources;
|
|
|
|
};
|
|
|
|
};
|
2023-03-14 22:52:53 +01:00
|
|
|
};
|
|
|
|
}
|