vscode-kotlin icon indicating copy to clipboard operation
vscode-kotlin copied to clipboard

Unresolved reference: listOf

Open goddnsgit opened this issue 2 years ago • 6 comments

Description

A clear and concise description of the bug and how to reproduce it.

Extension version

Which version of the VSCode extension you are running.

Additional context

More information or screenshots.

/* error Unresolved reference: listOfkotlin(UNRESOLVED_REFERENCE) */
val obj = listOf(1, "a", 3, "b", "c") 

fun main(args: Array<String>) {
    /**
     * error 
     * Class 'kotlin.collections.IntIterator' was compiled with an incompatible version of Kotlin. 
     * The binary version of its metadata is 1.8.0, expected version is 1.6.0.
     * The class is loaded from C:/Program Files/kotlinc/lib/kotlin-stdlib.jar!/
     * kotlin/collections/IntIterator.classkotlin(INCOMPATIBLE_CLASS)
     */
    for (i in 1..10) {
        /* error  Unresolved reference: printlnkotlin(UNRESOLVED_REFERENCE) */
        println(obj)
    }
}

goddnsgit avatar Jan 25 '23 12:01 goddnsgit

This will probably be solved by upgrading the kotlin-language-server to the newest Kotlin version, like there are currently a PR for: https://github.com/fwcd/kotlin-language-server/pull/414. The language server currently uses Kotlin 1.6.0 internally, so this seems the most logical conclusion given the error surrounding IntIterator above :)

themkat avatar Jan 25 '23 18:01 themkat

Any update for upgrading the language server to 1.8.0?

akash07k avatar Apr 29 '23 09:04 akash07k

Any update for upgrading the language server to 1.8.0?

The release for that was done weeks ago (and PR for fix merged not long after my last comment): https://github.com/fwcd/kotlin-language-server/releases

So you probably just need to upgrade to the newest version.

themkat avatar Apr 29 '23 09:04 themkat

Perfect, thanks much. I'll upgrade once

Any update for upgrading the language server to 1.8.0?

The release for that was done weeks ago (and PR for fix merged not long after my last comment): https://github.com/fwcd/kotlin-language-server/releases

So you probably just need to upgrade to the newest version.

akash07k avatar Apr 29 '23 12:04 akash07k

@themkat I'm using the Version: 0.2.31 of the extension, hhow do I upgrade the language server manually?

Perfect, thanks much. I'll upgrade once

Any update for upgrading the language server to 1.8.0?

The release for that was done weeks ago (and PR for fix merged not long after my last comment): https://github.com/fwcd/kotlin-language-server/releases So you probably just need to upgrade to the newest version.

akash07k avatar Apr 29 '23 13:04 akash07k

@themkat I'm using the Version: 0.2.31 of the extension, hhow do I upgrade the language server manually?

Perfect, thanks much. I'll upgrade once

Any update for upgrading the language server to 1.8.0?

The release for that was done weeks ago (and PR for fix merged not long after my last comment): https://github.com/fwcd/kotlin-language-server/releases So you probably just need to upgrade to the newest version.

Hmm. Not really sure, as I don't use the VSCode extension much. The easiest way is probably to uninstall the VSCode extension, then reinstall it and let it download the newest language server for you.

Another solution is to download the latest language server release, and use the path to that one in the VSCode extension settings. There should be a setting in the Kotlin extension settings menu to set the language server path.

themkat avatar Apr 30 '23 11:04 themkat