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/guides/ide.md
+28-16Lines changed: 28 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,22 +8,24 @@ IDE support is under development mainly because changes needs to be done in both
8
8
:::
9
9
10
10
11
-
Scala CLI currently integrates with build server using [BSP protocol](https://build-server-protocol.github.io/). At this moment Scala CLI is not automatically detected so we need to use [Build Server Discovery](https://build-server-protocol.github.io/docs/server-discovery.html) from BSP protocol, namely generate connection details file (`.bsp/scala-cli.json`).
11
+
Scala CLI currently Scala integrates with IDEs using [BSP protocol](https://build-server-protocol.github.io/). At this moment Scala CLI is not automatically detected so we need to use [Build Server Discovery](https://build-server-protocol.github.io/docs/server-discovery.html) from the BSP protocol. This is the main reason we create the BSP connection details file (`.bsp/scala-cli.json`) for your editor to pick up.
12
12
13
13
:::note
14
-
None of the following commands was run: `compile`, `run`, `test`, `setup-ide` or previously generated connection detail file was deleted, IDE will not use Scala CLI to configure workspace.
15
-
16
-
In such case, just run one of the commands above commands to recreate connection details file
14
+
If none of the following commands were ran: `compile`, `run`, `test`,
15
+
`setup-ide` or a `.bsp/scala-cli.json` file has yet to be created (or was deleted), your editor
16
+
won't pick up scala-cli as a build server. In that case, simply run one of the
17
+
those commands and the file will be created.
17
18
:::
18
19
20
+
Since Scala CLI has a command-line-first approach that is reflected in the IDE
21
+
integrations. By default, Scala CLI stores options passed to the last `compile`,
22
+
`run` or `test` commands and use those options to configure your IDE.
19
23
20
-
Since Scala CLI has a command-line-first approach and it is reflected in IDE integration. By default, Scala CLI stores options passed to last `compile`, `run` or `test` and use those options to configure IDE.
21
-
22
-
For more control we also expose [`setup-ide` command](../commands/setup-ide.md) that allows to fine tune options passed to IDE.
24
+
For more control we also expose a [`setup-ide` command](../commands/setup-ide.md) that allows to fine tune options passed to IDE.
23
25
24
-
Once `setup-ide` is used, Scala CLI does not update configuration based on latest command.
26
+
Once `setup-ide` is used, Scala CLI does not update configuration based on the latest command.
25
27
26
-
To enable automatic updates again, remove `.bsp` directory and run `compile`, `run` or `test` to recreate connection details file.
28
+
To enable automatic updates again, remove the `.bsp` directory and run `compile`, `run` or `test` to recreate the connection details file (`.bsp/scala-cli.json`).
27
29
28
30
For now non-local sources are supported. What are non-local sources? Gists, URLs or piped sources.
29
31
@@ -32,19 +34,28 @@ Scala CLI was tested with two main IDEs for Scala:
32
34
-[Metals](https://scalameta.org/metals/): LSP server for Scala used with [Visual Studio Code](https://code.visualstudio.com/), [Vim](https://www.vim.org/) and many other editors
33
35
-[Intelij Idea](https://www.jetbrains.com/idea/) with [Scala Plugin](https://confluence.jetbrains.com/display/SCA/Scala+Plugin+for+IntelliJ+IDEA?_ga=2.54176744.1963952405.1634470110-410935139.1631638301) installed
34
36
35
-
In ideal world, we would replace the rest of this Guide with something along the lines of: `Scala CLI works within IDEs above as you would expect` however mainly due to how fresh Scala CLI is and also due to our radical approach to the project structure using Scala CLI -powered project to your favourite IDE may not be as amazing as we would like.
37
+
In ideal world, we would replace the rest of this Guide with something along the
38
+
lines of: `Scala CLI works with all IDEs above as you would expect` however
39
+
mainly due to how fresh Scala CLI is and also due to our radical approach to the
40
+
project structure using a Scala CLI-powered projects with your favourite IDE may
41
+
not be as amazing as we would like to be.
36
42
37
-
Proper IDE integration is our top priority at this moment.
43
+
Proper IDE integration is our top priority at the moment.
38
44
39
45
## Metals
40
46
41
-
Once Metals pick up proper project structure then basic features like navigation, diagnostics or code completion should work.
47
+
Once Metals picks up proper project structure then basic features like navigation, diagnostics or code completion should work.
42
48
43
-
Currently release Metals (0.10.7) are not able to pick changes in build structure automatically and this even includes adding new source file. In order for Metals to pick up new files or changes in build structure 'Restart build server' action is needed.
49
+
The Current release Metals (0.10.8) is not able to pick changes in the build
50
+
structure automatically and this includes adding new source files. In order
51
+
for Metals to pick up new files or changes in build structure you'll need to
52
+
trigger the 'Restart build server' command.
44
53
45
-
Main classes and tests are at this moment to recognized in Metals.
54
+
Main classes and tests are at this moment not recognized in Metals.
46
55
47
-
Generally, mainly due to problems with keeping project structure up to date Metals can assists with writing code using Scala CLI, however it cannot be the source of true and we recommend falling back to command line in such cases.
56
+
Generally, mainly due to problems with keeping project structure up to date
57
+
Metals can assists with writing code while using Scala CLI, but it cannot be the
58
+
source of truth and we recommend falling back to command line in such cases.
48
59
49
60
## IntelliJ
50
61
@@ -54,4 +65,5 @@ With IntelliJ, we strongly suggested to placed your sources within a directory (
54
65
55
66
IntelliJ currently does not automatically pick up changes in project structure so any change in dependencies, compiler options etc. needs manual reload.
56
67
57
-
Similarly to Metals, currently we do not advise using IntelliJ as a source of truth. We recommend falling back to command line in such cases.
68
+
Similarly to Metals, we don't currently advise using Intellij as a source of
69
+
truth and we recommend falling back to command line in such cases.
0 commit comments