scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Simpler setup for a multi-bsp-connection project to be imported by an IDE

Open Gedochao opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. As described in the intellij-multi-bsp cookbook, to prepare a project to be imported with multiple BSP connections (multiple BSP modules), it is currently necessary to run multiple setup-ide commands, one for each BSP module.

ie to achieve the following:

.
├── app1
│   ├── .bsp
│   │   └── scala-cli.json
│   └──  ...
├── app2
│   ├── .bsp
│   │   └── scala-cli.json
│   └──  ...
└── scripts
    ├── .bsp
    │   └── scala-cli.json
    └──  ...

one needs to run:

scala-cli setup-ide app1
scala-cli setup-ide app2
scala-cli setup-ide scripts

It'd be good to be able to run a single command to achieve this.

Describe the solution you'd like Optimally, it should be possible to set up with a single command, something like:

scala-cli setup-ide module1 --separate-module module2 --separate-module scripts

Also, it'd be good to have full support for this import from the IDE. IntelliJ currently sees the available BSP submodules, but requires the user to import each manually. AFAIK Metals doesn't allow to import multiple BSP connections in a single project (at least as of the time of writing this feature request).

Additional context Ideally, this would be done after a multi-connection BSP definition is supported by the protocol, as described in this ticket: https://github.com/build-server-protocol/build-server-protocol/issues/337

Describe alternatives you've considered If for whatever reasons it turns out to be impossible to have multiple BSP connections in a single definition, we should still be able to generate multiple .bsp sub-modules with a single run of the setup-ide command.

Gedochao avatar Jul 04 '22 13:07 Gedochao

The corresponding feature request ticket for Metals to track this: https://github.com/scalameta/metals-feature-requests/issues/290

Gedochao avatar Jul 25 '22 13:07 Gedochao

It seems we won't be providing simpler syntax for setups like this in Scala CLI per se, but it might be something we should keep in mind in future POC/prototypes for Scala Compose.

The setup for multiple Scala CLI projects via BSP is currently supported in both IntelliJ & Metals, but it requires manual setup for now. Closing this issue for now.

Gedochao avatar Dec 20 '23 10:12 Gedochao