[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same po
From: |
Stefan Monnier |
Subject: |
[elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same position in the correct order |
Date: |
Sat, 29 Sep 2018 17:13:34 -0400 (EDT) |
branch: externals/eglot
commit c25c0e3db707ed7fbf27a8a6b4013789ee2119e6
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Close #64: handle edits to same position in the correct order
In eglot--apply-text-edits, the markers returned by
eglot--lsp-position-to-point are of the "stay" type, i.e. have an
insertion-type of nil. This causes multiple insertion edits to the
same location to happen in the reverse order in which they appear in
the LSP message, which is a violation of the spec and a bug.
There are more ways to solve this (see related discuttion in
https://github.com/joaotavora/eglot/pull/64), but the easiest way is
to revert the order in which the edits are processed. This is because
the spec tells us that the order is only relevant in precisely this
"same position" case. So if we reverse the order we fix this bug and
don't break anything else.
* eglot.el (eglot--apply-text-edits): Apply edits in reverse..
---
eglot.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eglot.el b/eglot.el
index eeea104..427fa29 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1555,7 +1555,7 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(progress-reporter-update reporter (cl-incf done)))))))
(mapcar (jsonrpc-lambda (&key range newText)
(cons newText (eglot--range-region range 'markers)))
- edits))
+ (reverse edits)))
(undo-amalgamate-change-group change-group)
(progress-reporter-done reporter))))
- [elpa] externals/eglot 792dc6b 28/62: * eglot.el (advice-add jsonrpc-request): Add &allow-other-keys, (continued)
- [elpa] externals/eglot 792dc6b 28/62: * eglot.el (advice-add jsonrpc-request): Add &allow-other-keys, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 21886be 08/62: Close #44: Robustify in the face of manual mode changes, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6b14711 18/62: * eglot.el (eglot-client-capabilities): Fix a typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 4c019bd 24/62: * eglot.el (eglot-initialization-options): Fix spurious typo., Stefan Monnier, 2018/09/29
- [elpa] externals/eglot a62c2da 25/62: Close #60: Notify server of recent changes before save notification, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8191b2 32/62: Improve eglot-execute-command API to ease overriding by servers, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 991d129 34/62: * README.md (Build Status): Show status for master, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot ae37c2a 35/62: Add a test for eglot-ensure. Make, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot cac728a 33/62: Kill server's output and events buffers from eglot-shutdown (#66), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 9ae03af 39/62: Close #41: Control the size of the events buffer, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c25c0e3 40/62: Close #64: handle edits to same position in the correct order,
Stefan Monnier <=
- [elpa] externals/eglot 6874895 42/62: Close #73: Prompt for server in interactive eglot-shutdown, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot dc26745 38/62: Update README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot e05360a 50/62: Actually add snippet example gif referenced in README.md, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot c8cccee 52/62: Ignore extra keys in textDocument/publishDiagnostics (#81), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 6f1d64c 59/62: Close #100: Don't send other notifications before initialized, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot f482c3e 60/62: Close #115: Don't block kill-buffer-hook if server somehow hangs, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 821b498 62/62: Correctly map DocumentSymbol's :kind to its name (#121), Stefan Monnier, 2018/09/29
- [elpa] externals/eglot bd6304d 57/62: Fix serious breakage introduced by #93, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot 8e1a91b 31/62: Add a generic eglot-execute-command API, Stefan Monnier, 2018/09/29
- [elpa] externals/eglot d5167ea 29/62: Minor fixes to test infrastructure, Stefan Monnier, 2018/09/29