Skip to content

Commit 9bf5442

Browse files
committed
Show Metals treeview associated with current buffer filename.
Fix a bug with multiple workspaces, when closing one workspace the treeview will be closed. When a file associated with the closed workspace was open and invoking lsp-metals-treeview the other workspace's treeview would be displayed. lsp-metals-treeview now uses lsp-find-workspace with metals server-id and filename of current buffer to locate the associated workspace.
1 parent 6d61972 commit 9bf5442

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lsp-metals-treeview.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,8 @@ the current buffer."
826826
(interactive)
827827
(-if-let* ((workspace
828828
(or workspace
829-
(lsp-find-workspace lsp-metals-treeview--metals-server-id nil))))
829+
(lsp-find-workspace lsp-metals-treeview--metals-server-id
830+
(buffer-file-name)))))
830831
(lsp-metals-treeview--show-window workspace t)
831832
(message "Current buffer is not within Metals workspace")))
832833

0 commit comments

Comments
 (0)