Skip to content

Commit

Permalink
Per #131: Experiment with some grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
joaotavora committed Jul 14, 2022
1 parent 1490dfa commit 3bbc0cd
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -2412,11 +2412,21 @@ Try to visit the target file for a richer summary line."
(lookup (pat) ;; check cache, else refresh
(let ((probe (gethash pat cache :missing)))
(if (eq probe :missing) (puthash pat (refresh pat) cache)
probe))))
probe)))
(container (c)
(plist-get (get-text-property
0 'eglot--lsp-workspaceSymbol c)
:containerName)))
(lambda (string _pred action)
(pcase action
(`metadata `(metadata
(display-sort-function . identity)
(cycle-sort-function
. ,(lambda (completions)
(cl-sort completions
#'string-lessp
:key (lambda (c)
(or (container c)
"")))))
(category . eglot-indirection-joy)
;; (annotation-function
;; . ,(lambda (c)
Expand All @@ -2432,13 +2442,11 @@ Try to visit the target file for a richer summary line."
;; :containerName)
;; " bla"))
;; comps)))
;; (group-function
;; . ,(lambda (c transformp)
;; (if (not transformp)
;; (plist-get (get-text-property
;; 0 'eglot--lsp-workspaceSymbol c)
;; :containerName)
;; c)))
(group-function
. ,(lambda (c transformp)
(if (not transformp)
(container c)
c)))
))
(`(eglot--lsp-tryc . ,point) `(eglot--lsp-tryc . (,string . ,point)))
(`(eglot--lsp-allc . ,_point) `(eglot--lsp-allc . ,(lookup string)))
Expand Down

0 comments on commit 3bbc0cd

Please sign in to comment.