[ad_1]
I have included the right dependencies as in implementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21'
, and tried invalidating caches and re-opening the project. However, it still triggers the errors Unresolved reference: KotlinLexer
and Unresolved reference: KotlinParser
.
Here’s the code segment that imports the KotlinLexer
and KotlinParser
:
...
import org.jetbrains.kotlin.spec.grammar.tools.*
import org.jetbrains.kotlin.spec.grammar.KotlinLexer
import org.jetbrains.kotlin.spec.grammar.KotlinParser
...
Here’s my build.gradle
for your reference:
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
id 'org.jetbrains.intellij' version '1.2.1'
id 'java'
id 'antlr'
}
group 'me.ylee'
version '1.0-SNAPSHOT'
repositories {
google()
mavenLocal()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.0"
implementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.21'
implementation "net.java.dev.jna:jna:5.11.0"
antlr 'org.antlr:antlr4:4.10.1'
implementation 'org.antlr:antlr4-runtime:4.10.1'
// Dependency on local binaries
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
intellij {
plugins = ['Kotlin', 'java']
}
compileKotlin {
kotlinOptions.jvmTarget="1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget="1.8"
}
Does anyone know how to resolve these unresolved reference
errors?
[ad_2]