-
Notifications
You must be signed in to change notification settings - Fork 330
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, the silent killer #6191
Comments
Thanks for the report. This does look like a problem with Java semanticdb compiler plugin. Would you be able to provide a reproduction of the issue? You could also try switching the build server to |
Hi there, I can join the club. While updating an old project I got slammed by the The project was coming from a bloop 1.4.4 era, but if I tested different bloop versions I see it now breaks as of bloop 1.4.10.
"javaSemanticDBVersion": "0.9.9", Which I believe equates to: https://central.sonatype.com/artifact/com.sourcegraph/semanticdb-javac/0.9.9
"javaSemanticDBVersion": "0.9.3", So it looks like it went sour in: A 65 file PR, I can see how something could go a bit haywire 😨 What I haven't figured out is what rewrites that |
So this is what I got out of it. It seems to be triggered by an annotation on a local variable private <T> Function<InvocationHandler, T> getConstructor(Class<T> contract) {
@SuppressWarnings("unchecked")
Constructor<T> constructor = (Constructor<T>) Which throws a
For some reason this new construct cannot cope with annotations on local variables. If I move the annotation to the method level it seems to get past the null pointer problem. I also have another java codebase where I use it on fields or classes where I didn't see the issue surface. More I wasn't able to determine whilst debugging on the release version of the Javac plugin. |
Why it fails on that exact instance is unclear, because I have other occurrences of annotations on local variables that don't make the plugin trip. |
Even with the snipped provided I cannot reproduce this issue but checking for a null can't hurt. |
Thanks for creating the reproduction that and generally taking the time to dig into this problem. With the reproduction it should be much easier to fix the issue. |
Describe the bug
I was trying metals, again, since intellij was acting up. I got a problem pretty quickly. It sounds the same as #6033, only it's "javac", not "java". Compilation fails. The position of the error (error: semanticdb-javac: bloop ) is on the "package" line of a seemingly arbitrary java file that has compiled fine for 5 years.
I'm using the mill build tool.
Looking at bloop.settings.json, the supported scala versions only go to 2.13.12, whereas I'm using 3.3.3, but it seems a lot happier than I would expect if that was relevant.
I haven't gotten far enough to test it, but previously setting the working directory in the run config was impossible in metals but not in vs-code in general. It was a breaker for me, but it's hard to imagine it's anything but a trivial fix.
Expected behavior
Seeing as it compiles fine, compiling fine was my hope. "Expected" might be a little strong.
Operating system
macOS
Editor/Extension
VS Code
Version of Metals
v1.29.0
Extra context or search terms
No response
The text was updated successfully, but these errors were encountered: