commit 851a622806a2e84ed8d53971465f3f5c2fe05d7a
parent a3921d2be65714870c488fc30193c8a341de63ad
Author: Gregory Anders <greg@gpanders.com>
Date: Wed, 6 Aug 2025 07:31:02 -0500
docs(lsp): include snippet to display progress using native indicator (#35176)
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
@@ -667,10 +667,29 @@ LspProgress *LspProgress*
properties, where `params` is the request params sent by the server (see
`lsp.ProgressParams`).
- Example: >vim
+ Examples:
+
+ Redraw the statusline whenever an LSP progress message arrives: >vim
autocmd LspProgress * redrawstatus
<
+ Tell the parent terminal to indicate progress using a native progress
+ indicator (requires a supporting terminal): >lua
+
+ vim.api.nvim_create_autocmd('LspProgress', {
+ callback = function(ev)
+ local value = ev.data.params.value
+ if value.kind == 'begin' then
+ io.stdout:write('\027]9;4;1;0\027\\')
+ elseif value.kind == 'end' then
+ io.stdout:write('\027]9;4;0\027\\')
+ elseif value.kind == 'report' then
+ io.stdout:write(string.format('\027]9;4;1;%d\027\\', value.percentage))
+ end
+ end,
+ })
+<
+
LspRequest *LspRequest*
For each request sent to an LSP server, this event is triggered for
every change to the request's status. The status can be one of