This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
Is there an api equivalent to vim.lsp.get_active_clients()
?
#1409
Unanswered
boltlessengineer
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Not really, because null-ls does not have the concept of an attached source. When null-ls receives an LSP request / notification, it uses the parameters of the request to determine which sources are available and run the ones that are. A source's availability is determined by:
We can't accurately check local get_active_sources = function()
local filetype = vim.bo.filetype
return vim.tbl_filter(function(source)
return source.filetypes[filetype] or source.filetypes["_all"] and source.filetypes[filetype] == nil
end, require("null-ls").get_sources())
end If you think this is useful, I'd be open to a PR that adds a filetype filter option to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I see null-ls has
get_all()
andget_available(filetype, method)
innull-ls.sources
, which returns list of installed sources.What I want is getting all attached clients, not configured/installed ones. Native LSP supports this feature with
vim.lsp.get_active_clients()
Does null-ls has api like this?Beta Was this translation helpful? Give feedback.
All reactions