Skip to content

Commit f760681

Browse files
authored
Merge pull request #148 from marcantonio/expand-depth-custom
2 parents ef302ec + d0c3e8d commit f760681

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

lsp-treemacs.el

+24-4
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,26 @@ Fallback to list all workspaces if no project root is found."
124124
:type 'boolean
125125
:group 'lsp-treemacs)
126126

127+
(defcustom lsp-treemacs-error-list-expand-depth nil
128+
"Automatic expansion depth for `lsp-treemacs-error-list'"
129+
:type 'number
130+
:group 'lsp-treemacs)
131+
132+
(defcustom lsp-treemacs-call-hierarchy-expand-depth nil
133+
"Automatic expansion depth for `lsp-treemacs-call-hierarchy'"
134+
:type 'number
135+
:group 'lsp-treemacs)
136+
137+
(defcustom lsp-treemacs-type-hierarchy-expand-depth nil
138+
"Automatic expansion depth for `lsp-treemacs-type-hierarchy'"
139+
:type 'number
140+
:group 'lsp-treemacs)
141+
142+
(defcustom lsp-treemacs-java-deps-list-expand-depth nil
143+
"Automatic expansion depth for `lsp-treemacs-java-deps-list'"
144+
:type 'number
145+
:group 'lsp-treemacs)
146+
127147
(defun lsp-treemacs--open-file-in-mru (file)
128148
(select-window (get-mru-window (selected-frame) nil :not-selected))
129149
(find-file file))
@@ -482,7 +502,7 @@ will be rendered an empty line between them."
482502
(display-buffer-in-side-window
483503
(lsp-treemacs-render
484504
(-map 'lsp-treemacs-deps--process-dep (lsp-treemacs-deps--root-folders))
485-
"*Java Deps*" nil)
505+
"*Java Deps*" lsp-treemacs-java-deps-list-expand-depth)
486506
lsp-treemacs-deps-position-params)))
487507

488508
(defun lsp-treemacs--deps-find-children-for-key (node key)
@@ -816,7 +836,7 @@ With a prefix argument, show the outgoing call hierarchy."
816836
(lsp-request "textDocument/prepareCallHierarchy"
817837
(lsp--text-document-position-params)))
818838
(concat (if outgoing "Outgoing" "Incoming") " Call Hierarchy")
819-
nil "*Call Hierarchy*" nil t) nil))))
839+
lsp-treemacs-call-hierarchy-expand-depth "*Call Hierarchy*" nil t) nil))))
820840

821841

822842

@@ -887,7 +907,7 @@ With prefix 2 show both."
887907
((eq lsp-treemacs--hierarchy-super direction) "Super")
888908
((eq lsp-treemacs--hierarchy-both direction) "Sub/Super"))
889909
" Type Hierarchy")
890-
nil
910+
lsp-treemacs-type-hierarchy-expand-depth
891911
"*lsp-treemacs-call-hierarchy*"))
892912
(user-error "No class under point."))
893913
(setq lsp--buffer-workspaces workspaces)))
@@ -1022,7 +1042,7 @@ With prefix 2 show both."
10221042
(lsp-session-folders)
10231043
(-keep #'lsp-treemacs--build-error-list)))
10241044
"Errors List"
1025-
nil
1045+
lsp-treemacs-error-list-expand-depth
10261046
lsp-treemacs-errors-buffer-name
10271047
`(["Cycle Severity" lsp-treemacs-cycle-severity])))
10281048

0 commit comments

Comments
 (0)