[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot a199c8e 070/139: Honour textDocumentSync
From: |
João Távora |
Subject: |
[elpa] externals/eglot a199c8e 070/139: Honour textDocumentSync |
Date: |
Mon, 14 May 2018 09:54:56 -0400 (EDT) |
branch: externals/eglot
commit a199c8ef754434b6210cbd56f7dcef5f04e686c2
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Honour textDocumentSync
* eglot.el (eglot--signal-textDocument/didChange): Honour textDocumentSync
---
eglot.el | 72 +++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 37 insertions(+), 35 deletions(-)
diff --git a/eglot.el b/eglot.el
index 5701422..68fe3e2 100644
--- a/eglot.el
+++ b/eglot.el
@@ -251,7 +251,9 @@ SUCCESS-FN with no args if all goes well."
(eglot--request
proc
:initialize
- (eglot--obj :processId (emacs-pid)
+ (eglot--obj :processId (unless (eq (process-type proc)
+ 'network)
+ (emacs-pid))
:rootUri (eglot--uri
(expand-file-name (car (project-roots
(project-current)))))
@@ -1070,44 +1072,44 @@ Records START, END and PRE-CHANGE-LENGTH locally."
"Send textDocument/didChange to server."
(when (and eglot--recent-before-changes
eglot--recent-after-changes)
- (save-excursion
+ (let* ((proc (eglot--current-process-or-lose))
+ (sync-kind (plist-get (eglot--capabilities proc)
:textDocumentSync)))
(save-restriction
(widen)
- (if (/= (length eglot--recent-before-changes)
- (length eglot--recent-after-changes))
- (eglot--notify
- (eglot--current-process-or-lose)
- :textDocument/didChange
- (eglot--obj
- :textDocument
(eglot--current-buffer-VersionedTextDocumentIdentifier)
- :contentChanges
- (vector
- (eglot--obj
- :text (buffer-substring-no-properties (point-min)
(point-max))))))
- (let ((combined (cl-mapcar 'append
- eglot--recent-before-changes
- eglot--recent-after-changes)))
- (eglot--notify
- (eglot--current-process-or-lose)
- :textDocument/didChange
- (eglot--obj
- :textDocument
(eglot--current-buffer-VersionedTextDocumentIdentifier)
- :contentChanges
+ (unless (or (not sync-kind)
+ (eq sync-kind 0))
+ (eglot--notify
+ proc
+ :textDocument/didChange
+ (eglot--obj
+ :textDocument
+ (eglot--current-buffer-VersionedTextDocumentIdentifier)
+ :contentChanges
+ (if (or (eq sync-kind 1)
+ (/= (length eglot--recent-before-changes)
+ (length eglot--recent-after-changes)))
+ (vector
+ (eglot--obj
+ :text (buffer-substring-no-properties (point-min)
(point-max))))
(apply
#'vector
- (mapcar (pcase-lambda (`(,before-start-position
- ,before-end-position
- ,after-start
- ,after-end
- ,len))
- (eglot--obj
- :range
- (eglot--obj
- :start before-start-position
- :end before-end-position)
- :rangeLength len
- :text (buffer-substring-no-properties after-start
after-end)))
- (reverse combined))))))))))
+ (mapcar
+ (pcase-lambda (`(,before-start-position
+ ,before-end-position
+ ,after-start
+ ,after-end
+ ,len))
+ (eglot--obj
+ :range
+ (eglot--obj
+ :start before-start-position
+ :end before-end-position)
+ :rangeLength len
+ :text (buffer-substring-no-properties after-start
after-end)))
+ (reverse
+ (cl-mapcar 'append
+ eglot--recent-before-changes
+ eglot--recent-after-changes)))))))))))
(setq eglot--recent-before-changes nil
eglot--recent-after-changes nil))
- [elpa] externals/eglot 4d4b85d 061/139: eglot-editing-mode becomes eglot--managed-mode, (continued)
- [elpa] externals/eglot 4d4b85d 061/139: eglot-editing-mode becomes eglot--managed-mode, João Távora, 2018/05/14
- [elpa] externals/eglot e7ffc31 067/139: Make reported capabilities into its own function, João Távora, 2018/05/14
- [elpa] externals/eglot 79a2a1e 069/139: Be quite explicit about our lack of capabilities right now, João Távora, 2018/05/14
- [elpa] externals/eglot 95187cf 058/139: Connect to LSP server via TCP, João Távora, 2018/05/14
- [elpa] externals/eglot f76f04e 057/139: More correctly keep track of didOpen/didClose per buffer, João Távora, 2018/05/14
- [elpa] externals/eglot 46bb1c0 049/139: Reorganize file, João Távora, 2018/05/14
- [elpa] externals/eglot ff5a03d 074/139: Very basic xref support, João Távora, 2018/05/14
- [elpa] externals/eglot e9b5e54 077/139: ETOOMANYLAMBDAS, João Távora, 2018/05/14
- [elpa] externals/eglot dda11dd 095/139: Try to fix some textDocument/completion bugs, João Távora, 2018/05/14
- [elpa] externals/eglot ea918ab 066/139: Include source info in diagnostics, João Távora, 2018/05/14
- [elpa] externals/eglot a199c8e 070/139: Honour textDocumentSync,
João Távora <=
- [elpa] externals/eglot e86f9b4 073/139: New helper eglot--sync-request, João Távora, 2018/05/14
- [elpa] externals/eglot 1add335 078/139: Workaround two suspected Emacs bugs, João Távora, 2018/05/14
- [elpa] externals/eglot 889ef20 085/139: Tweak the async request engine., João Távora, 2018/05/14
- [elpa] externals/eglot 193c57d 075/139: Half-decent xref support, João Távora, 2018/05/14
- [elpa] externals/eglot fc6879f 084/139: Explain why didOpen on after-revert-hook is a bad idea, João Távora, 2018/05/14
- [elpa] externals/eglot 24466a9 096/139: When killing server, always wait 3 seconds, João Távora, 2018/05/14
- [elpa] externals/eglot fceb6bb 090/139: Get rid of eglot--special-buffer-process, João Távora, 2018/05/14
- [elpa] externals/eglot d254f97 082/139: Solve another textDocument/didChange bug, João Távora, 2018/05/14
- [elpa] externals/eglot f257d63 089/139: * eglot.el: Reformat to shave off some lines., João Távora, 2018/05/14
- [elpa] externals/eglot c7bd095 118/139: Improve eglot-eldoc-function, João Távora, 2018/05/14