-
Notifications
You must be signed in to change notification settings - Fork 316
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
[Scala3] Regression: Multiple error inlines are not shown starting 3.0.1 #3214
Comments
I think it should be related to this - scala/scala3#12425 that was a fix for this issue #2769 Originally there was a problem that diagnostic from inline error was received for a wrong file. |
Thanks for the feedback. If there’s something that you’d like me to test please let me know. |
Curiously, is scala/scala3#12425 still a blocker for this issue? Seems like it was merged in May. |
@deusaquilus yep it was merged and probably that was a reason of this regression. |
What does that mean? Does it mean there needs to be a new fix for something on epfl/dotty? |
Yes, it should fixed there. |
What is the upstream fix that is needed? |
Being affected by this as well. Would be great to get it fixed. |
Hey guys, sorry to pester. What is the upstream fix that is needed? |
@deusaquilus I'm going to look at it today. |
Hi @dos65. Now with the release of 3.1.3 it looks like they enhanced the information provided with inline information: Is does this provided the feature set that you need for this kind of functionality to be implemented in Metals? |
@deusaquilus it doesn't. It' requires more changes in a bunch of interfaces. I've seen that @ckipp01 started working on that - https://contributors.scala-lang.org/t/revisiting-dotty-diagnostics-for-tooling/5649/17 |
Interesting. Does metals require SBT changes to |
@deusaquilus Yes, and it's already done by @ckipp01 🎉 here sbt/sbt@f90b09f |
Looks like the SBT changes are done. Thanks @ckipp01!! |
So the idea here is that the inlined positions can be listed as Right now the compiler just spits out a giant ball of text that has the error, the inlined positions, etc all just in a string. So in Metals and really any tooling utilizing that, they have no option but to somehow parse that info out of the string to do anything meaningful with it. An alternative would be what I think they had very early on where every position had it's own diagnostic, but they weren't related in any way. |
That totally makes sense and is in line with what I saw in early Dotty versions. Thanks for the explanation! I can’t wait for Metals and other build tools to take advantage of |
Describe the bug
When using Scala 3.0.0 if you have code that has errors in multiple levels of inlining, there is a red underline for every single one:
You can hover over any of them and see the errors thrown at that point:
In 3.0.1 you only see the last position underlined:
(although you can see that SBT still knows about the parent inline i.e. the one on line 5):
This functionality is badly needed because in ProtoQuill errors almost always happen in inline def
quote { ... }
blocks long before the run function finally splices them back into real code so having mouse-over insight onto the error in those sections is invaluable.If we only have the error information in the
run(...)
site it is very difficult to track down the error.To Reproduce
Create a simple example. Create the following macro:
Then use it like so:
When SBT
scalaVersion
is 3.0.0 there will be a short red line underneath (a part of) both matchOne and matchTwo.If SBT
scalaVersion
is 3.0.1 or above there will only be a red line underneath matchTwo.Code examples can be found in the following repo:
https://github.com/getquill/protoquill-example/tree/multi-inline-example
The simple example above is here:
https://github.com/getquill/protoquill-example/tree/multi-inline-example/src/main/scala/io/getquill/simple
Expected behavior
All the places from which the code is inlined should have a red arrow underneath.
Installation:
Search terms
Inline. Error Highlight. Underline. Mouse Hover.
The text was updated successfully, but these errors were encountered: