mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
folding builder style setters (IDEA-86541)
This commit is contained in:
@@ -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 = """\
|
||||
|
||||
Reference in New Issue
Block a user