Fix completion tests
This commit is contained in:
committed by
Mikhail Glukhikh
parent
454c5229f9
commit
ef6a00f477
+1
-1
@@ -37,7 +37,7 @@ abstract class AbstractKeywordCompletionTest : KotlinFixtureCompletionBaseTestCa
|
|||||||
if ("LangLevel10" in fileName()) {
|
if ("LangLevel10" in fileName()) {
|
||||||
return KotlinProjectDescriptorWithFacet.KOTLIN_10
|
return KotlinProjectDescriptorWithFacet.KOTLIN_10
|
||||||
}
|
}
|
||||||
return KotlinLightProjectDescriptor.INSTANCE
|
return KotlinProjectDescriptorWithFacet.KOTLIN_STABLE_WITH_MULTIPLATFORM
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun defaultInvocationCount() = 1
|
override fun defaultInvocationCount() = 1
|
||||||
|
|||||||
+12
-2
@@ -20,6 +20,7 @@ import com.intellij.facet.FacetManager
|
|||||||
import com.intellij.openapi.module.Module
|
import com.intellij.openapi.module.Module
|
||||||
import com.intellij.openapi.roots.ContentEntry
|
import com.intellij.openapi.roots.ContentEntry
|
||||||
import com.intellij.openapi.roots.ModifiableRootModel
|
import com.intellij.openapi.roots.ModifiableRootModel
|
||||||
|
import org.jetbrains.kotlin.config.CompilerSettings
|
||||||
import org.jetbrains.kotlin.config.LanguageVersion
|
import org.jetbrains.kotlin.config.LanguageVersion
|
||||||
import org.jetbrains.kotlin.idea.facet.KotlinFacet
|
import org.jetbrains.kotlin.idea.facet.KotlinFacet
|
||||||
import org.jetbrains.kotlin.idea.facet.KotlinFacetConfiguration
|
import org.jetbrains.kotlin.idea.facet.KotlinFacetConfiguration
|
||||||
@@ -28,15 +29,24 @@ import org.jetbrains.kotlin.idea.facet.initializeIfNeeded
|
|||||||
import org.jetbrains.kotlin.test.testFramework.runInEdtAndWait
|
import org.jetbrains.kotlin.test.testFramework.runInEdtAndWait
|
||||||
import org.jetbrains.kotlin.test.testFramework.runWriteAction
|
import org.jetbrains.kotlin.test.testFramework.runWriteAction
|
||||||
|
|
||||||
class KotlinProjectDescriptorWithFacet(val languageVersion: LanguageVersion) : KotlinLightProjectDescriptor() {
|
class KotlinProjectDescriptorWithFacet(
|
||||||
|
private val languageVersion: LanguageVersion,
|
||||||
|
private val multiPlatform: Boolean = false
|
||||||
|
) : KotlinLightProjectDescriptor() {
|
||||||
override fun configureModule(module: Module, model: ModifiableRootModel, contentEntry: ContentEntry) {
|
override fun configureModule(module: Module, model: ModifiableRootModel, contentEntry: ContentEntry) {
|
||||||
configureKotlinFacet(module) { ->
|
configureKotlinFacet(module) {
|
||||||
settings.languageLevel = languageVersion
|
settings.languageLevel = languageVersion
|
||||||
|
if (multiPlatform) {
|
||||||
|
settings.compilerSettings = CompilerSettings().apply {
|
||||||
|
additionalArguments += " -Xmulti-platform"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val KOTLIN_10 = KotlinProjectDescriptorWithFacet(LanguageVersion.KOTLIN_1_0)
|
val KOTLIN_10 = KotlinProjectDescriptorWithFacet(LanguageVersion.KOTLIN_1_0)
|
||||||
|
val KOTLIN_STABLE_WITH_MULTIPLATFORM = KotlinProjectDescriptorWithFacet(LanguageVersion.LATEST_STABLE, multiPlatform = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user