Skip to content

Commit 95e4850

Browse files
committed
Make sure treeview requests are sent only to metals.
Without this check they can be send to add-on servers which is wrong.
1 parent 7275207 commit 95e4850

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lsp-metals-treeview.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@
5656
(require 'lsp-treemacs)
5757
(require 'lsp-metals-protocol)
5858

59+
(dolist (method '("metals/treeViewChildren"
60+
"metals/treeViewVisibilityDidChange"
61+
"metals/treeViewNodeCollapseDidChange"
62+
"metals/treeViewReveal"))
63+
(add-to-list 'lsp-method-requirements
64+
`(,method :check-command (lambda (workspace)
65+
(eq (lsp--workspace-server-id workspace) 'metals)))
66+
t))
67+
5968
(defcustom lsp-metals-treeview-logging nil
6069
"If non nil log treeview trace/debug messages to the `lsp-log' for debugging."
6170
:group 'lsp-metals-treeview

0 commit comments

Comments
 (0)