Closed akinsho closed 3 years ago
How can I use it to get only LSP progress?
local status = require('lsp-status').status_progress()
The README needs some love generally I think since none of the component functions are documented this change included π
@akinsho, thank you!
But can I somehow remove this part and leave only progress?
When I typing it just blinks from idle
to queued
. Super annoying :D
@Shatur95 this PR was just about separating the messages from the diagnostics and other symbols. There's probably value in maybe just allowing a user to specify a formatter function and then they can construct the string themselves as they like. I'm not familiar with actual message parsing @wbthomason might know more about how feasible this is.
function(progress_int, client_name, status_string)
return ... -- user does what they like
end
Anyway I don't have time to do this atm so if someone else wants to have ago π€·πΎ
@Shatur95 we do not do any parsing of the messages from language servers, so that's just what clangd
is sending. You can look at messaging.lua L10:L33
for the logic building a table of messages, and the function @akinsho split out in this PR for how we generate a statusline component from those messages. You could make a PR to add a formatting hook or similar, which would basically just override the body of get_lsp_progress
. You can also just make a custom statusline component based on your own function; as in get_lsp_progress
you use the messages()
function from lsp-status/messages
to get the table of message data, then iterate over each and process them as you will (this is the bulk of get_lsp_progress
).
Thanks for the info, now I get it! Will think about the implementation.
This relates to #30 and exposes the progress section of the lsp status so it can be used separately