From 4db7d629c7993ec7fe8fb793ad3622a6d1eccaf5 Mon Sep 17 00:00:00 2001 From: Shuu Date: Thu, 21 Nov 2024 08:08:19 +0900 Subject: [PATCH] lsp: Make client writes non blocking (#2204) --- ...25016_github-actions[bot]_client-non-blocking-write.rst | 7 +++++++ src/moepkg/lsp/jsonrpc.nim | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelog.d/20241120_225016_github-actions[bot]_client-non-blocking-write.rst diff --git a/changelog.d/20241120_225016_github-actions[bot]_client-non-blocking-write.rst b/changelog.d/20241120_225016_github-actions[bot]_client-non-blocking-write.rst new file mode 100644 index 000000000..3d545dc9e --- /dev/null +++ b/changelog.d/20241120_225016_github-actions[bot]_client-non-blocking-write.rst @@ -0,0 +1,7 @@ +.. _#2204: https://github.com/fox0430/moe/pull/2204 + +Changed +....... + +- `#2204`_ lsp: Make client writes non blocking + diff --git a/src/moepkg/lsp/jsonrpc.nim b/src/moepkg/lsp/jsonrpc.nim index b464df4be..cecf259fa 100644 --- a/src/moepkg/lsp/jsonrpc.nim +++ b/src/moepkg/lsp/jsonrpc.nim @@ -164,8 +164,7 @@ proc send( debugLog(MessageType.write, req) try: - if not await s.stream.write(req).withTimeout(Timeout): - return Result[(), string].err "write: Timeout" + asyncSpawn s.stream.write(req) except CatchableError as e: return Result[(), string].err e.msg