Search in sources :

Example 1 with JavaCodeFoldingSettingsImpl

use of com.intellij.codeInsight.folding.impl.JavaCodeFoldingSettingsImpl in project kotlin by JetBrains.

the class AbstractKotlinFoldingTest method doTestWithSettings.

protected static void doTestWithSettings(@NotNull String fileText, @NotNull Function<String, Void> runnable) {
    JavaCodeFoldingSettings settings = JavaCodeFoldingSettings.getInstance();
    JavaCodeFoldingSettingsImpl restoreSettings = new JavaCodeFoldingSettingsImpl();
    restoreSettings.loadState((JavaCodeFoldingSettingsImpl) settings);
    try {
        SettingsConfigurator configurator = new SettingsConfigurator(fileText, settings);
        configurator.configureSettings();
        runnable.apply(fileText);
    } finally {
        ((JavaCodeFoldingSettingsImpl) JavaCodeFoldingSettings.getInstance()).loadState(restoreSettings);
    }
}
Also used : SettingsConfigurator(org.jetbrains.kotlin.test.SettingsConfigurator) JavaCodeFoldingSettingsImpl(com.intellij.codeInsight.folding.impl.JavaCodeFoldingSettingsImpl) JavaCodeFoldingSettings(com.intellij.codeInsight.folding.JavaCodeFoldingSettings)

Aggregations

JavaCodeFoldingSettings (com.intellij.codeInsight.folding.JavaCodeFoldingSettings)1 JavaCodeFoldingSettingsImpl (com.intellij.codeInsight.folding.impl.JavaCodeFoldingSettingsImpl)1 SettingsConfigurator (org.jetbrains.kotlin.test.SettingsConfigurator)1