-
Notifications
You must be signed in to change notification settings - Fork 338
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
(Scala 2) Dependency sources have false-positive diagnostics #4654
Comments
I guess it's for navigation... which seems to suffer as well, even in Scala 3 where I'm not seeing these diagnostics |
Thanks for reporting @kubukoz. I'm trying to reproduce this and it seems a bit non-derterministic for me and I don't really get why. For example with your Playing around a bit I keep getting unexpected results, either that or I haven't caught the pattern yet.
Correct, its a bit different, but we create semanticdb on the fly via the presentation compiler for dependency sources. Something funky is going on in that process its seems. |
I think we might not be adding diagnostics to Semanticdb in Scala 3, which is why these are not being shown. Compiling sources semanticdb might sometimes fail, since we don't have the full build information, so maybe we just shouldn't show the diagnostics in that case? |
I do think it's helpful in the situation where we can't to still have some sort of indication that things aren't working. Or else when you try to navigate and it fails it might be confusing. |
Sure, but maybe just have one diagnostic that says the compilation for the file failed and navigation might not work? |
Can libraries overcome this problem by attaching semanticdb to the artifacts they produce? Would Metals use that then? |
It would, but it would require all the libraries to do it and would also make the artifacts larger. Alternatively, we can just try to make it compile in more scenarios or alternatively make sure that navigation is handled properly even if it fails to compile. |
Fixed in #5910 |
Describe the bug
When you go to dependency sources, you may see INFO diagnostics suggesting there's something wrong.
For example:
Go to
DynamicSchemaIndex
. You might see this:In this particular case,
Schema
comes fromsmithy4s-core
. It's definitely in scope and shouldn't be an error/info... but is there any reason we're looking for diagnostics in dependency sources in the first place?Expected behavior
No diagnostics are emitted.
Operating system
macOS
Editor/Extension
VS Code
Version of Metals
v0.11.9
Extra context or search terms
Some other examples:
org.typelevel::cats-core:2.9.0
-> look atcats.Applicative
Apply
comes from the same jar so it's not a transitive dependency problem.it's a bit annoying as it results in a looooooot of fake problems:
Even simpler (cats-kernel, which doesn't have transitive dependencies at all and is overall a smaller library):
org.typelevel::cats-kernel:2.9.0
-> look atOrder
:The text was updated successfully, but these errors were encountered: