Skip to content

Handling progress notifications

Sidharth Kshatriya edited this page Nov 19, 2021 · 4 revisions

To handle progress notifications, override the lsp-handle-progress command by adding the following to your kakrc:

declare-option -hidden str modeline_progress ""
define-command -hidden -params 6 -override lsp-handle-progress %{
    set global modeline_progress %sh{
        if ! "$6"; then
            echo "$2${5:+" ($5%)"}${4:+": $4"}"
        fi
    }
}

And then put %opt{modeline_progress} in your modelinefmt to see what language server is doing.

Example: if you just wanted to add progress to the existing modelinefmt then you could additionally add the following to your kakrc:

set global modelinefmt "%%opt{modeline_progress} %opt{modelinefmt}"