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
Is your feature request related to a problem? Please describe.
Scala CLI scripts are often used a single file entities and people might have multiple of such scripts in a single directory for different tasks. Currently metals will treat all this scripts as single project, which is not always desired.
Create a special script mode in Metals where each file would be considered as a separate project.
The solution could reuse FallbackMetalsLspService which is currently used for single file support. It starts a Scala CLI server for each file keeping a pool to up to 10 servers (this number could be configurable).
Alternatively
Metals should by default treat each script as a separate project. Plus add a setting that will disable this and .sc will be treated as part of the project (as currently).
Describe alternatives you've considered
Opening each script as a single file in the editor.
Keeping each script in a separate folder and opening them as workspace folders.
Adjusting definitions and imports in the script so they don't have conflicts and can be treated as single build.
Additional context
Starting a new server for each file isn't perfect but Scala CLI server are quite lightweight, since they mostly proxy things to Bloop. Other solution would require multi-module builds in Scala CLI, which is out of its designed scope.
Search terms
scala-cli, scripts
The text was updated successfully, but these errors were encountered:
Currently run scala-cli main.sc generates warning:
[warn] Using directives detected in multiple files:
- main.sc:1:1-23
- util.sc:1:1-2:41
It is recommended to keep them centralized in the /home/dove/Workspace/Scala/demo/project.scala file.
from the documentation, there is another problem: Custom source does not support chaining. sources are added only once, not recursively. This is supported by ammonite. It can be useful for managing scripts.
Is your feature request related to a problem? Please describe.
Scala CLI scripts are often used a single file entities and people might have multiple of such scripts in a single directory for different tasks. Currently metals will treat all this scripts as single project, which is not always desired.
original issue: VirtusLab/scala-cli#3367
Describe the solution you'd like
Create a special script mode in Metals where each file would be considered as a separate project.
The solution could reuse
FallbackMetalsLspService
which is currently used for single file support. It starts a Scala CLI server for each file keeping a pool to up to 10 servers (this number could be configurable).Alternatively
Metals should by default treat each script as a separate project. Plus add a setting that will disable this and
.sc
will be treated as part of the project (as currently).Describe alternatives you've considered
Additional context
Starting a new server for each file isn't perfect but Scala CLI server are quite lightweight, since they mostly proxy things to Bloop. Other solution would require multi-module builds in Scala CLI, which is out of its designed scope.
Search terms
scala-cli, scripts
The text was updated successfully, but these errors were encountered: