CodeInsightTestFixture with kotlin
Answered
I need to get psiFile from kotlin code in my project. I'm using:
val psiFile = myFixture.configureByFile(file)
file - path to file with kotlin code
But that method gives me psiFile of .txt
How i can get psiFile with .kt?
Please sign in to leave a comment.
Do you have Kotlin set in dependencies both in the Gradle configuration file and plugin.xml?
in build.gradle i have:
Also i have that in plugin.xml
intellij {plugins 'org.jetbrains.kotlin'
version '2020.3.3'
}
plugins {id 'java'
id 'org.jetbrains.intellij' version '0.7.2'
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.32"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.3.9"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
in plugin.xml:
<depends>org.jetbrains.kotlin</depends>
Could you please link your full plugin's sources?
Could you try using junit4 instead of 5?