|
612 | 612 | (add-to-list 'winum-ignored-buffers "*LSP Error List*")
|
613 | 613 | (add-to-list 'winum-ignored-buffers lsp-treemacs-deps-buffer-name)))
|
614 | 614 |
|
615 |
| -(defun lsp-treemacs--expand (root-key depth) |
| 615 | +(defun lsp-treemacs--expand (root-key) |
616 | 616 | (-when-let (root (treemacs-dom-node->position (treemacs-find-in-dom root-key)))
|
617 | 617 | (treemacs-save-position
|
618 |
| - (lsp-treemacs--expand-recursively root depth)))) |
| 618 | + (lsp-treemacs--expand-recursively root)))) |
619 | 619 |
|
620 | 620 | (defun lsp-treemacs--kill-symbols-buffer ()
|
621 | 621 | (and lsp-treemacs--symbols-timer (cancel-timer lsp-treemacs--symbols-timer)))
|
|
637 | 637 | (add-hook 'kill-buffer-hook 'lsp-treemacs--kill-symbols-buffer nil t)))
|
638 | 638 | (with-current-buffer original-buffer (lsp-treemacs--update))))
|
639 | 639 |
|
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)))) |
650 | 649 |
|
651 | 650 |
|
652 | 651 | (defmacro lsp-treemacs-deps-with-jdtls (&rest body)
|
|
1160 | 1159 | ,@body)
|
1161 | 1160 | (treemacs-pulse-on-failure "No node at point"))))
|
1162 | 1161 |
|
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) |
1164 | 1163 | (let ((search-buffer (get-buffer-create (or buffer-name "*LSP Lookup*"))))
|
1165 | 1164 | (with-current-buffer search-buffer
|
1166 | 1165 | (lsp-treemacs-initialize)
|
|
1171 | 1170 | (setq-local face-remapping-alist '((button . default)))
|
1172 | 1171 | (lsp-treemacs--set-mode-line-format search-buffer title)
|
1173 | 1172 | (lsp-treemacs-generic-refresh)
|
1174 |
| - (lsp-treemacs--expand 'LSP-Generic expand-depth) |
| 1173 | + (when expand? (lsp-treemacs--expand 'LSP-Generic)) |
1175 | 1174 | (current-buffer))))
|
1176 | 1175 |
|
1177 | 1176 | (defalias 'lsp-treemacs--show-references 'lsp-treemacs-render)
|
|
0 commit comments