Kotlin-dsl-samples: KT-21420 - .gradle.kts semantic highlighting lifecycle on IntelliJ startup

Created on 23 Nov 2017  路  5Comments  路  Source: gradle/kotlin-dsl-samples

Upstream issue: https://youtrack.jetbrains.com/issue/KT-21420

When opening a .gradle.kts file, it is first shown with an editor that do no semantic highlighting while IJ is doing some indexing.
Then, it is shown with semantic highlighting before the editor has a chance to get the response from the script template dependency resolver. But the semantic highlighting fails and the editor is "all red".
Then, once the dependency resolver response is received, semantic highlighting finally works.

It is very confusing to users as IJ tell them their script is full of errors when it is not, it's just that IJ doesn't have all the necessary context yet.

This issue is about preserving the state of the editor without context (in which it doesn't do semantic highlighting including errors) until the first successful dependency resolver response.

Please find attached an animated gif showing the current behaviour. It is quite long despite me pausing the recording while IJ is indexing but it shows the 3 steps clearly: first no semantic highlighting, then all red, then all fine.

gradle kts editor highlighting lifecycle

bug jetbrains kt-idea-plugin ease-of-use editing fast-feedback

Most helpful comment

Confirmed as fixed in 1.2.40-eap-16

All 5 comments

This has annoyed me for so long. That description is amazing. I'm glad to be seeing it get fixed!!

Yep, took time to understand what's happening. It has been reported upstream, let's hope it'll get fixed in a reasonable time frame.

Marked as fixed upstream and targeted at Kotlin 1.2.40 \o/

\o/

Confirmed as fixed in 1.2.40-eap-16

Was this page helpful?
0 / 5 - 0 ratings