[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot c64fe76e86 03/15: Per #131: Cosmetic decisions gu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/eglot c64fe76e86 03/15: Per #131: Cosmetic decisions guaranteed to tick off someone somewhere (tm) |
Date: |
Sun, 24 Jul 2022 14:57:34 -0400 (EDT) |
branch: externals/eglot
commit c64fe76e866d6ab38bb7ff7283b766a48c116440
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Per #131: Cosmetic decisions guaranteed to tick off someone somewhere (tm)
The symbols returned by the LSP server must be converted to unique
strings if Emacs is to present them in a list. On the other hand, the
search operates on the pattern and is completely controlled by the
backend. There is not much Eglot, the LSP client, can do about this.
Decided to present the unique string to the user, even though it could
be hidden. All the manner of :annotation-function,
:affixation-function, :group-funcion etc didn't seem to add much
value.
Grouping was especially useless, since it makes sense to respect the
LSP server's account of sorting score, so that better results bubble
up to the top.
* eglot.el (xref-backend-identifier-completion-table): Uniquify
symbols with containerName and kind.
---
eglot.el | 55 ++++++++++++++++++++-----------------------------------
1 file changed, 20 insertions(+), 35 deletions(-)
diff --git a/eglot.el b/eglot.el
index eccd67c129..6d3667a84a 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2402,11 +2402,20 @@ Try to visit the target file for a richer summary line."
(cl-labels ((refresh (pat)
(mapcar
(lambda (wss)
- (eglot--dbind ((WorkspaceSymbol) name containerName)
wss
+ (eglot--dbind
+ ((WorkspaceSymbol) name containerName kind) wss
(propertize
- (concat (and (not (zerop (length containerName)))
- (format "%s::" containerName))
- name)
+ (format "%s%s %s"
+ (if (zerop (length containerName)) ""
+ (concat (propertize containerName
+ 'face 'shadow)
+ " "))
+ name
+ (propertize (alist-get
+ kind
+ eglot--symbol-kind-names
+ "Unknown")
+ 'face 'shadow))
'eglot--lsp-workspaceSymbol wss)))
(with-current-buffer buf
(jsonrpc-request (eglot--current-server-or-lose)
@@ -2417,41 +2426,17 @@ Try to visit the target file for a richer summary line."
(probe (gethash pat cache :missing)))
(if (eq probe :missing) (puthash pat (refresh pat)
cache)
probe)))
- (container (c)
- (plist-get (get-text-property
- 0 'eglot--lsp-workspaceSymbol c)
- :containerName)))
+ (score (c)
+ (cl-getf (get-text-property
+ 0 'eglot--lsp-workspaceSymbol c)
+ :score 0)))
(lambda (string _pred action)
(pcase action
(`metadata `(metadata
(cycle-sort-function
. ,(lambda (completions)
- (cl-sort completions
- #'string-lessp
- :key (lambda (c)
- (or (container c)
- "")))))
- (category . eglot-indirection-joy)
- ;; (annotation-function
- ;; . ,(lambda (c)
- ;; (plist-get (get-text-property
- ;; 0 'eglot--lsp-workspaceSymbol
c)
- ;; :containerName)))
- ;; (affixation-function
- ;; . ,(lambda (comps)
- ;; (mapcar (lambda (c)
- ;; (list c
- ;; (plist-get
(get-text-property
- ;; 0
'eglot--lsp-workspaceSymbol c)
- ;; :containerName)
- ;; " bla"))
- ;; comps)))
- (group-function
- . ,(lambda (c transformp)
- (if (not transformp)
- (container c)
- c)))
- ))
+ (cl-sort completions #'> :key #'score)))
+ (category . eglot-indirection-joy)))
(`(eglot--lsp-tryc . ,point) `(eglot--lsp-tryc . (,string .
,point)))
(`(eglot--lsp-allc . ,_point) `(eglot--lsp-allc . ,(lookup
string)))
(_ nil)))))
@@ -2475,7 +2460,7 @@ Try to visit the target file for a richer summary line."
;; passed to LSP. The reason for this particular wording is to
;; construct a readable message "No references for LSP identifier at
;; point.". See https://github.com/joaotavora/eglot/issues/314
- "LSP identifier at point.")
+ "LSP identifier at point")
(defvar eglot--lsp-xref-refs nil
"`xref' objects for overriding `xref-backend-references''s.")
- [elpa] externals/eglot updated (c558fd6a24 -> 6cc6fcc0fa), ELPA Syncer, 2022/07/24
- [elpa] externals/eglot ae7261c1fe 02/15: Per #131: Experiment with grouping in xref-backend-identifier-completion-table, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 25f6338741 04/15: Per #131: Tweak some details, fix some bugs, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 6cc6fcc0fa 15/15: Merge commit 'c558fd6a24' to fix fallout of force-push in GNU ELPA, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 33c464f658 06/15: Per #131, #314: Be more conservative with the LSP identifier guess, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 29690e88e3 13/15: Always default eglot-strict-mode to nil, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 1db95974a7 07/15: Per #967: eglot-workspace-configuration can be a function, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 87e6de3cdf 08/15: Appease byte-compiler warnings about wrong use of quotes, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot a62a388021 11/15: Fix README.md typos and rework section about Workspace configuration, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 2f71de72e3 01/15: Fix #131: Make C-u M-. work half decently, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot c64fe76e86 03/15: Per #131: Cosmetic decisions guaranteed to tick off someone somewhere (tm),
ELPA Syncer <=
- [elpa] externals/eglot a2d9e18945 09/15: Reply more reasonably to server's workspace/applyEdit, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot c962f6e5f6 12/15: Rework table of contents in README.md again, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot f62b641b5c 05/15: Per #131, #314: Guess the "LSP identifier at point", ELPA Syncer, 2022/07/24
- [elpa] externals/eglot eed9a65515 10/15: Fix embarrassing paren-matching blunder in eglot.el, ELPA Syncer, 2022/07/24
- [elpa] externals/eglot 2387026d67 14/15: Tweak bug-reporting templates yet again, ELPA Syncer, 2022/07/24