Open dos65 opened 3 years ago
Looks like this happens when cursor on { ... }.method()
.
Actually, if we remove .showing
at the end of the classDef
method, it works fine.
--- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala
@@ -824,7 +824,7 @@ object desugar {
}
flatTree(cdef1 :: companions ::: implicitWrappers ::: enumScaffolding)
- }.showing(i"desugared: $result", Printers.desugar)
+ }
/** Expand
*
@tanishiking I thought about that. However, I couldn't reproduce the similar thing on smaller samples. For example, if I add an method with a similar structure in this file it works well and provides correct highlithing
It seems that we are getting a wrong range maybe?
Related to this, I noticed that when this happens and you see usage of showing
like in the above example, code navigation is also impacted. For example trying to goto a definition of a symbol inside of that block ends up leading you to showing
instead.
Looks like this is working correctly now :tada:
Looks like this is working correctly now 🎉
I actually just tested the case I have above and I'm still getting the same issues. Using 0.11.9+90-31235494-SNAPSHOT
if I am in the Dotty codebase and trigger a goto definition on isEnum
as you see in the gif, I am still brought to showing
.
Ach damn, the highlighting got fixed because we now use the compiler, but it seemed to me that it was working for go to definition also :/
Steps to reproduce the behavior:
compiler/src/dotty/tools/dotc/ast/Desugar.scala
def classDef
method body