CodeInsightTestFixture with kotlin

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?

3 comments
Comment actions Permalink

Do you have Kotlin set in dependencies both in the Gradle configuration file and plugin.xml?

0
Comment actions Permalink

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>
0
Comment actions Permalink

Could you please link your full plugin's sources?

0

Please sign in to leave a comment.