Open davidpcaldwell opened 5 years ago
The language server should support them, the debug adapter does not (yet). Could you post the log from the Kotlin
section in the output tab?
I have also this problem. My project is Idea-based, but I took Gradle from a sample Kotlin project. A new version of this extensions showed more than 150 errors and one external error. I have Java 8 and 13 installed, but I used Gradle to set Java 8.
Here is the code in the file KotlinEssencialAndroid.iml
:
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="KotlinEssencialAndroid" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="0.1.1" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
@gusbemacbe Could you please share the Kotlin log in the output section:
@fwcd
Here is the log:
[Info - 12:29:35] main Connected to client
[Info - 12:29:35] client Adding workspace file:///home/gusbemacbe/IdeaProjects/KotlinEssencialAndroid to source path
[Info - 12:29:35] client Adding .../src/modulo1-aula8.kt, .../src/modulo1-aula9.kt, .../src/OlaMundo.kt under /home/gusbemacbe/IdeaProjects/KotlinEssencialAndroid to source path
[Info - 12:29:35] client Searching for dependencies in workspace root /home/gusbemacbe/IdeaProjects/KotlinEssencialAndroid
[Info - 12:29:35] client Resolving classpath using Stdlib + [] or [] + Gradle or Backup
[Info - 12:29:35] client Resolving dependencies for 'KotlinEssencialAndroid' through Gradle's CLI...
[Info - 12:29:35] client Creating temporary gradle file /tmp/classpath7107834936088201821.gradle
[Info - 12:29:36] client Successfully resolved dependencies using Gradle dependencies CLI
[Warn - 12:29:36] client Could not resolve Gradle dependencies using any resolution strategy!
[Info - 12:29:36] client Could not resolve kotlin-stdlib using Maven: null
[Info - 12:29:36] client Successfully resolved kotlin-stdlib using Gradle
[Info - 12:29:36] client Adding [/home/gusbemacbe/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.40/7af6fd6b9293e80fc7408493a764858a7f66b022/kotlin-stdlib-1.3.40-sources.jar] to class path
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.com.intellij.openapi.util.io.FileSystemUtil$FallbackMediatorImpl (file:/home/gusbemacbe/.config/Code%20-%20Insiders/User/globalStorage/fwcd.kotlin/langServerInstall/server/lib/kotlin-compiler-embeddable-1.3.41.jar) to field java.io.File.fs
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.com.intellij.openapi.util.io.FileSystemUtil$FallbackMediatorImpl
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[Info - 12:29:36] client Updated configuration: {"kotlin":{"languageServer":{"enabled":true,"path":""},"compiler":{"jvm":{"target":"default"}},"linting":{"debounceTime":250},"completion":{"snippets":{"enabled":true}},"debugAdapter":{"enabled":true,"path":""},"debounceTime":250,"snippetsEnabled":true}}
[Info - 12:29:36] debounce0 Linting .../src/modulo1-aula9.kt
[Info - 12:29:36] async0 Find symbols in TextDocumentIdentifier [
uri = "file:///home/gusbemacbe/IdeaProjects/KotlinEssencialAndroid/src/modulo1-aula9.kt"
]
[Info - 12:29:37] async0 Finished in 154 ms
[Info - 12:29:38] debounce0 Reported 158 diagnostics in modulo1-aula9.kt
@gusbemacbe This is possibly https://github.com/fwcd/kotlin-language-server/issues/116.
IDK that's the same type of issue but...
I wanted to try write plugins to Minecraft in VSC, but that extension is showing weird/wrong hints
When I wrote the code, extension see all things good. Questions is: why it doesn't see functions/methods when I'm writing?
This seems like extension can't load external libraries/classes.
I'm using that with Java set of extensions (it follows that with Maven)
I have tested that code in Java, and it worked perfectly. IMO Kotlin >>>>> Java, but when Java is working and Kotlin not...
@Evolveye The extension does not propose getXYZ()
-style methods since there is a more idiomatic way of writing this in Kotlin: Instead of getServer().getPluginManager()
you would write server.pluginManager
. These properties are automatically converted getters (not fields!) and will show up in your code completions.
:O My mindset has changed, thx very much
This issue is a bit confusing. What's the proposed opinion on this matter? I have a big project with many different languages in it. The language used most is Kotlin, but this extension is freaking out when opening that project. I'm having this issue for weeks, but was using IntelliJ in the meantime, because I didn't have the opportunity to deal with this issue.
Several days ago, all Gradle stuff in this project was updated, reworked, cleaned and brushed up elegantly. The extension still cries about unresolved references. So this extension clearly has trouble dealing with multi-build and/or big projects or whatever. The point is: it does not work as expected.
The Output shows, that it cannot execute the Gradle tasks. Remember, the whole Gradle situation was reworked recently and is being used every day, successfully, by several people. So the error is caused only by the extension.
An example of what is going wrong:
client Resolving dependencies for 'master' through Gradle's CLI using tasks [kotlinLSPProjectDeps]...
client Gradle task failed:
client Resolving dependencies for 'backend' through Gradle's CLI using tasks [kotlinLSPProjectDeps]...
client Gradle task failed:
That's just a guess in the title, but when I open a file in my Gradle-based Kotlin project, I just get a sea of red squiggles with unresolved imports, basically.
If I recall correctly when trying to get the previous iteration of this working, I remember hearing multi-build projects (if I'm using that term correctly) were not supported.
If that's the problem, it should be documented prominently in the README. I'd write it and submit a PR but 1. I'm not sure that I'm correct, and 2. I'm not a Gradle expert and would want to get my terminology right.