mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed IDEA-208441 "//region" matches a wrong "//endregion" sometimes
GitOrigin-RevId: f2980e2d92050c5d4c90485955afe4365a033439
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9d2283f2cf
commit
216762f395
@@ -0,0 +1,9 @@
|
||||
public class Test {
|
||||
<fold text='First'>// region First
|
||||
<fold text='//...'>// void foo() {
|
||||
// // region MyRegion
|
||||
// System.out.print("Text");
|
||||
// // endregion
|
||||
// }</fold>
|
||||
// endregion</fold>
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import com.intellij.openapi.editor.ex.DocumentEx
|
||||
import com.intellij.openapi.editor.ex.EditorEx
|
||||
import com.intellij.openapi.editor.ex.FoldingListener
|
||||
import com.intellij.openapi.editor.ex.FoldingModelEx
|
||||
import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider
|
||||
import com.intellij.psi.JavaPsiFacade
|
||||
import com.intellij.psi.PsiClass
|
||||
import com.intellij.psi.PsiMethod
|
||||
@@ -382,6 +381,9 @@ class Test {
|
||||
}
|
||||
|
||||
public void testCustomFolding() { doTest() }
|
||||
|
||||
public void testCustomFoldingIdea208441() {doTest()}
|
||||
|
||||
public void testEmptyMethod() { doTest() }
|
||||
|
||||
private doTest() {
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class VisualStudioCustomFoldingProvider extends CustomFoldingProvider {
|
||||
|
||||
@Override
|
||||
public boolean isCustomRegionEnd(String elementText) {
|
||||
return elementText.contains("endregion");
|
||||
return elementText.contains("endregion") && elementText.matches("[/*#-]*\\s*endregion.*");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user