Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow treating every Scala CLI script as separate project. #408

Open
kasiaMarek opened this issue Dec 18, 2024 · 1 comment
Open

Allow treating every Scala CLI script as separate project. #408

kasiaMarek opened this issue Dec 18, 2024 · 1 comment

Comments

@kasiaMarek
Copy link

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).

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

@SethTisue
Copy link

SethTisue commented Dec 18, 2024

Nice to see this is being considered. "Folder full of scripts" is actually my main use case for scala-cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants