-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
SemanticDB support to be used by BSP (and others) #1977
Conversation
To generate SemanticDB data you can run:
which should be much faster than a full compile with
|
|
eca1623
to
7702744
Compare
@ckipp01 I think this branch should now produce some semanticDB data to be used by Metals. We only enable when we see that a semanticDB version is send in the client connection request (but currently ignore the version value). Also, as you predicted, Metals thinks semanticDB isn't enabled, as we don't have it's options in the normal settings. I just ran Metals 0.11.8 doctor, which isn't showing as much details as before. It there a way to see the old but more detailed output? |
It can be, that my change messed up with the compile progress. Also, looks like Metals has now issues with some URIs which contain query components. I think, this is someting, I added because Bloop does it too. |
I also rebased to the main branch, so don't expect that the |
Awesome to see progress on this! I'm testing right now and I'll drop some things in here as I come across them. The first thing I notice is that something is going wrong right away when Metals is requesting
I know you mentioned the Mill build stuff won't work yet, but maybe that's the issue? Since Mill is responding that there are 3 targets with the third being The requests for |
@ckipp01 I can't reproduce your issues with https://github.com/ckipp01/mill-minimal.
|
Also, this is what the new Metals Doctor displays: Build server currently being used is mill-bsp v0.10.5-62-6ae288. (Reset) Metals Java: 11.0.15 from Eclipse Adoptium located at /opt/openjdk-bin-11.0.15_p10 Metals Server version: 0.11.8 These are the installed build targets for this workspace. One build target corresponds to one classpath. For example, normally one sbt project maps to two build targets: main and test. Build target Type Compilation status Diagnostics Interactive Semanticdb Debugging Java support Recommendation ✅ - code is compiling ✅ - diagnostics correctly being reported by the build server ✅ - supported Scala version ✅ - build tool automatically creating needed semanticdb files ✅ - users can run or test their code with debugging capabilities ✅ - working non-interactive features (references, rename etc.) |
I fixed the issue with failed compilation in |
Now I see, that the Metals Doctor is still the same, but it was simply not displaying the modules it already knows about. And the rendering doesn't make it obvious. With my latest change, I again see the status for each module. |
Maybe Metals could use semanticDB files it finds in the classpath, and only, if there are none, it could inspect the |
Amazing, it's finding the SemanticDB and navigation is working :D
I'll double-check this on the Metals side.
Yea I'll need to play around with this. We can try to detect it in another way probably instead of only looking in the scalacOptions. |
@ckipp01 Thanks for testing. Can you say anything about the perceived performance? |
5f8fb71
to
a784b9b
Compare
And `bspCompileClassAndSemanticDbFiles` to `bspCompiledClassesAndSemanticDbFiles`.
This reverts commit 3328d99.
c1f3121
to
8c31b41
Compare
@ckipp01 Is there already some ticket in Metals that list or tracks the changes needed to support this new way of providing SemanticDB data in Mill? |
Not yet. I'll probably first have time this weekend to really dig into this, figure out exactly what would be needed, and then I'll create a ticket outlining it. |
In case someone is interested in my experiments to also support Java modules, I pushed them to branch https://github.com/com-lihaoyi/mill/tree/semantic-db-task-java |
I updated the documentation and deprecated the experimental |
Experiments with SemanticDB generation in a dedicated target
semanticDbData
.This PR builds on top of Add aMillBuildModule
and improve BSP forbuild.sc
#1972 to reuse some of the work I've done there.This PR is related to the idea cii) of Better Metals support - Automatic SemanticDB enablement (RFC) #1546
and reflects the motivation described in comment Better Metals support - Automatic SemanticDB enablement (RFC) #1546 (comment) (and following)
Tasks:
Potential follow-up tasks: