Remove unused deprecated configureAs methods
This commit is contained in:
@@ -17,9 +17,7 @@
|
|||||||
package org.jetbrains.kotlin.idea.test
|
package org.jetbrains.kotlin.idea.test
|
||||||
|
|
||||||
import com.intellij.openapi.editor.Document
|
import com.intellij.openapi.editor.Document
|
||||||
import com.intellij.openapi.module.Module
|
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel
|
|
||||||
import com.intellij.psi.PsiDocumentManager
|
import com.intellij.psi.PsiDocumentManager
|
||||||
import com.intellij.testFramework.LightPlatformTestCase
|
import com.intellij.testFramework.LightPlatformTestCase
|
||||||
import org.jetbrains.kotlin.diagnostics.Severity
|
import org.jetbrains.kotlin.diagnostics.Severity
|
||||||
@@ -31,38 +29,6 @@ import org.jetbrains.kotlin.psi.KtFile
|
|||||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
enum class ModuleKind {
|
|
||||||
KOTLIN_JVM_WITH_STDLIB_SOURCES,
|
|
||||||
KOTLIN_JAVASCRIPT
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Module.configureAs(descriptor: KotlinLightProjectDescriptor) {
|
|
||||||
val module = this
|
|
||||||
updateModel(module) { model ->
|
|
||||||
if (descriptor.sdk != null) {
|
|
||||||
model.sdk = descriptor.sdk
|
|
||||||
}
|
|
||||||
val entries = model.contentEntries
|
|
||||||
if (entries.isEmpty()) {
|
|
||||||
descriptor.configureModule(module, model)
|
|
||||||
} else {
|
|
||||||
descriptor.configureModule(module, model, entries[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("DeprecatedCallableAddReplaceWith")
|
|
||||||
@Deprecated("Please use correct ProjectDescriptor in tests from the very beginning")
|
|
||||||
fun Module.configureAs(kind: ModuleKind) {
|
|
||||||
when (kind) {
|
|
||||||
ModuleKind.KOTLIN_JVM_WITH_STDLIB_SOURCES ->
|
|
||||||
this.configureAs(ProjectDescriptorWithStdlibSources.INSTANCE)
|
|
||||||
ModuleKind.KOTLIN_JAVASCRIPT -> {
|
|
||||||
this.configureAs(KotlinStdJSProjectDescriptor)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun KtFile.dumpTextWithErrors(): String {
|
fun KtFile.dumpTextWithErrors(): String {
|
||||||
val text = text
|
val text = text
|
||||||
if (InTextDirectivesUtils.isDirectiveDefined(text, "// DISABLE-ERRORS")) return text
|
if (InTextDirectivesUtils.isDirectiveDefined(text, "// DISABLE-ERRORS")) return text
|
||||||
|
|||||||
Reference in New Issue
Block a user