AutoYADM commit: 2025-06-14 01:14:15

This commit is contained in:
Daniel Fichtinger 2025-06-14 01:14:15 -04:00
parent 540b826d0b
commit 531966d8be
2 changed files with 36 additions and 2 deletions

View file

@ -3,13 +3,16 @@ eval %sh{kak-lsp}
# eval %sh{kak-lsp-diags}
define-command -override -hidden lsp-do-send-async %{
echo -quoting shell -to-file /tmp/kak-lsp.txt %reg{a}
# echo -debug ===BEGIN-LSP
# echo -quoting shell -debug %reg{a}
# echo -debug ===END-LSP
echo -quoting shell -to-file %opt{lsp_fifo} %reg{a}
echo -to-file %opt{lsp_fifo} ' '
# nop %sh{ notify-send "this runs!" }
}
define-command -hidden lsp-do-send-sync %{
define-command -override -hidden lsp-do-send-sync %{
nop %sh{ notify-send 'this runs' }
unset-option buffer lsp_do_send_maybe_sync
evaluate-commands %sh{
tmp=$(mktemp -q -d -t 'kak-lsp-sync.XXXXXX' 2>/dev/null || mktemp -q -d)
@ -285,3 +288,34 @@ hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
# lsp-menu %arg{@}
# }
define-command lsp-inlay-hint-raw %{
evaluate-commands %sh{
tmp=$(mktemp -d)
pipe="${tmp}/fifo"
mkfifo "$pipe" || { echo "fail failed to create fifo"; exit 1; }
trap "rm -f \"$pipe\"; rmdir \"$tmp\"" EXIT INT QUIT
reg_a="$kak_session
$kak_client
true
false
$kak_buffile
$kak_timestamp
$kak_opt_filetype
$kak_opt_lsp_language_id
$kak_opt_lsp_servers
$kak_opt_lsp_semantic_tokens
$kak_opt_lsp_config
$kak_opt_lsp_server_initialization_options
map-end
textDocument/inlayHint
$kak_buf_line_count"
printf "%s '%s' " "$reg_a" "$pipe" > "$kak_opt_lsp_fifo"
raw=$(cat "$pipe")
raw_escaped=$(printf %s "$raw" | sed "s/'/''/g")
printf "set-register z '%s'\n" "$raw_escaped"
}
}