Skip to content

Commit a06a5be

Browse files
authored
Merge pull request #13 from dsyzling/metals-treeview
Scala Metals Treeview
2 parents 76c304d + e6f7ad1 commit a06a5be

File tree

13 files changed

+925
-0
lines changed

13 files changed

+925
-0
lines changed

README.org

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
- [[#lsp-treemacs-deps-list][lsp-treemacs-deps-list]]
1010
- [[#commands-1][Commands]]
1111
- [[#screenshot-2][Screenshot]]
12+
- [[#lsp-metals-treeview][lsp-metals-treeview]]
13+
- [[#commands-2][Commands]]
14+
- [[#screenshot-3][Screenshot]]
1215

1316
* Summary
1417
Integration between ~lsp-mode~ and ~treemacs~ .
@@ -31,3 +34,50 @@
3134
- ~lsp-treemacs-java-deps-refresh~ - refresh the view. Bound to ~r~.
3235
*** Screenshot
3336
[[file:screenshots/dependencies.gif]]
37+
** lsp-metals-treeview
38+
Support for Scala Metals treeview. The treeview is disabled by default in order
39+
to enable the treeview use one of the following configuration approaches.
40+
If you are using use-package:
41+
#+BEGIN_SRC elisp
42+
43+
(use-package lsp-treemacs
44+
:config
45+
(lsp-metals-treeview-enable t)
46+
(setq lsp-metals-treeview-show-when-views-received t))
47+
48+
#+END_SRC
49+
50+
lsp-metals-treeview-show-when-views-received when true will automatically
51+
display the treeview when Metals has initialised the project and sent the
52+
initial top level treeview information. If you wish to keep the tree hidden and
53+
show it explicitly via a command or a bound key leave the variable false
54+
(default) and show the treeview using M-x lsp-metals-treeview.
55+
56+
Alternatively if you're not using use-package:
57+
58+
#+BEGIN_SRC elisp
59+
60+
(require 'lsp-metals-treeview)
61+
(lsp-metals-treeview-enable t)
62+
(setq lsp-metals-treeview-show-when-views-received t)
63+
64+
#+END_SRC
65+
66+
The metals can be displayed at anytime by using M-x lsp-metals-treeview.
67+
68+
To enable logging of metals treeview actions/responses use the variable
69+
lsp-metals-treeview-logging (boolean). All messages will be logged to the lsp
70+
logging buffer.
71+
72+
*** Commands
73+
q - when the treeview has focus it can be hidden using the q key. To show the
74+
tree use M-x lsp-metals-treeview or bind this function to a key.
75+
76+
lsp-shutdown-workspace will automatically close the treeview associated with the
77+
current file buffer.
78+
79+
When switching files the treeview will switch to the treeview associated with
80+
the new workspace.
81+
82+
*** Screenshot
83+
[[file:screenshots/metals-treeview.gif]]

icons/metals/class.png

824 Bytes
Loading

icons/metals/enum.png

730 Bytes
Loading

icons/metals/field.png

704 Bytes
Loading

icons/metals/interface.png

615 Bytes
Loading

icons/metals/logo.png

6.8 KB
Loading

icons/metals/method.png

827 Bytes
Loading

icons/metals/object.png

895 Bytes
Loading

icons/metals/trait.png

668 Bytes
Loading

icons/metals/val.png

844 Bytes
Loading

icons/metals/var.png

839 Bytes
Loading

0 commit comments

Comments
 (0)