Cannot resolve language with id ''JVM'' and "Kotlin"
已回答
Hello,
I was trying to create a plugin that adds line markers to both Java and Kotlin PSI elements. I followed the documentation and tried to solve the problem. Still can't figure out why this problem is happening. I am a student and a beginner for this problem. Please help for understanding why this problem occurs and how to solve it.
Unresolved code is marked below <<not solved>>
My plugin.xml is:
<idea-plugin>
<id>example.de.LineMarker</id>
<name>Line Marker for Trial</name>
<vendor email="support@example.de" url="http://www.example.de">Example Company</vendor>
<description><![CDATA[
line marker to trial part..........<br>
]]></description>
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
on how to target different products-->
<depends>com.intellij.modules.platform</depends>
<depends>org.jetbrains.android</depends> <<not solved>>
<depends>org.jetbrains.kotlin</depends>
<extensions defaultExtensionNs="com.intellij">
<codeInsight.lineMarkerProvider language="JVM" <<not solved>>
implementationClass="de.example.LineMarker.RandomLineMarker"/>
<codeInsight.lineMarkerProvider language="Kotlin" <<not solved>>
implementationClass="de.example.LineMarker.RandomLineMarker"/>
</extensions>
<actions>
<!-- Add your actions here -->
<action id="ExecuteLineAnalysis"
class="de.example.LineMarker.RunLineMarkerAction"
text="Run Line Marker" description="Check for Line Marker">
<add-to-group group-id="AnalyzeMenu" anchor="last"/> <<not solved>>
</action>
</actions>
</idea-plugin>
My build.gradle is following:
plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.21'
id 'maven'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
}
apply plugin: 'idea'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'
apply plugin: "kotlin"
group 'de.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72")
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.swinglabs.swingx', name: 'swingx-all', version: '1.6.4'
compile "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
}
intellij {
plugins 'android', 'java', 'maven', 'gradle'
plugins 'Kotlin'
//version '2019.2.2'
updateSinceUntilBuild false
}
runIde {
jvmArgs '-Xmx4G'
jvmArgs '-Xss100m'
}
patchPluginXml {
sinceBuild '191'
untilBuild '202.*'
changeNotes """
Add change notes here.<br>
<em>most HTML tags may be used</em>"""
}
请先登录再写评论。
In your Gradle configuration, you have set plugins twice overriding the list just with Kotlin. Merge it into one list of plugins instead:
Thank you. All the other lines resolved except Kotlin language. Now, only this is not resolved yet. What should I do?
Kotlin language should be written lowercase:
language="kotlin"Sorry. that was a typing mistake. But 'kotlin' language is not resolved yet.
Besides, I still couldn't show the line marker to kotlin files. I don't know what is the issue. Can you please have a look?
This is my working repository: https://github.com/Projucti/LineMarker.git