You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/ide.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,36 @@ IDE support for sources managed by the Scala CLI is experimental, and limited to
8
8
Code](https://scalameta.org/metals/docs/editors/vscode) or
9
9
[Neovim](https://github.com/scalameta/nvim-metals) for now.
10
10
11
-
## VSCode
11
+
Two kind of support co-exist for VSCode:
12
+
-[one relying purely on BSP](#vscode-bsp), with no automatic reload upon adding new dependencies for now.
13
+
-[one relying on a custom Metals server](#vscode-custom-metals-server), featuring an import right from VSCode, and having automatic reload support upon adding new dependencies,
14
+
15
+
## VSCode (BSP)
16
+
17
+
This Scala CLI support should work with any recent version of Metals. In order to
18
+
open a Scala CLI project in Metals, run the `setup-ide` command first:
19
+
```text
20
+
scala-cli setup-ide .
21
+
```
22
+
(replace `.` with another set of inputs if these are different.) This should create
23
+
a file named `.bsp/scala-cli.json`.
24
+
25
+
Then open the directory where you ran the `setup-ide` command in VSCode. Provided
26
+
the current directory doesn't also contain an sbt or Mill project, the Scala CLI
27
+
project should be automatically detected by Metals, and most Metals features (code
28
+
navigation, diagnostics in editor, etc.) should work.
29
+
30
+
If you add dependencies (via `import $ivy` or `using` directives), re-run the
31
+
`setup-ide` above, and run the command "Metals: Connect to build server".
32
+
33
+
## VSCode (custom Metals server)
12
34
13
35
### Setup
14
36
15
-
Scala CLI support in Metals / VSCode requires the latest Metals VSCode extension (>= `1.10.8`). Ensure
37
+
This Scala CLI support in Metals / VSCode requires the latest Metals VSCode extension (>= `1.10.8`). Ensure
16
38
it is installed and up-to-date, or install or update it from the Extension panel in VSCode.
17
39
18
-
Scala CLI support relies on a custom Metals server for now. To enable it in the current project,
40
+
This Scala CLI support relies on a custom Metals server for now. To enable it in the current project,
19
41
run the command "Create New Integrated Terminal (in Active Workspace)", and type
0 commit comments