diff --git a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCase.kt b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCase.kt index af3ab74b84..1d3920c0ea 100644 --- a/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCase.kt +++ b/src/testFixtures/kotlin/org/jetbrains/plugins/ideavim/VimTestCase.kt @@ -10,6 +10,7 @@ package org.jetbrains.plugins.ideavim import com.intellij.application.options.CodeStyle import com.intellij.ide.ClipboardSynchronizer import com.intellij.ide.bookmark.BookmarksManager +import com.intellij.ide.highlighter.JavaFileType import com.intellij.ide.highlighter.XmlFileType import com.intellij.lang.Language import com.intellij.openapi.actionSystem.ActionManager @@ -301,6 +302,7 @@ abstract class VimTestCase(private val defaultEditorText: String? = null) { protected fun configureByText(content: String) = configureByText(PlainTextFileType.INSTANCE, content) protected fun configureByXmlText(content: String) = configureByText(XmlFileType.INSTANCE, content) + protected fun configureByJavaText(content: String) = configureByText(JavaFileType.INSTANCE, content) protected fun configureAndGuard(content: String) { val ranges = extractBrackets(content) diff --git a/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt b/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt index b1e0ab0a8b..23b4de8da3 100644 --- a/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt +++ b/tests/java-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/VimJavaTestCase.kt @@ -8,8 +8,17 @@ package org.jetbrains.plugins.ideavim -import com.intellij.ide.highlighter.JavaFileType - -abstract class VimJavaTestCase : VimTestCase() { - protected fun configureByJavaText(content: String) = configureByText(JavaFileType.INSTANCE, content) -} \ No newline at end of file +/** + * Base test case for tests that require Java file type support. + * + * This class extends [VimTestCase] and is specifically designed for tests that need to work with + * Java source files, where language-specific features like auto-indentation, code folding, or + * syntax-aware operations are required. + * + * Tests can use the inherited [configureByJavaText] method from [VimTestCase] to set up Java files. + * This class serves as a semantic marker and provides a convenient base for Java-specific test setup + * if needed in the future. + * + * @see VimTestCase + */ +abstract class VimJavaTestCase : VimTestCase() \ No newline at end of file diff --git a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt index be3cd9183e..3a191123c7 100644 --- a/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt +++ b/tests/property-tests/src/test/kotlin/org/jetbrains/plugins/ideavim/propertybased/VimPropertyTestBase.kt @@ -8,7 +8,6 @@ package org.jetbrains.plugins.ideavim.propertybased -import com.intellij.ide.highlighter.JavaFileType import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.editor.Editor import com.maddyhome.idea.vim.KeyHandler @@ -40,6 +39,4 @@ abstract class VimPropertyTestBase : VimTestCase() { VimPlugin.getSearch().resetState() VimPlugin.getChange().reset() } - - protected fun configureByJavaText(content: String) = configureByText(JavaFileType.INSTANCE, content) }