Skip to content

Commit 176694b

Browse files
committed
Use lsp-ivy-show-symbol-kind
1 parent 25d4421 commit 176694b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lsp-ivy.el

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
(require 'ivy)
3636
(require 'dash)
3737
(require 'lsp-mode)
38+
3839
(defgroup lsp-ivy nil
3940
"LSP support for ivy-based symbol completion"
4041
:group 'lsp-mode)
4142

4243
(defcustom lsp-ivy-show-symbol-kind
43-
nil
44+
t
4445
"Whether to show the symbol's kind when showing lsp symbols"
4546
:group 'lsp-ivy
4647
:type 'boolean)
@@ -116,10 +117,12 @@
116117
(let* ((container-name (gethash "containerName" match))
117118
(name (gethash "name" match))
118119
(type (elt lsp-ivy-symbol-kind-to-string (gethash "kind" match) ))
119-
(typestr (propertize (format "[%s]" (car type)) 'face `(:foreground ,(cdr type)))))
120-
(if (or (null container-name) (string-empty-p container-name))
121-
(format "%s %s" typestr name)
122-
(format "%s %s.%s" typestr container-name name))))
120+
(typestr (if lsp-ivy-show-symbol-kind
121+
(propertize (format "[%s] " (car type)) 'face `(:foreground ,(cdr type)))
122+
"")))
123+
(concat typestr (if (or (null container-name) (string-empty-p container-name))
124+
(format "%s" name)
125+
(format "%s.%s" container-name name)))))
123126

124127
(defun lsp-ivy--workspace-symbol-action (candidate)
125128
"Jump to selected CANDIDATE."

0 commit comments

Comments
 (0)