Skip to content

Commit 06e3cbd

Browse files
committed
Don't abuse `ivy-configure' + display-transformer
Fixes #18.
1 parent c70ee8b commit 06e3cbd

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

lsp-ivy.el

Lines changed: 6 additions & 14 deletions
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--goto-symbol
128122
((&SymbolInformation
129123
:location (&Location :uri :range (&Range :start (&Position :line :character)))))
130124
"Jump to selected candidate."
@@ -155,8 +149,11 @@ FILTER-REGEXPS?, otherwise convert it to an `lsp-ivy:FormattedSymbolInformation'
155149
(let ((textual-representation
156150
(lsp-ivy--format-symbol-match symbol-information workspace-root)))
157151
(when (--all? (string-match-p it textual-representation) filter-regexps?)
158-
(lsp-put symbol-information :textualRepresentation textual-representation)
159-
symbol-information))))
152+
(cons textual-representation symbol-information)))))
153+
154+
(lsp-defun lsp-ivy--workspace-symbol-action ((_ . sym))
155+
"Jump to the `cdr' of INPUT0, an `&SymbolInformation'."
156+
(lsp-ivy--goto-symbol sym))
160157

161158
(defun lsp-ivy--workspace-symbol (workspaces prompt initial-input)
162159
"Search against WORKSPACES with PROMPT and INITIAL-INPUT."
@@ -196,11 +193,6 @@ FILTER-REGEXPS?, otherwise convert it to an `lsp-ivy:FormattedSymbolInformation'
196193
:action #'lsp-ivy--workspace-symbol-action
197194
:caller 'lsp-ivy-workspace-symbol)))
198195

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

0 commit comments

Comments
 (0)