Retreive the status of nvim's builtin LSP clients.
paq 'doums/lsp_status'
local lspconfig = require'lspconfig'
local lsp_status = require'lsp_status'
-- register an handler for `$/progress` method
lsp_status.setup()
local function on_attach(client)
-- ... other stuff
-- get client name
lsp_status.on_attach(client)
end
lspconfig.rust_analyzer.setup { -- Rust Analyzer setup
on_attach = on_attach,
-- add `window/workDoneProgress` to default client capabilities
capabilities = lsp_status.capabilities
}
The status is either the LSP client name or, if it exists, a text built from the last "Work done progress" notification.
See the spec for details.
require'lsp_status'.status()
Listen to the autocommand event LspStatusChanged
to get notified when the status is updated.
Mozilla Public License 2.0