Automatic null-ls registration
mehalter opened this issue · 1 comments
With the work going on at mason-nvim-dap
are there plans to add automatic null-ls registration as well? This would be super great and extremely easy especially with the new commit to return the supported methods.
AstroNvim does this with a very simple default setup handler:
function null_ls_register(source, types)
local null_ls_avail, null_ls = pcall(require, "null-ls")
if null_ls_avail and not null_ls.is_registered(source) then
vim.tbl_map(function(type) null_ls.register(null_ls.builtins[type][source]) end, types)
end
end
mason_null_ls.setup_handlers({ null_ls_register })
I think it would make sense to move this into mason-null-ls
with an automatic setup configuration option similar to the work we are doing with mason-nvim-dap
. And could be rewritten in the functional format that you are using as well.
Yes, that makes sense to me. I just have been debating if it makes sense to register a source
for everything that is available. The only true way I see of confirming this is by doing it and see who complains