According to null-ls docs, the official way of fetching null-ls sources is to use the get_source(query) function instead of directly accessing builtins table.
The biggest difference is that the current method does not distinguish sources that are disabled while results that return from get_source are already filtered internally.
Fix
This PR uses get_source function with query of filetype instead.
One breaking change is that the previous code only listed sources of formatting and diagnostics but now it lists all sources (i.e. from code_actions, completion, hover as well)
Is there any reason you were filtering?
Note
Out of the scope of this PR but I just wanted to inform you that vim.lsp.buf_get_clients(bufnr) has been deprecated since nvim-0.9.0 to be replaced by vim.lsp.get_active_clients({ bufnr = bufnr }). Ref
Thank you for the amazing plugin!
Bug
According to null-ls docs, the official way of fetching null-ls sources is to use the
get_source(query)
function instead of directly accessingbuiltins
table.https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/SOURCES.md
The biggest difference is that the current method does not distinguish sources that are disabled while results that return from
get_source
are already filtered internally.Fix
This PR uses
get_source
function with query of filetype instead.One breaking change is that the previous code only listed sources of
formatting
anddiagnostics
but now it lists all sources (i.e. fromcode_actions
,completion
,hover
as well)Is there any reason you were filtering?
Note
Out of the scope of this PR but I just wanted to inform you that
vim.lsp.buf_get_clients(bufnr)
has been deprecated sincenvim-0.9.0
to be replaced byvim.lsp.get_active_clients({ bufnr = bufnr })
. RefI'll leave it to you whether to fix it or not.