Skip to content

Malformed BSP project when importing main & test scopes from the same root dir in IDEA IntelliJ #1145

Open
@Gedochao

Description

@Gedochao

Version(s)

0.1.9

Describe the bug

After running scala-cli setup-ide . for a project where tests & main sources are in the same root directory, the imported project structure is malformed (although workable).

image

This results in 2 bloop projects (1 for main scope and 1 for test scope). IntelliJ tries to import each as a separate module.

However, the resulting main scope module has no sources in it. It's an empty module.
image

Meanwhile, the test module contains sources from both scopes.
image

image

The root cause of this is IntelliJ's inability to have 2 modules with the same sources root. (IDEABKL-6745)

image

Expected behaviour
One of the following:

  • only 1 module is created and contains sources for both scopes
  • each module only contains sources from its relevant scope (currently unsupported by IntelliJ - IDEABKL-6745)

Known workaround
One can manually remove one of the imported modules - preferably the test one, and move the sources to the main one.
This bug doesn't technically break much, even without fixing it manually, everything can be compiled and run from IntelliJ out of the box. However, the malformed project still looks kind of bad, and may have some unforeseeable side effects for how the IDE works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IDEbugSomething isn't workingintellijIssues tied with IDEA IntelliJ interoperability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions