Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -6199,17 +6199,27 @@ the signature)."
(if deprecated? (propertize base 'face 'lsp-face-semhl-deprecated)
base)))

(lsp-defun lsp--symbol-to-imenu-elem ((sym &as &SymbolInformation :name :container-name?))
(lsp-defun lsp-render-symbol-information ((&SymbolInformation :name :deprecated? :container-name?)
separator)
"Render a piece of SymbolInformation.
Handle :deprecated?. If SEPARATOR is non-nil, the
symbol's (optional) parent, SEPARATOR and the symbol itself are
concatenated."
(when (and separator container-name? (not (string-empty-p container-name?)))
(setq name (concat name separator container-name?)))
(if deprecated? (propertize name 'face 'lsp-face-semhl-deprecated) name))

(defun lsp--symbol-to-imenu-elem (sym)
"Convert SYM to imenu element.

SYM is a SymbolInformation message.

Return a cons cell (full-name . start-point)."
(let ((start-point (ht-get lsp--line-col-to-point-hash-table
(lsp--get-line-and-col sym))))
(cons (if (and lsp-imenu-show-container-name container-name?)
(concat container-name? lsp-imenu-container-name-separator name)
name)
(cons (lsp-render-symbol-information
sym (and lsp-imenu-show-container-name
lsp-imenu-container-name-separator))
start-point)))

(lsp-defun lsp--symbol-to-hierarchical-imenu-elem ((sym &as &DocumentSymbol :children?))
Expand Down