IntelliJ is doing invalid highlighting of Kotlin e...
# intellij
n
IntelliJ is doing invalid highlighting of Kotlin errors all over the place. Invalidating the cache and restarting the IDE doesn't resolve the issue ☹️ . Invalid highlighting even appears on lines where the Kotlin standard library is used.
o
What is the error?
o
Well, unlikely related to 2011 issue 🙂
So, what’s the error?
n
Red squiggles appear in places where they shouldn't be. The project compiles without any issues.
o
That I get, but what is an error red squiggle indicate? You can hover on it to see the message.
l
Is Kotlin properly configured for the module? Is the gradle project "imported"/synced into the IDE?
n
The TODO error for instance is about "Overload resolution ambiguity" which highlights this line:
Copy code
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
o
The error message is there for a reason, it should normally show what compiler considered and why can’t it choose. Can you provide the exact error message it shows?
n
One of the error messages from the invalid Kotlin error highlighting in IntelliJ.
o
Is it a multiplatform project? yes, it is because
actual
Looks like dependencies are mixed up for JS
@bashor please take a look
n
There are four modules in the project (common, cli-client, server, and web-client). Only the server module (uses Kotlin JVM) contains the invalid error highlighting; excluding the invalid error highlighting that occurs in the build.gradle.kts files found in all modules.
Here is the link to the project (where the invalid error highlighting comes from): https://gitlab.com/napperley/repo-stats
You will need to follow these instructions in order to cover the webscene-core-js dependency in repo-stats: 1. Clone webscene-core ( https://gitlab.com/webscene/webscene-core ) 2. In the dir where the project is cloned run the following:
./gradlew publish
3. Copy the local maven repos in
common/build/repository/org
and
js/build/repository/org
to
repo-stats/web-client/libs
o
@h0tk3y can you take a look?
👀 1
h
Couldn't reproduce with IntelliJ IDEA 2018.3 EAP, Kotlin plugin 1.3.0. @napperley Which IDE and Kotlin plugin versions are you using?
n
Using IntelliJ 2018.2.5 and Kotlin plugin 1.3.0.
Appears as though the vast majority of the invalid error highlighting is with the Kotlin 1.3.0 standard library functions.
Looks as though copying the generated JS files to the server's asset directory causes IntelliJ's syntax checker to break:
./gradlew :server:deployClientToServer
Issue also occurs in IntelliJ 2018.3 with the latest stable version of the Kotlin plugin.
Some of the problems (that are caused by the issue) can be temporarily resolved by moving
server/src/main/resources/static
to a temp directory , and moving it back again after IntelliJ reevaluates all Kotlin source files that contain syntax issues.
@h0tk3y - I have submitted a issue on IntelliJ's broken Kotlin syntax checking when Gradle resources are present.
h
Thanks!