Intellisense not working for external libraries in Kotlin language server - kotlin

For external libraries kotlin intellisense is not working. It is showing "Unresolved Reference" error.
I am trying to inject dependencies of Jackson jars to my Kotlin LSP. Can anyone suggest how we can achieve this?
Sample Image

I resolved this issue using scripts, as described here https://github.com/fwcd/kotlin-language-server#figuring-out-the-dependencies

Related

Unresolved Reference Kotlinx in IntellijIdea. Even after adding the library

I just wanted to taste Kotlin coroutines. Unfortunately, I haven't been able to use the library kotlinx in IntelliJ. I have downloaded the library through Maven.
Tried invalidating caches.
Rebuilt project.
Tried using it in a fresh project.
Even IntelliJ is suggesting kotlinx in auto-completion.
Still it says unresolved reference
I have tried most of the solutions on the web. But nothing worked.
Here are the steps that I am exactly doing.
Made a new project.
kotlinx is underlined since the library has not been added.
In project structure > modules > dependencies > add > library > maven Searched for the kotlinx library.
Downloaded the library.
Applied the settings.
kotlinx library is now visible in the External Libraries section.
Even the auto-completion is now suggesting kotlinx.
Still, nothing changes. The result is the same.
I have found the answer in the Kotlin slack channel. And to solve this particular issue add org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0 instead of org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0.
However, it is generally a good idea to learn a build system like Gradleor Maven and using those in the project. It makes life a lot easier.

IntelliJ Error:Kotlin: Module was compiled

I have used IntelliJ IDE just for Spring Boot project. Strong NOTE that I have not used any Kotlin project. But, today, I have an error below. Any professional person. Please, HELP to solve this issue! Thanks,
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.
I ran into the same problem, and my solution was:
If you do not use Kotlin in your project, you can solve the problem by turning off the IntelliJ IDE plugin.The operation is as follows:
idea menu:File>Setting>Plugins
Operation flow chart
According to solution from: https://stackoverflow.com/a/71093698/13248380
Try going to Build menu and choose Rebuild project.

kotlin-test vs kotlin-test-junit

I have a kotlin project that is compiled to java.
My test library is junit.
Im using maven as my dependency management and Intellij IDEA.
recently I got that strange warning in my pom.
Inspection info: If you have kotlin-test and junit dependency then
most likely you better to include kotlin-test-junit instead of just
kotlin-test
What is the difference between kotlin-test and kotlin-test-junit?
from what I read it seems that kotlin-test is not deprecated, so Why did intellij recommend kotlin-test-junit instead of kotlin-test?
So I found the answer here (I don't understand how I missed it in my first search)
In short kotlin-test library provides a set of annotations and utility functions independently of the test framework.
Where kotlin-test-junit library provides an implementation on top of Junit Asserter and the annotations and utility functions kotlin-test provides.

intellij hybris class recompile not working

I installed hybris plugin.
Imported project with it.
Have done ant clean all.
Then, if I try to build->recompile class it's not working. Seems like idea doesn't see classes generated by ant.
If I do build->rebuild project and then build->recompile class it's working fine, but it's not convenient at all. I believe there is fix to this, but I couldn't find it.
This is usual error I've got(packages are different for different cases):
this is essentially the expected behaviour. You can't mix "ant" build
and "native IDEA" build. Those are two separate build systems.
This is an explanation of hybris plugin developer (hybris-integration.atlassian.net/browse/IIPS-120)
And he suggests a solution for that:
before you try to import the project you need to do ant clean all (you will not need to use ant afterwards)
import the project using hybris plugin.
Press Build->Recompile project
Then you can create or modify your test run configuration if needed.
Recompile your classes and so on directly in Idea.
Also, he mentioned deal with JRebel here (hybris-integration.atlassian.net/browse/IIPS-47)
we support both compilation modes. Ant targets and idea internal. They
shouldn't be mixed as idea has it's own compilation model/cache. If
you use idea compilation then you can use JRebel or hotswap.
You cant hotswap classes in hybris without the help of a hotswap agent.There is a tool available in the market called JRebel. It is a good commercial tool if one can afford. However, if you are an open-sourcist, there is a promising alternative to JRebel, which is DCEVM (Dynamic Code Evolution Virtual Machine) along with HotswapAgent.
I don't know if this help,
you can start another cmd console, and run
setantenv and ant build to hotswap class in runtime.

Working with IntelliJ + Spring Data + AspectJ

I am attempting to work with a Spring Data Graph project in IntelliJ 11.1.4 Ultimate edition. The project builds fine but the editor says that the persist() method on my classes annotated with #NodeEntity can't be found. Additionally, none if the aspect enhanced methods, like persist, show up for auto-complete suggestions.
I am using the AspectJ Support plugin and I have the compiler set to AJC. Both IntelliJ and Maven can build and run the project, it appears that the editor is the only piece that has the problem.
Am I missing something obvious? Is this a limitation of IntelliJ? I thought 11.1.4 addressed this but I might be mistaken.
Unfortunately AspectJ support isn't fully implemented yet - though resolve and completion should work. Could you please file a ticket in the tracker with a small demo project attached?