Skip to content

Commit

Permalink
custom variables for expand depth
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantonio committed Nov 6, 2022
1 parent 2894e6d commit a0eaed7
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions lsp-treemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,26 @@ Fallback to list all workspaces if no project root is found."
:type 'boolean
:group 'lsp-treemacs)

(defcustom lsp-treemacs-error-list-expand-depth 3
"Automatic expansion depth for `lsp-treemacs-error-list'"
:type 'number
:group 'lsp-treemacs)

(defcustom lsp-treemacs-call-hierarchy-expand-depth 2
"Automatic expansion depth for `lsp-treemacs-call-hierarchy'"
:type 'number
:group 'lsp-treemacs)

(defcustom lsp-treemacs-type-hierarchy-expand-depth 3
"Automatic expansion depth for `lsp-treemacs-type-hierarchy'"
:type 'number
:group 'lsp-treemacs)

(defcustom lsp-treemacs-java-deps-list-expand-depth 2
"Automatic expansion depth for `lsp-treemacs-java-deps-list'"
:type 'number
:group 'lsp-treemacs)

(defun lsp-treemacs--open-file-in-mru (file)
(select-window (get-mru-window (selected-frame) nil :not-selected))
(find-file file))
Expand Down Expand Up @@ -482,7 +502,7 @@ will be rendered an empty line between them."
(display-buffer-in-side-window
(lsp-treemacs-render
(-map 'lsp-treemacs-deps--process-dep (lsp-treemacs-deps--root-folders))
"*Java Deps*" nil)
"*Java Deps*" lsp-treemacs-java-deps-list-expand-depth)
lsp-treemacs-deps-position-params)))

(defun lsp-treemacs--deps-find-children-for-key (node key)
Expand Down Expand Up @@ -823,7 +843,7 @@ With a prefix argument, show the outgoing call hierarchy."
(lsp-request "textDocument/prepareCallHierarchy"
(lsp--text-document-position-params)))
(concat (if outgoing "Outgoing" "Incoming") " Call Hierarchy")
nil "*Call Hierarchy*" nil t) nil))))
lsp-treemacs-call-hierarchy-expand-depth "*Call Hierarchy*" nil t) nil))))



Expand Down Expand Up @@ -894,7 +914,7 @@ With prefix 2 show both."
((eq lsp-treemacs--hierarchy-super direction) "Super")
((eq lsp-treemacs--hierarchy-both direction) "Sub/Super"))
" Type Hierarchy")
nil
lsp-treemacs-type-hierarchy-expand-depth
"*lsp-treemacs-call-hierarchy*"))
(user-error "No class under point."))
(setq lsp--buffer-workspaces workspaces)))
Expand Down Expand Up @@ -1029,7 +1049,7 @@ With prefix 2 show both."
(lsp-session-folders)
(-keep #'lsp-treemacs--build-error-list)))
"Errors List"
nil
lsp-treemacs-error-list-expand-depth
lsp-treemacs-errors-buffer-name
`(["Cycle Severity" lsp-treemacs-cycle-severity])))

Expand Down

0 comments on commit a0eaed7

Please sign in to comment.