Adding Kotlin Support for a LineMarkerProvider
Hi,
I wrote a line marker to show a gutter icon for a specific Java annotation. It works fine and I want to add kotlin support. I have followed the suggestion here (https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000724850-Make-Intellij-Idea-plugin-work-with-Kotlin-files?flash_digest=5ff9dab2613759d5822ed7ca3db04beebb43a36a) to add kotlin support,
1. Added kotlin plugin ->
plugins {
id 'java'
id "org.jetbrains.kotlin.jvm" version "1.2.50" // << Here
id 'org.jetbrains.intellij' version '0.3.4'
}
2. Added kotlin dependency ->
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:1.2.50"
}
But I still couldn't resolve it in plugin.xml,
<depends>com.intellij.modules.lang</depends>
<depends optional="true">org.jetbrains.kotlin</depends>
org.jerbrains.kotlin is in red color and it is unresolved.
And
<lineMarkerProvider language="Kotlin" implementationClass="com.babylon.plugin.linemarker.TestRailAnnotationKotlinLineMarker"/>
Here language "Kotlin" is in red color. It is unresolved.
I am not sure what I missed? I have checked various plugin sources and documentation. But I couldnt figure it out. Thanks in advance.
Please sign in to leave a comment.
You added a dependency on the Kotlin Gradle plugin and on the Kotlin standard library, but not on the Kotlin plugin for IntelliJ IDEA. Please refer to the plugin development documentation for the correct way to add plugin dependencies: http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
Hi Dmitry,
Thanks for the immediate response. I added the kotlin-plugin.jar to SDKs dependency and now successfully added the line below,
org.jetbrains.kotlin is now resolved. But insde withKotlin.xml file, language="kotlin" is still unresolved.
In the above snippet, "kotlin" is in red color and unresolved. Do I still miss any dependency? Thanks again.
This may be simply an issue with IntelliJ IDEA's highlighting of plugin.xml files. Your plugin should work; you can check it under the debugger.
Thanks a lot. It is indeed an issue with the highlighter. I can attach the debugger.