folding builder style setters (IDEA-86541)

This commit is contained in:
Anna Kozlova
2012-05-25 15:56:41 +04:00
parent efcb13cdaa
commit 399c24c810
2 changed files with 23 additions and 1 deletions
@@ -168,6 +168,27 @@ class Test {
assertNotNull closureFolds
assertEquals(2, closureFolds.size())
}
public void "test builder style setter"() {
myFoldingSettings.COLLAPSE_ACCESSORS = true
def text = """\
class Foo {
private String bar;
public Foo setBar(String bar) {
this.bar = bar;
return this;
}
}
"""
configure text
def foldingModel = myFixture.editor.foldingModel as FoldingModelImpl
int indexOfBar = text.indexOf("this.bar")
def accessorStartFold = foldingModel.getCollapsedRegionAtOffset(indexOfBar)
assertNotNull accessorStartFold
assertFalse accessorStartFold.expanded
}
public void "test closure folding doesn't expand when editing inside"() {
def text = """\