AutoYADM commit: 2025-06-09 18:39:42

This commit is contained in:
Daniel Fichtinger 2025-06-09 18:39:42 -04:00
parent eafc2ae303
commit 0a173e7323
2 changed files with 24 additions and 2 deletions

View file

@ -213,3 +213,27 @@ hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
define-command lsp-check-inline-diagnostic %{ define-command lsp-check-inline-diagnostic %{
# we write a python script for this # we write a python script for this
} }
define-command lsp-diag-set %{
evaluate-commands %sh{
printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >/tmp/diag-in
read result < /tmp/diag-out
if [ "$result" != "ok" ]; then
echo "info 'failed'"
else
echo "nop"
fi
}
}
define-command -params 2 lsp-diag-query %{
evaluate-commands %sh{
printf 'query %s %s\n' "$1" "$2" >/tmp/diag-in
read result < /tmp/diag-out
if [ "$result" = "true" ]; then
echo "info 'true'"
else
echo "info 'false'"
fi
}
}

View file

@ -65,14 +65,12 @@ def main():
diagnostics = parse_specs(payload) diagnostics = parse_specs(payload)
_ = outfile.write("ok\n") _ = outfile.write("ok\n")
outfile.flush() outfile.flush()
print("ok", flush=True)
elif line.startswith("query "): elif line.startswith("query "):
_, pos = line.split(" ", 1) _, pos = line.split(" ", 1)
l, c = map(int, pos.strip().split()) l, c = map(int, pos.strip().split())
result = is_cursor_in_any((l, c), diagnostics) result = is_cursor_in_any((l, c), diagnostics)
_ = outfile.write("true\n" if result else "false\n") _ = outfile.write("true\n" if result else "false\n")
outfile.flush() outfile.flush()
print("ok", flush=True)
elif line == "exit": elif line == "exit":
break break