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-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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-20 00:54:50 +01:00
|
|
|
with-sources =
|
|
|
|
{
|
|
|
|
options,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2025-03-04 10:09:08 +01:00
|
|
|
let
|
|
|
|
inherit (pkgs.stdenv) hostPlatform;
|
|
|
|
in
|
2024-08-20 00:54:50 +01:00
|
|
|
{
|
|
|
|
plugins.none-ls = {
|
|
|
|
# sandbox-exec: pattern serialization length 159032 exceeds maximum (65535)
|
2025-03-04 10:09:08 +01:00
|
|
|
enable = !hostPlatform.isDarwin;
|
2024-03-01 13:24:14 +01:00
|
|
|
|
2024-08-20 00:54:50 +01:00
|
|
|
sources =
|
|
|
|
let
|
2025-04-01 11:35:49 +02:00
|
|
|
disabled =
|
|
|
|
[
|
|
|
|
#TODO Added 2025-04-01
|
|
|
|
# php-cs-fixer is marked as broken
|
|
|
|
"phpcsfixer"
|
|
|
|
]
|
|
|
|
++ lib.optionals (hostPlatform.isLinux && hostPlatform.isAarch64) [
|
|
|
|
# Not available on aarch64-linux
|
|
|
|
"smlfmt"
|
2025-04-20 21:55:52 +02:00
|
|
|
|
|
|
|
# TODO: 2025-04-20 build failure (swift-corelibs-xctest)
|
|
|
|
"swift_format"
|
2025-04-21 00:34:56 +02:00
|
|
|
]
|
|
|
|
++ lib.optionals hostPlatform.isDarwin [
|
|
|
|
# TODO 2025-04-20 build failure
|
|
|
|
"ansiblelint"
|
2025-04-01 11:35:49 +02:00
|
|
|
];
|
2024-08-20 00:54:50 +01:00
|
|
|
in
|
|
|
|
# Enable every none-ls source that has an option
|
|
|
|
lib.mapAttrs (
|
|
|
|
_:
|
2024-07-11 19:07:54 +01:00
|
|
|
lib.mapAttrs (
|
2024-08-20 00:54:50 +01:00
|
|
|
sourceName: opts:
|
|
|
|
{
|
|
|
|
# Enable unless disabled above
|
|
|
|
enable = !(lib.elem sourceName disabled);
|
|
|
|
}
|
2025-01-30 22:53:55 +01:00
|
|
|
# Some sources are defined using mkUnpackagedOption whose default will throw
|
|
|
|
// lib.optionalAttrs (opts ? package && !(builtins.tryEval opts.package.default).success) {
|
|
|
|
package = null;
|
|
|
|
}
|
2024-08-20 00:54:50 +01:00
|
|
|
)
|
|
|
|
) options.plugins.none-ls.sources;
|
2024-07-11 19:07:54 +01:00
|
|
|
};
|
2024-08-20 00:54:50 +01:00
|
|
|
};
|
2023-03-14 22:52:53 +01:00
|
|
|
}
|