mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-74354 Multiline parameteres list indentation inconsistency
This commit is contained in:
@@ -23,6 +23,7 @@ import com.intellij.formatting.Wrap;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.patterns.PlatformPatterns;
|
||||
import com.intellij.psi.PsiComment;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -275,8 +276,10 @@ public class GroovyBlockGenerator implements GroovyElementTypes {
|
||||
}
|
||||
|
||||
private static boolean isKeyword(ASTNode node) {
|
||||
return node != null && (TokenSets.KEYWORDS.contains(node.getElementType()) ||
|
||||
TokenSets.BRACES.contains(node.getElementType()));
|
||||
if (node == null) return false;
|
||||
|
||||
return TokenSets.KEYWORDS.contains(node.getElementType()) ||
|
||||
TokenSets.BRACES.contains(node.getElementType()) && !PlatformPatterns.psiElement().withText(")").withParent(GrArgumentList.class).afterLeaf(",").accepts(node.getPsi());
|
||||
}
|
||||
|
||||
|
||||
|
||||
+18
@@ -203,5 +203,23 @@ def c = { a ->
|
||||
"""
|
||||
}
|
||||
|
||||
public void testEnterWithAlignedParameters() {
|
||||
myTempSettings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true
|
||||
doTest """foo(2,<caret>)
|
||||
""", """foo(2,
|
||||
<caret>)
|
||||
"""
|
||||
|
||||
}
|
||||
|
||||
public void testEnterWithAlignedParameters2() {
|
||||
myTempSettings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true
|
||||
doTest """foo(2,<caret>
|
||||
""", """foo(2,
|
||||
<caret>
|
||||
"""
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user