Gradle -> New IDEA-Plugin Project -> Symbols missing (e.g. JavaLanguage)

Answered

Hi,

after creating a new plugin project with Gradle and selecting Java, Kotlin and IntelliJ Platform Plugin options, the new projects links to a library named "Gradle: com.jetbrains:ideaIC:2019.2.3".

After inserting some code used in a older version of my development, some of the used classes can't be referenced anymore, e.g.

- import com.intellij.lang.java.JavaLanguage -> Unsolved reference: java

- JavaLanguage.INSTANCE -> Unsolved reference: JavaLanguage

- import com.intellij.patterns.PsiJavaPatterns.psiElementE -> Unsolved reference: PsiJavaPatterns

A closer look to class JavaLanguage shows:

public class JavaLanguage extends Language implements JvmLanguage {... -> Can't resolve symbol 'JvmLanguage'

Obviously there's something missing.

build.gradle:

lugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.11'
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
}

group 'de.foo'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
mavenCentral()
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
// testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.2'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.12.1'
}

intellij {
version '2019.2.3'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
patchPluginXml {
changeNotes """
Add change notes here.<br>
<em>most HTML tags may be used</em>"""
}

Any ideas?

Thx in advance

Kai

 

 

2 comments
Comment actions Permalink
 
 
intellij {
  plugins 'java'
  // ...
}

Yep, that's it. Thanks!

0

Please sign in to leave a comment.