-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
java.sql.Driver
missing from classpath in macro in presentation compiler
#20560
Comments
Hi, Just adding some further info from the original issue. Thinking about it, this can be further minimized, as this has nothing to do with object LoadStuff:
transparent inline def make: Unit = ${ makeImpl }
private def makeImpl(using Quotes): Expr[Unit] =
Class.forName("org.h2.Driver")
'{()} This too triggers a loss of type-information at the call-site of Removing Thanks |
Hi, I'd like to take a stab at figuring out this issue. Thanks |
Hello! |
Thank you for the detailed response! Is there a guide on how to develop and diagnose the presentation compiler with Metals?
Thanks |
That should be visible in .metals/reports or in .metals/metals.log
You only have to publish locally the presentation compiler module, it should be picked up automatically. |
Thanks for the prompt response. Trying to reproduce the bug now, and it's still missing type information, but also, I'm not seeing anything in the logs at all (only successful compilation). In the original issue I reported in the Metals repository, I did get an exception visible somewhere, though I don't recall now where I got it from. But even back then, as can be seen in the discussion there, I wasn't seeing the actual exception thrown by the presentation compiler, but rather some subsequent exception coming from Metals. It was mentioned there by Kasia, that it should be possible to get diagnostics directly from the presentation compiler. Can you please point me to where these are visible? Thanks |
Curious, I can't seem to reproduce either: Screencast.from.2024-10-30.10-55-34.mp4The only issue I see is that no hover information is shown in some places, but not actual exception. We could try to fix that and use Hover tests for that. |
Maybe it got somehow fixed or maybe there was some fallback in metals added, so there is no error visible. The error I posted was only visible when logging diagnostics from pc compile run, it did not surface. |
Although I've no idea where the exception has gone, the full issue at the usage site is still present:
Which I would imagine indicates that the presentation compiler decided to quit at this point. |
Also, how can I enable diagnostics from the presentation compiler? Thanks |
Playing a bit more with this issue. It seems that there's a definite improvement in 3.5.x compared to 3.4.2. In 3.4.2 the whole usage file completely loses type information in Metals. In 3.5.x it's only the results of the Maybe best effort compilation catches and suppresses errors mid way? |
If you are expecting Metals to display those diagnostics it won't. You have to change the code. Basically after type checking in run on compilation unit in pc you can call |
@kasiaMarek, got it, thanks. |
Original issue: scalameta/metals#6494
Compiler version
3.4.2
Minimized code
Output
Interactive compiler reports error diagnostics:
Expectation
Should compile fine and diagnostics should be empty.
The text was updated successfully, but these errors were encountered: