diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt index 9db63a476b8..6b077820b3c 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt @@ -5,6 +5,12 @@ package org.jetbrains.kotlin.idea.test +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.project.Project import com.intellij.testFramework.LightPlatformCodeInsightTestCase -abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsightTestCase() \ No newline at end of file +// BUNCH: 191 +abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsightTestCase() { + protected inline val project_: Project get() = project + protected inline val editor_: Editor get() = editor +} \ No newline at end of file diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 new file mode 100644 index 00000000000..702d861b973 --- /dev/null +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightTestCase.kt.191 @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.test + +import com.intellij.openapi.project.Project +import com.intellij.testFramework.LightPlatformCodeInsightTestCase +import com.intellij.testFramework.LightPlatformTestCase +import sun.jvm.hotspot.ui.Editor + +// BUNCH: 191 +abstract class KotlinLightPlatformCodeInsightTestCase : LightPlatformCodeInsightTestCase() { + protected inline val project_: Project get() = LightPlatformTestCase.getProject() + protected inline val editor_: Editor get() = LightPlatformCodeInsightTestCase.getEditor() + +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/formatter/AbstractTypingIndentationTestBase.kt b/idea/tests/org/jetbrains/kotlin/formatter/AbstractTypingIndentationTestBase.kt index cbef735b5c5..1e68f9d2b2d 100644 --- a/idea/tests/org/jetbrains/kotlin/formatter/AbstractTypingIndentationTestBase.kt +++ b/idea/tests/org/jetbrains/kotlin/formatter/AbstractTypingIndentationTestBase.kt @@ -23,7 +23,7 @@ abstract class AbstractTypingIndentationTestBase : KotlinLightPlatformCodeInsigh val originFilePath = testFileName + testFileExtension val originalFileText = FileUtil.loadFile(File(originFilePath), true) try { - val configurator = FormatSettingsUtil.createConfigurator(originalFileText, CodeStyle.getSettings(project)) + val configurator = FormatSettingsUtil.createConfigurator(originalFileText, CodeStyle.getSettings(project_)) if (!inverted) { configurator.configureSettings() } else { @@ -32,16 +32,16 @@ abstract class AbstractTypingIndentationTestBase : KotlinLightPlatformCodeInsigh doNewlineTest(originFilePath, afterFilePath) } finally { - CodeStyle.getSettings(project).clearCodeStyleSettings() + CodeStyle.getSettings(project_).clearCodeStyleSettings() } } private fun doNewlineTest(beforeFilePath: String, afterFilePath: String) { configureByFile(beforeFilePath) type('\n') - val caretModel = editor.caretModel + val caretModel = editor_.caretModel val offset = caretModel.offset - val actualTextWithCaret = StringBuilder(editor.document.text).insert(offset, EditorTestUtil.CARET_TAG).toString() + val actualTextWithCaret = StringBuilder(editor_.document.text).insert(offset, EditorTestUtil.CARET_TAG).toString() KotlinTestUtils.assertEqualsToFile(File(afterFilePath), actualTextWithCaret) }