Support for comprehension calls in Scala #151
Replies: 3 comments
-
I move your request here for discussions. Your description and code pattern are very good example. |
Beta Was this translation helpful? Give feedback.
-
I found the issue based on you example code. the code val r = for {
x <- b.bar()
} yield "foo" + x Are not support yet. Why? The generate solution is based on the UAST api, witch is one for four(Java, Scala, Kotlin, groovy) solution. The description on IDEA document: https://plugins.jetbrains.com/docs/intellij/uast.html#which-languages-are-supported
But, the UAST tree of the function
you can see, the May be it is the UAST api weak, I will report to IDEA for some help. |
Beta Was this translation helpful? Give feedback.
-
It seems that the issue is related to the Scala language feature not being fully supported by the plugin, and the solution proposed is to update the plugin to show function calls within for comprehensions in the diagram. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
As the readme states that Scala is supported on version 3 and it isn't marked as
partial
, I was in doubt if this is actually a bug or an unsupported language feature due to some specific feature.Describe the solution you'd like
If a function is called from withing a for comprehension, the call should be presented in the diagram just as a direct call would.
Take this example:
The diagram for
foo()
shows thebar()
call but the diagram forfoo2()
goes directly to thegetOrElse
.This way, the plugin loses a lot of its usefulness when you have functional code that makes heavy use of this language feature.
Describe alternatives you've considered
Can't see alternatives in this case except the feature needs to be implemented, fixed if it was supposed to work already, or a warning added that it is not supported due to some limitation if there is some unavoidable one.
Additional context
Tested 3.0.0-alpha.1
Beta Was this translation helpful? Give feedback.
All reactions