kak: fix rust-analyzer inlay hints

This commit is contained in:
lelgenio 2022-04-09 00:02:59 -03:00
parent 17bc20aefe
commit 54d0b12586
2 changed files with 6 additions and 17 deletions

View File

@ -43,44 +43,33 @@ plug "natasky/kakoune-multi-file"
plug "lelgenio/kakoune-colemak-neio"
plug 'kak-lsp/kak-lsp' tag 'v12.0.1' do %{
plug 'kak-lsp/kak-lsp' do %{
cargo install --locked --force --path .
} config %{
map global normal <F2> ': lsp-rename-prompt<ret>'
set global lsp_hover_max_lines 10
# lsp-inlay-diagnostics-enable global
lsp-inlay-diagnostics-enable global
set global lsp_auto_highlight_references true
set global lsp_inlay_diagnostic_sign "●"
set global lsp_diagnostic_line_error_sign "●"
hook global BufCreate .* %{try lsp-enable}
hook global -group rust-inlay-hints-auto WinSetOption filetype=rust %{
hook window -group rust-inlay-hints BufReload .* rust-analyzer-inlay-hints
hook window -group rust-inlay-hints NormalIdle .* rust-analyzer-inlay-hints
hook window -group rust-inlay-hints InsertIdle .* rust-analyzer-inlay-hints
hook -once -always window WinSetOption filetype=.* %{
remove-hooks window rust-inlay-hints
}
}
define-command -override -hidden lsp-enable-decals %{
lsp-inlay-diagnostics-enable global
try %{
add-highlighter global/rust_analyzer_inlay_hints replace-ranges rust_analyzer_inlay_hints
}
lsp-experimental-inlay-hints-enable global
}
define-command -override -hidden lsp-disable-decals %{
lsp-inlay-diagnostics-disable global
remove-highlighter global/rust_analyzer_inlay_hints
lsp-experimental-inlay-hints-disable global
}
lsp-enable-decals
hook global ModeChange '.*:insert:normal' %{lsp-enable-decals}
hook global ModeChange '.*:normal:insert' %{lsp-disable-decals}
hook global WinSetOption filetype=(c|cpp|rust) %{
lsp-enable
hook window -group semantic-tokens BufReload .* lsp-semantic-tokens
hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens
hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens

View File

@ -3,7 +3,7 @@
set -ex
REPO="https://github.com/rust-analyzer/rust-analyzer"
VERSION="2022-01-24"
VERSION="2022-04-04"
DLURL="$REPO/releases/download/$VERSION/rust-analyzer-x86_64-unknown-linux-gnu.gz"
GZFILE="$HOME/.cache/rust-analyzer-$VERSION-x86_64-unknown-linux-gnu.gz"
BINDIR="$HOME/.local/bin"