Corrected parameters order, which caused extra spaces formatting when performed on selected fragment. Formatter depending on the result of FormatterUtil.isFormatterCalledExplicitly decides whether to cut trailing spaces or not, and command name mismatch eliminated range correction. Test added.

This commit is contained in:
Yaroslav Lepenkin
2015-03-23 20:34:19 +03:00
parent 76bed82666
commit 8e9aff7916
4 changed files with 26 additions and 1 deletions
@@ -0,0 +1,10 @@
public class T {
public void tutu() {
}
public void test() {}
}
@@ -0,0 +1,10 @@
public class T {
<selection> public void tutu() {
}</selection>
public void test() {}
}
@@ -102,4 +102,9 @@ public class ReformatCodeActionInEditorTest extends LightPlatformCodeInsightFixt
public void testFormatOptimizeRearrangeVcsChanges() {
doTest(new ReformatCodeRunOptions(VCS_CHANGED_TEXT).setOptimizeImports(true).setRearrangeCode(true));
}
public void testFormatSelection_DoNotTouchTrailingWhiteSpaces() {
//todo actually test is not working, and working test is not working
doTest(new ReformatCodeRunOptions(SELECTED_TEXT));
}
}