AutoYADM commit: 2025-06-10 00:09:05

This commit is contained in:
Daniel Fichtinger 2025-06-10 00:09:05 -04:00
parent 66ed93369c
commit e011abfe4e
2 changed files with 25 additions and 9 deletions

View file

@ -221,7 +221,7 @@ define-command lsp-diag-set %{
printf 'set %s\n' "$kak_opt_lsp_inline_diagnostics" >"$kak_opt_diagpipe_in"
read result < "$kak_opt_diagpipe_out"
if [ "$result" != "ok" ]; then
echo "info 'failed'"
echo "info 'lsp-diag failed to set'"
else
echo "nop"
fi
@ -233,9 +233,9 @@ define-command -params 2 lsp-diag-query %{
printf 'query %s %s\n' "$1" "$2" >"$kak_opt_diagpipe_in"
read result < "$kak_opt_diagpipe_out"
if [ "$result" = "true" ]; then
echo "info 'true'"
echo "trigger-user-hook lsp-diag-hover-true"
else
echo "info 'false'"
echo "trigger-user-hook lsp-diag-hover-false"
fi
}
}
@ -244,6 +244,21 @@ hook global KakEnd .* %{
nop %sh{
printf 'exit\n' >"$kak_opt_diagpipe_in"
read result < "$kak_opt_diagpipe_out"
notify-send "killing"
}
}
}
hook global User lsp-diag-hover-false %{
info 'false detected'
}
hook global User lsp-diag-hover-true %{
info 'true detected'
}
hook global NormalIdle .* %{
lsp-diag-query %val{cursor_line} %val{cursor_column}
}
hook global WinSetOption lsp_inline_diagnostics=.* %{
lsp-diag-set
}

View file

@ -57,7 +57,7 @@ def test():
def cleanup(inp: str, outp: str, dir: str):
subprocess.run(["notify-send", "cleanup runs"])
# subprocess.run(["notify-send", "cleanup runs"])
try:
os.remove(inp)
os.remove(outp)
@ -97,7 +97,7 @@ def daemonize(inp: str, outp: str, dir: str):
def main():
subprocess.run(["notify-send", "begin loop"])
# subprocess.run(["notify-send", "begin loop"])
# create unique directory and names
fifo_dir = tempfile.mkdtemp(prefix="diagpipe-")
in_path = os.path.join(fifo_dir, "in")
@ -119,8 +119,9 @@ def main():
if not line:
continue
assert isinstance(line, str)
subprocess.run(["notify-send", f"Received command: {line}"])
# # subprocess.run(["notify-send", f"Received command: {line}"])
if line.startswith("set "):
# subprocess.run(["notify-send", f"Received set: {line}"])
_, payload = line.split(" ", 1)
diagnostics = parse_specs(payload)
_ = outfile.write("ok\n")
@ -132,7 +133,7 @@ def main():
_ = outfile.write("true\n" if result else "false\n")
outfile.flush()
elif line.startswith("exit"):
subprocess.run(["notify-send", "exit received"])
# subprocess.run(["notify-send", "exit received"])
sys.exit(0)