From a38651c1ec7467cc0307130fe7685f518384cf3a Mon Sep 17 00:00:00 2001 From: Roman Golyshev Date: Fri, 23 Aug 2019 22:20:06 +0300 Subject: [PATCH] KT-32366: Add missing 182 bunch file for the `foldingTestUtils.kt` --- .../idea/scratch/foldingTestUtils.kt.182 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 idea/tests/org/jetbrains/kotlin/idea/scratch/foldingTestUtils.kt.182 diff --git a/idea/tests/org/jetbrains/kotlin/idea/scratch/foldingTestUtils.kt.182 b/idea/tests/org/jetbrains/kotlin/idea/scratch/foldingTestUtils.kt.182 new file mode 100644 index 00000000000..7ac0f2186be --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/scratch/foldingTestUtils.kt.182 @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2019 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.scratch + +import com.intellij.openapi.editor.Editor +import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl + +fun getFoldingData(topEditor: Editor, withCollapseStatus: Boolean): String { + return CodeInsightTestFixtureImpl.getTagsFromSegments( + topEditor.document.text, + topEditor.foldingModel.allFoldRegions.asList(), + "fold" + ) { foldRegion -> + """text='${foldRegion.placeholderText}'${if (withCollapseStatus) """ expand='${foldRegion.isExpanded}'""" else ""}""" + } +}