-
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
Add Synthetics section to SemanticDB #13135
Comments
My 3 cents about the priorities in the task. I added a number for each one, but these are completely subjective and arbitrary.
10 For sure that would be one of the top ones, we should also include anonymous ones, but there should be a difference in how they are represented, maybe we don't need a separate synthetic for the name then.
10 Same importance as the using parameters.
9 This would be very useful when debugging macros, but I am not sure how doable it is currently.
7 It's pretty useful to show to users and an easy way to see what type was inferred for a particular function.
6 For sure this would be useful, the same as Scala 2 implicit classes, but not the most important.
6 Would be pretty good to have, but might be different thatn Scala 3 in terms of representation. We would need to take into account https://docs.scala-lang.org/scala3/reference/contextual/conversions.html
5 This might be useful, especially if some has a rewrite in Scalafix, I imagine we could also show it in Metals.
2 This is not currently used anywhere and it's actually simple to translate for comprehensions manually even. |
Thank you for the comment! I'll start working on using parameters and anonymous context params (and maybe apply implicit parameters) first :) |
For context / implicit params, anonymous context params, and anonymous given: opened a PR tanishiking#2 which depends on #12885 I'll submit a PR to |
TypeApplication part is almost ready tanishiking#5 and I'll submit a PR to lampepfl/dotty once the base branch has merged into master |
https://scalameta.org/docs/semanticdb/specification.html#synthetic
One of the main consumers of
Synthetics
information of SemanticDB is decraotion feature of metals, and once Scala3 extract these information, those features are available for Scala3 in Metals.TODO
using
) scalameta/scalameta#2460If there's something we should add to Synthetic section, please let me know :)
Using parameter application
what should we do for anonymous context params?
should we add
x$1
to synthetics?Anonymous context params
Extension method application?
Wondering how should we design the Synthetics Tree for the extension method...
Maybe we don't need to extract synthetics for the extension method at this moment, because the main consumer of the synthetics section of SemancticDB is metals's Decoration feature.
While extracting Implicit conversion for Scala2 is important for implicit decoration's readability, showing
plus(1)(3)
for the extension method doesn't help developers to read those programs.Scala2 compatible synthetics
Inferred method application
Inferred Type Application
Implicit parameters
implicit conversion
Macro Expansion
For loop desugaring
The text was updated successfully, but these errors were encountered: