[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa 6d96601 52/71: Closes #509: fix sorting of complet
From: |
João Távora |
Subject: |
[elpa] externals/elpa 6d96601 52/71: Closes #509: fix sorting of completion items |
Date: |
Wed, 16 Dec 2020 11:42:25 -0500 (EST) |
branch: externals/elpa
commit 6d9660152b6d86931a6b1dd25f81a354b77a5ae8
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Closes #509: fix sorting of completion items
This fixes a problem pointed out by Yuwei Tian <ibluefocus@gmail.com>.
* eglot.el (eglot-completion-at-point): Fix getting :sortText content
of the completion item.
---
eglot.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/eglot.el b/eglot.el
index 3e9c964..87fd9c8 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2053,12 +2053,15 @@ is not active."
;; Commit logs for this function help understand what's going on.
(when-let (completion-capability (eglot--server-capable :completionProvider))
(let* ((server (eglot--current-server-or-lose))
- (sort-completions (lambda (completions)
- (sort completions
- (lambda (a b)
- (string-lessp
- (or (get-text-property 0 :sortText a)
"")
- (or (get-text-property 0 :sortText b)
""))))))
+ (sort-completions
+ (lambda (completions)
+ (cl-sort completions
+ #'string-lessp
+ :key (lambda (c)
+ (or (plist-get
+ (get-text-property 0 'eglot--lsp-item c)
+ :sortText)
+ "")))))
(metadata `(metadata . ((display-sort-function .
,sort-completions))))
resp items (cached-proxies :none)
(proxies
- [elpa] externals/elpa ffe79b9 34/71: Pin pyls to 0.31.10, (continued)
- [elpa] externals/elpa ffe79b9 34/71: Pin pyls to 0.31.10, João Távora, 2020/12/16
- [elpa] externals/elpa b0bfbfb 38/71: Fix #488: fix type error in eglot--xref-make-match, João Távora, 2020/12/16
- [elpa] externals/elpa 3634402 36/71: Fix #479: correctly place diagnostics in narrowed buffers, João Távora, 2020/12/16
- [elpa] externals/elpa e7a43e2 40/71: Fix #480: also consider label of a CompletionItem for snippets, João Távora, 2020/12/16
- [elpa] externals/elpa a807b4f 43/71: Some test-related cleanup, João Távora, 2020/12/16
- [elpa] externals/elpa 9874456 42/71: Close #482: use filter-buffer-substring to get buffer text, João Távora, 2020/12/16
- [elpa] externals/elpa b34447c 45/71: Close #473: simplify eglot-code-actions, João Távora, 2020/12/16
- [elpa] externals/elpa a044dec 47/71: Delegate "hover" and "signature" doc synchronization efforts to Eldoc, João Távora, 2020/12/16
- [elpa] externals/elpa a04b826 48/71: Update tests after update to newer Eldoc, João Távora, 2020/12/16
- [elpa] externals/elpa 2b7ec0e 51/71: Expect eglot-multiline-eldoc to fail on Travis, João Távora, 2020/12/16
- [elpa] externals/elpa 6d96601 52/71: Closes #509: fix sorting of completion items,
João Távora <=
- [elpa] externals/elpa 4e82f53 53/71: Reload Eldoc if needed on Emacs < 28, João Távora, 2020/12/16
- [elpa] externals/elpa 8c9219d 55/71: Unbreak tests after changes to eldoc.el, João Távora, 2020/12/16
- [elpa] externals/elpa ea82b4b 57/71: Close #505: ensure completion terminates in correct buffer, João Távora, 2020/12/16
- [elpa] externals/elpa fb6b17e 58/71: New 'make interactive' target for debuggable M-x ert, João Távora, 2020/12/16
- [elpa] externals/elpa 5f873d2 60/71: Fix #521: Correct paren mismatch blunder introduced by earlier commit, João Távora, 2020/12/16
- [elpa] externals/elpa 209b227 61/71: Fix #524: provide suitable default to M-x eglot-rename, João Távora, 2020/12/16
- [elpa] externals/elpa 61b71ea 62/71: Fix #528: unbreak Haskell's hie-wrapper built-in incantation, João Távora, 2020/12/16
- [elpa] externals/elpa af0e876 68/71: Close #572: use haskell-language-server in eglot-server-programs, João Távora, 2020/12/16
- [elpa] externals/elpa 476c586 69/71: Cosmetic whitespace fix (indentation, long lines, tabs->spaces), João Távora, 2020/12/16
- [elpa] externals/elpa 265b486 70/71: Fix #569: allow Eglot to stay out of Xref configuration, João Távora, 2020/12/16