|
909 | 909 | (symbol-name (read (url-unhex-string jar-file ))))) |
910 | 910 |
|
911 | 911 | (defvar-local lsp-treemacs-tree nil) |
| 912 | +(defvar-local lsp-treemacs--right-click-actions nil) |
912 | 913 |
|
913 | 914 | (defun lsp-treemacs-perform-ret-action (&rest _) |
914 | 915 | (interactive) |
|
1102 | 1103 | (run-with-idle-timer |
1103 | 1104 | 0.001 nil |
1104 | 1105 | (lambda () |
1105 | | - (-when-let* ((actions (-some-> (treemacs-node-at-point) |
1106 | | - (button-get :item) |
1107 | | - (plist-get :actions))) |
| 1106 | + (-when-let* ((actions (if-let (node (treemacs-node-at-point)) |
| 1107 | + (plist-get (button-get node :item) :actions) |
| 1108 | + lsp-treemacs--right-click-actions)) |
1108 | 1109 | (menu (easy-menu-create-menu nil actions)) |
1109 | 1110 | (choice (x-popup-menu event menu))) |
1110 | 1111 | (when choice (call-interactively (lookup-key menu (apply 'vector choice)))) |
|
1147 | 1148 | (interactive) |
1148 | 1149 | (lsp-treemacs--open-file-in-mru path))))))) |
1149 | 1150 |
|
1150 | | -(defun lsp-treemacs-render (tree title expand? &optional buffer-name) |
| 1151 | +(defun lsp-treemacs-render (tree title expand? &optional buffer-name right-click-actions) |
1151 | 1152 | (let ((search-buffer (get-buffer-create (or buffer-name "*LSP Lookup*")))) |
1152 | 1153 | (with-current-buffer search-buffer |
1153 | 1154 | (lsp-treemacs-initialize) |
1154 | 1155 | (setq-local treemacs-default-visit-action 'treemacs-RET-action) |
| 1156 | + (setq-local lsp-treemacs--right-click-actions right-click-actions) |
1155 | 1157 | (setq-local lsp-treemacs--generic-cache (or lsp-treemacs--generic-cache (ht))) |
1156 | 1158 | (setq-local lsp-treemacs-tree tree) |
1157 | 1159 | (setq-local face-remapping-alist '((button . default))) |
@@ -1188,8 +1190,8 @@ depending on if a custom mode line is detected." |
1188 | 1190 | (lsp-with-cached-filetrue-name |
1189 | 1191 | (let ((lsp-file-truename-cache (ht))) |
1190 | 1192 | (lsp-treemacs-render (lsp-treemacs--handle-references refs) |
1191 | | - (format title (length refs)) |
1192 | | - expand?))) |
| 1193 | + (format title (length refs)) |
| 1194 | + expand?))) |
1193 | 1195 | (lsp--info "Refresh completed!")) |
1194 | 1196 | :mode 'detached |
1195 | 1197 | :cancel-token :treemacs-lookup) |
|
0 commit comments