-
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
Metals doesnt build project with project references to relative paths #507
Comments
Hi @benhutchison, thanks for reporting! I've transferred the issue to the main Metals repo since this doesn't look extension-related. |
@benhutchison Thanks for reporting! Can you maybe try to manually export the build with sbt-bloop and the following sbt settings // Note that this task has to be scoped globally
bloopAggregateSourceDependencies in Global := true See https://scalacenter.github.io/bloop/docs/build-tools/sbt#enable-sbt-project-references We might be able to enable this setting by default in the |
Please reopen if |
I dont think this be closed as "Resolved"... "Wont Fix" maybe... Yes, I can confirm adding However two problems remain:
Please compare the UI experience in Metals vs Intellij; I have uploaded screenshots of the sample project imported into both. You can see that Intellij presents the second project as a full peer of the top-level project, whereas the Metals experience confuses me and I cant do anything useful relating to the relative |
@benhutchison Thanks for the update. I agree this can be improved.
This can be solved by making
This could be fixed in the vscode extension by attaching a new workspace folder. You can already do this manually https://code.visualstudio.com/docs/editor/multi-root-workspaces There's no endpoint in LSP for servers to register new workspace folders, only to read existing ones https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders We could add a new client command for it like here https://scalameta.org/metals/docs/editors/new-editor.html#metals-client-commands
I am able to reproduce with your minimal repo (thanks!). This is a metals/semanticdb bug, fixing it requires rethinking assumptions we make about the structure of a project. I don't have a solution at the top of my head but I'm sure we can come up with something.
I'm unable to reproduce. The best place to drill down this issue is to report in scalacenter/bloop with a reproduction using the
|
I've split this issue into two feature requests (scalameta/metals-feature-requests#14, scalameta/metals-feature-requests#15) and one bug report (#524) |
Why can't they open the project? Sbt-bloop is compatible with the intellij logic extracting the build, I use this logic myself in Bloop to code in IntelliJ. I would love to have some more info because if you're experiencing an error it should be fixed 😉 |
I just discovered a behaviour similar to this. With Metals version 0.10.5 I am not able to build the repository mentioned in the bug report, https://github.com/benhutchison/metals_import_test. |
@jvican Realise I'd missed your question amongst all the github notifications, and recent activity reminded me. My context is a bit fuzzy on this but I guessing I meant that SBT projects that dont include sbt-bloop plugin can't set that |
I think Bloop already sets |
Describe the bug
When a SBT project (p1) is opened that depends on another project (p2) using a relative path eg ProjectRef(file("../p2")), Metals is unable to build the project even when SBT manages fine.
To Reproduce Steps to reproduce the behavior:
clone https://github.com/benhutchison/metals_import_test
When a SBT project (p1) is opened that depends on another project (p2) using a relative path eg ProjectRef(file("../p2")), Metals is unable to build the project even when SBT manages fine. So no SematicDB is created and the IDE code navigation features dont work.
Expected behavior
Project imports P1 & P2
Installation:
The text was updated successfully, but these errors were encountered: