Replies: 2 comments 1 reply
-
I think 1. should be enough together with maybe semanticdb being reported as missing similar to compilation status? However, if we plan on more tools working with that approach, maybe sending some data to Metals with the info where semanticdb might be located would probably better. |
Beta Was this translation helpful? Give feedback.
1 reply
-
I created #4295 to partially address this. This will get rid of the warnings for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Outline
So recently @lefou merged in much better SemanticDB support for Mill when using Mill as a build server. This means Metals users can now use Mill as a BSP server (in the upcoming release) without any manual changes needed to their build. SemanticDB related features work:
The one issue though that you'll hit on is that we fully rely on scanning the
scalacOptions
to see if SemanticDB is enabled:Here for Scala
metals/metals/src/main/scala/scala/meta/internal/metals/MetalsEnrichments.scala
Lines 873 to 884 in 18192e3
Here for Java
metals/metals/src/main/scala/scala/meta/internal/metals/MetalsEnrichments.scala
Lines 809 to 813 in 18192e3
Mill takes a bit different approach than the other build servers to in that there's a separate task that creates the SemanticDB only when a tool like Metals is detected. Since it's a separate task you won't actually see the thing we look for in the
scalacOptions
, but you sill find SemanticDB in theclassDirectory
.Given this situation we don't want to tell the user that there is no SemanticDB when there is. So how should we handle this situation?
Possible Solutions
mill-bsp
is being used and if it's a new enough version we just assume that it is?mill-bsp
is being used and then doublecheck that theclassDirectory
name containsSemanticDb
?data
during the initialize and introduce somesemanticDbOverride: true
or something like that which notifies the client that SemanticDB is being produced even though we don't see it reflected in thescalacOptions
?Before digging into this I'm curious if anyone has any thoughts on the above or potential solutions for this.
Beta Was this translation helpful? Give feedback.
All reactions