Skip to content

Sources not visible from IntelliJ (via BSP) with using sourceJar and non-standard -sources.jar file paths #2959

Open
@olafurpg

Description

@olafurpg

Version(s)

❯ scala-cli --version
Scala CLI version: 1.3.2
Scala version (default): 3.4.2

Describe the bug

When importing a project into IntelliJ via BSP, I'm unable to see the source code of dependencies even with the // using sourceJar "PATH_TO_JAR" syntax.

To Reproduce

  • Create a jar file with source code and name the file something random.
  • Add // using sourceJar "PATH_TO_JAR"
  • Import the project into IntelliJ via BSP
  • I'm not able to view the sources

Expected behaviour
I can view the sources in IntelliJ, or scala-cli should at least error when it encounters a // using sourceJar directory without a companion //> using jar.

Workaround
I was able to work around the issue by creating symbolic links that have file paths ORIGINAL_NON_SOURCE_JAR-sources.jar. For example, when my build.scala looks like this https://gist.github.com/olafurpg/4db688793658d1b6ce7c6d5305534e73 then it works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IDEbspIssues tied to the implementation of BSP (Build Server Protocol)bugSomething 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