@@ -6182,6 +6182,13 @@ deserialization.")
6182
6182
(defvar-local lsp--line-col-to-point-hash-table nil
6183
6183
"Hash table with keys (line . col) and values that are either point positions or markers.")
6184
6184
6185
+ (defcustom lsp-imenu-detailed-outline t
6186
+ "Whether `lsp-imenu' should include signatures.
6187
+ This will be ignored if the server doesn't provide the necessary
6188
+ information, for example if it doesn't support DocumentSymbols."
6189
+ :group 'lsp-imenu
6190
+ :type 'boolean)
6191
+
6185
6192
(lsp-defun lsp--symbol-to-imenu-elem ((sym &as &SymbolInformation :name :container-name?))
6186
6193
"Convert SYM to imenu element.
6187
6194
@@ -6195,7 +6202,7 @@ Return a cons cell (full-name . start-point)."
6195
6202
name)
6196
6203
start-point)))
6197
6204
6198
- (lsp-defun lsp--symbol-to-hierarchical-imenu-elem ((sym &as &DocumentSymbol :name :children?))
6205
+ (lsp-defun lsp--symbol-to-hierarchical-imenu-elem ((sym &as &DocumentSymbol :name :detail? : children?))
6199
6206
"Convert SYM to hierarchical imenu elements.
6200
6207
6201
6208
SYM is a DocumentSymbol message.
@@ -6206,12 +6213,13 @@ an alist
6206
6213
6207
6214
(\"symbol-name\" . ((\"(symbol-kind)\" . start-point)
6208
6215
cons-cells-from-children))"
6209
- (let ((filtered-children (lsp--imenu-filter-symbols children?)))
6216
+ (let ((filtered-children (lsp--imenu-filter-symbols children?))
6217
+ (signature (or (and lsp-imenu-detailed-outline detail?) name)))
6210
6218
(if (seq-empty-p filtered-children)
6211
- (cons name
6219
+ (cons signature
6212
6220
(ht-get lsp--line-col-to-point-hash-table
6213
6221
(lsp--get-line-and-col sym)))
6214
- (cons name
6222
+ (cons signature
6215
6223
(lsp--imenu-create-hierarchical-index filtered-children)))))
6216
6224
6217
6225
(lsp-defun lsp--symbol-ignore ((&SymbolInformation :kind :location))
0 commit comments