Skip to content

Commit 0a2a1e3

Browse files
committed
Don't abuse `ivy-configure' + display-transformer
Fixes #18.
1 parent 20cac62 commit 0a2a1e3

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

lsp-ivy.el

+3-15
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,7 @@
118118
(cons string face)
119119
(cons string face)))
120120

121-
(eval-when-compile
122-
(lsp-interface
123-
(lsp-ivy:FormattedSymbolInformation
124-
(:kind :name :location :textualRepresentation)
125-
(:containerName :deprecated))))
126-
127-
(lsp-defun lsp-ivy--workspace-symbol-action
121+
(lsp-defun lsp-ivy--workspace-goto-symbol
128122
((&SymbolInformation
129123
:location (&Location :uri :range (&Range :start (&Position :line :character)))))
130124
"Jump to selected candidate."
@@ -156,8 +150,7 @@ FILTER-REGEXPS?, otherwise convert it to an `lsp-ivy:FormattedSymbolInformation'
156150
(let ((textual-representation
157151
(lsp-ivy--format-symbol-match symbol-information workspace-root)))
158152
(when (--all? (string-match-p it textual-representation) filter-regexps?)
159-
(lsp-put symbol-information :textualRepresentation textual-representation)
160-
symbol-information))))
153+
(cons textual-representation symbol-information)))))
161154

162155
(defun lsp-ivy--workspace-symbol (workspaces prompt initial-input)
163156
"Search against WORKSPACES with PROMPT and INITIAL-INPUT."
@@ -194,14 +187,9 @@ FILTER-REGEXPS?, otherwise convert it to an `lsp-ivy:FormattedSymbolInformation'
194187
:dynamic-collection t
195188
:require-match t
196189
:initial-input initial-input
197-
:action #'lsp-ivy--workspace-symbol-action
190+
:action (lambda (c) (lsp-ivy--workspace-goto-symbol (cdr c)))
198191
:caller 'lsp-ivy-workspace-symbol)))
199192

200-
(ivy-configure 'lsp-ivy-workspace-symbol
201-
:display-transformer-fn
202-
(-lambda ((&lsp-ivy:FormattedSymbolInformation :textual-representation))
203-
textual-representation))
204-
205193
;;;###autoload
206194
(defun lsp-ivy-workspace-symbol (arg)
207195
"`ivy' for lsp workspace/symbol.

0 commit comments

Comments
 (0)