[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot c8e7ab0 16/24: Don't rely on Flymake's idle timer
From: |
João Távora |
Subject: |
[elpa] externals/eglot c8e7ab0 16/24: Don't rely on Flymake's idle timer for textDocument/didChange |
Date: |
Sat, 26 May 2018 14:31:16 -0400 (EDT) |
branch: externals/eglot
commit c8e7ab0c6e1cbd4902fdac6ce0435e84f9790b25
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Don't rely on Flymake's idle timer for textDocument/didChange
* eglot.el (eglot--after-change): Set idle timer here.
(eglot--change-idle-timer): New var.
(eglot--signal-textDocument/didChange): No seed to set spinner here.
(eglot-flymake-backend) Don't send didChange here.
---
eglot.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/eglot.el b/eglot.el
index 3d36344..8fe24ed 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1131,6 +1131,8 @@ THINGS are either registrations or unregisterations."
(cl-plusp (+ (length (car eglot--recent-changes))
(length (cdr eglot--recent-changes)))))
+(defvar eglot--change-idle-timer nil "Idle timer for textDocument/didChange.")
+
(defun eglot--before-change (start end)
"Hook onto `before-change-functions'.
Records START and END, crucially convert them into
@@ -1149,7 +1151,12 @@ Records START, END and PRE-CHANGE-LENGTH locally."
(setf (cdr eglot--recent-changes)
(vconcat (cdr eglot--recent-changes)
`[(,pre-change-length
- ,(buffer-substring-no-properties start end))])))
+ ,(buffer-substring-no-properties start end))]))
+ (when eglot--change-idle-timer (cancel-timer eglot--change-idle-timer))
+ (setq eglot--change-idle-timer
+ (run-with-idle-timer
+ 0.5 nil (lambda () (eglot--signal-textDocument/didChange)
+ (setq eglot--change-idle-timer nil)))))
(defun eglot--signal-textDocument/didChange ()
"Send textDocument/didChange to server."
@@ -1166,8 +1173,7 @@ Records START, END and PRE-CHANGE-LENGTH locally."
(eglot--notify
server :textDocument/didChange
(eglot--obj
- :textDocument
- (eglot--VersionedTextDocumentIdentifier)
+ :textDocument (eglot--VersionedTextDocumentIdentifier)
:contentChanges
(if full-sync-p (vector
(eglot--obj
@@ -1180,7 +1186,6 @@ Records START, END and PRE-CHANGE-LENGTH locally."
:rangeLength len
:text after-text)])))))
(setq eglot--recent-changes (cons [] []))
- (setf (eglot--spinner server) (list nil :textDocument/didChange t))
(eglot--call-deferred server))))
(defun eglot--signal-textDocument/didOpen ()
@@ -1225,9 +1230,7 @@ Calls REPORT-FN maybe if server publishes diagnostics in
time."
;; Report anything unreported
(when eglot--unreported-diagnostics
(funcall report-fn eglot--unreported-diagnostics)
- (setq eglot--unreported-diagnostics nil))
- ;; Signal a didChange that might eventually bring new diagnotics
- (eglot--signal-textDocument/didChange))
+ (setq eglot--unreported-diagnostics nil)))
(defun eglot-xref-backend ()
"EGLOT xref backend."
- [elpa] externals/eglot 3a1ff72 04/24: Introduce new API methods for experimental clients to use, (continued)
- [elpa] externals/eglot 3a1ff72 04/24: Introduce new API methods for experimental clients to use, João Távora, 2018/05/26
- [elpa] externals/eglot 9c87771 12/24: Introduce eglot--debug for unimportant messages, João Távora, 2018/05/26
- [elpa] externals/eglot 8d4c2c3 13/24: Demote unvisited diagnostics logging to debug level, João Távora, 2018/05/26
- [elpa] externals/eglot 85c5353 11/24: Add cquery support for C/C++ projects, João Távora, 2018/05/26
- [elpa] externals/eglot d40a458 14/24: Log debug messages through eglot--debug, João Távora, 2018/05/26
- [elpa] externals/eglot 17a3257 03/24: Do Rust's RLS hack properly with new class-based API, João Távora, 2018/05/26
- [elpa] externals/eglot 3aa2958 06/24: Add a complex RLS test, João Távora, 2018/05/26
- [elpa] externals/eglot 07078da 08/24: Rework eglot-tests.el for better debuggability, João Távora, 2018/05/26
- [elpa] externals/eglot 0462130 15/24: New RLS tests, João Távora, 2018/05/26
- [elpa] externals/eglot e1d7ff3 09/24: Disable file-watching tests on Travis, João Távora, 2018/05/26
- [elpa] externals/eglot c8e7ab0 16/24: Don't rely on Flymake's idle timer for textDocument/didChange,
João Távora <=
- [elpa] externals/eglot 99ca690 17/24: Simpify eglot--server-receive, João Távora, 2018/05/26
- [elpa] externals/eglot 1b5ed29 21/24: Really ensure eglot--shutdown deletes a process completely, João Távora, 2018/05/26
- [elpa] externals/eglot 897cbc3 24/24: * eglot.el (Version): Bump to 0.5, João Távora, 2018/05/26
- [elpa] externals/eglot ec10de2 23/24: Another unstable test on Travis, João Távora, 2018/05/26
- [elpa] externals/eglot d0fb9d2 22/24: Merge branch 'cquery-support' into master, João Távora, 2018/05/26
- [elpa] externals/eglot 97db670 19/24: Get rid of eglot--obj, an uninteresting abstraction, João Távora, 2018/05/26
- [elpa] externals/eglot 5e3804b 20/24: Add a new test., João Távora, 2018/05/26
- [elpa] externals/eglot 94c008d 18/24: Cleanup deferred request mechanism with a readable log, João Távora, 2018/05/26
- [elpa] externals/eglot 18176f3 02/24: Use an EIEIO class to represent a server., João Távora, 2018/05/26
- [elpa] externals/eglot eccb7d1 10/24: Merge branch 'use-eieio-server-defclass', João Távora, 2018/05/26