Skip to content

Commit 378ac0b

Browse files
authored
Merge pull request #43 from emacs-lsp/revert-42-master
Revert "Added depth argument to lsp-treemacs--expand"
2 parents 518fd84 + 7103e60 commit 378ac0b

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

lsp-treemacs.el

+13-14
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,10 @@
612612
(add-to-list 'winum-ignored-buffers "*LSP Error List*")
613613
(add-to-list 'winum-ignored-buffers lsp-treemacs-deps-buffer-name)))
614614

615-
(defun lsp-treemacs--expand (root-key depth)
615+
(defun lsp-treemacs--expand (root-key)
616616
(-when-let (root (treemacs-dom-node->position (treemacs-find-in-dom root-key)))
617617
(treemacs-save-position
618-
(lsp-treemacs--expand-recursively root depth))))
618+
(lsp-treemacs--expand-recursively root))))
619619

620620
(defun lsp-treemacs--kill-symbols-buffer ()
621621
(and lsp-treemacs--symbols-timer (cancel-timer lsp-treemacs--symbols-timer)))
@@ -637,16 +637,15 @@
637637
(add-hook 'kill-buffer-hook 'lsp-treemacs--kill-symbols-buffer nil t)))
638638
(with-current-buffer original-buffer (lsp-treemacs--update))))
639639

640-
(defun lsp-treemacs--expand-recursively (root depth)
641-
(when (if (booleanp depth) depth (not (zerop depth)))
642-
(save-excursion
643-
(-map
644-
(lambda (btn)
645-
(unless (treemacs-is-node-expanded? btn)
646-
(goto-char (marker-position btn))
647-
(funcall (alist-get (treemacs-button-get btn :state) treemacs-TAB-actions-config)))
648-
(lsp-treemacs--expand-recursively btn (if (booleanp depth) depth (1- depth))))
649-
(treemacs--get-children-of root)))))
640+
(defun lsp-treemacs--expand-recursively (root)
641+
(save-excursion
642+
(-map
643+
(lambda (btn)
644+
(unless (treemacs-is-node-expanded? btn)
645+
(goto-char (marker-position btn))
646+
(funcall (alist-get (treemacs-button-get btn :state) treemacs-TAB-actions-config)))
647+
(lsp-treemacs--expand-recursively btn))
648+
(treemacs--get-children-of root))))
650649

651650

652651
(defmacro lsp-treemacs-deps-with-jdtls (&rest body)
@@ -1160,7 +1159,7 @@
11601159
,@body)
11611160
(treemacs-pulse-on-failure "No node at point"))))
11621161

1163-
(defun lsp-treemacs-render (tree title expand-depth &optional buffer-name right-click-actions)
1162+
(defun lsp-treemacs-render (tree title expand? &optional buffer-name right-click-actions)
11641163
(let ((search-buffer (get-buffer-create (or buffer-name "*LSP Lookup*"))))
11651164
(with-current-buffer search-buffer
11661165
(lsp-treemacs-initialize)
@@ -1171,7 +1170,7 @@
11711170
(setq-local face-remapping-alist '((button . default)))
11721171
(lsp-treemacs--set-mode-line-format search-buffer title)
11731172
(lsp-treemacs-generic-refresh)
1174-
(lsp-treemacs--expand 'LSP-Generic expand-depth)
1173+
(when expand? (lsp-treemacs--expand 'LSP-Generic))
11751174
(current-buffer))))
11761175

11771176
(defalias 'lsp-treemacs--show-references 'lsp-treemacs-render)

0 commit comments

Comments
 (0)