From 4d6d057e0e1536084c2ea55b1200ad1f0f7126a9 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Sun, 16 Mar 2025 18:21:59 +0800 Subject: [PATCH] hack: make lsp-completion super fast --- lsp-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lsp-mode.el b/lsp-mode.el index 345c1944f6..f0546ebf58 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -3431,11 +3431,11 @@ If NO-WAIT is non-nil send the request as notification." :cancel-token :sync-request) (while (not (or resp-error resp-result)) (if (functionp 'json-rpc-connection) - (catch 'lsp-done (sit-for 0.01)) + (catch 'lsp-done (sit-for 0.001)) (catch 'lsp-done (accept-process-output nil - (if expected-time (- expected-time send-time) 1)))) + 0.001))) (setq send-time (float-time)) (when (and expected-time (< expected-time send-time)) (error "Timeout while waiting for response. Method: %s" method))) @@ -3470,7 +3470,7 @@ Return same value as `lsp--while-no-input' and respecting `non-essential'." (while (not (or resp-error resp-result (input-pending-p))) (catch 'lsp-done (sit-for - (if expected-time (- expected-time send-time) 1))) + 0.001)) (setq send-time (float-time)) (when (and expected-time (< expected-time send-time)) (error "Timeout while waiting for response. Method: %s" method)))