-
Notifications
You must be signed in to change notification settings - Fork 348
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
"No build target" when importing a Gradle multi module build #2704
Comments
In addition - could anyone advise me whether #2520 makes this pointless? There are Java-only projects as part of this multi module build, but I was hoping I could let the Java language server handle those... |
Thanks for reporting! The real issue might not be related to that PR after all. Do you have the
Lastly, we could try looking into the BSP traces, which can be enabled as explained here:https://scalameta.org/metals/docs/contributors/getting-started.html#json-rpc-trace It should contain exactly what info is sent to Metals and it might help us figure out why it's not finding a build target for that file. |
Yes, and I can already see the
I tried changing it to There are no dependencies listed - but this project has dependencies:
(Note there are additional configurations for the project provided by the root project). For the server connection, here're the logs:
I think that's starting and connecting.
Here's a trace after restarting VS Code and opening a Scala file to trigger Metals to launch: |
Thanks for the additional info! It looks like maybe the build is missing:
I think without it we might be exporting it as a java project. I base it on some test in Bloop for the gradle integration: and it seems to be required by Gradle? https://docs.gradle.org/current/userguide/scala_plugin.html#sec:scala_dependency_management I am not that familiar with the Gradle integration however, so I might not be right here. |
Ok, it seems to also be suggested in scalacenter/bloop#1488 (comment) I will close this one and we can continue the discussion there. |
I have a Gradle multi module build. Most of the sub projects are Java, but some are Scala. I want to use vscode and metals to develop this code.
When I import this code into vscode I get:
All
INFO
so I assume that's ok.However, no Java code that is dependent on Scala code compiles. If I click on the source
.scala
file to show the type that cannot be used, the metals output adds:I've tried following the "doctor" and removing
.metals
and.bloop
and restarting and re-importing, but the behaviour is the same.Expected behavior
A multi module, combined Scala and Java project is imported and compiles.
Installation:
Another log I often get is:
The text was updated successfully, but these errors were encountered: