mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-51918 Smart enter moves caret to parent code block in Groovy
This commit is contained in:
+1
-1
@@ -266,7 +266,7 @@ public class GroovySmartEnterProcessor extends SmartEnterProcessor {
|
||||
if (statementAtCaret instanceof GrBlockStatement) return null;
|
||||
if (statementAtCaret == null) return null;
|
||||
|
||||
GrControlStatement controlStatement = PsiTreeUtil.getParentOfType(statementAtCaret, GrControlStatement.class);
|
||||
GrControlStatement controlStatement = PsiTreeUtil.getParentOfType(statementAtCaret, GrControlStatement.class, false);
|
||||
|
||||
if (controlStatement != null && !PsiTreeUtil.hasErrorElements(statementAtCaret)) {
|
||||
return controlStatement;
|
||||
|
||||
@@ -37,6 +37,7 @@ public class SmartEnterTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testMissRQuoteInCompStr() throws Throwable { doTest(); }
|
||||
|
||||
public void testGotoNextLineInFor() throws Throwable { doTest(); }
|
||||
public void testGotoParentInIf() throws Throwable { doTest(); }
|
||||
|
||||
protected static List<SmartEnterProcessor> getSmartProcessors(Language grLanguage) {
|
||||
return SmartEnterProcessors.INSTANCE.forKey(grLanguage);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
if (suitable) {
|
||||
expectations.each {pattern, action ->
|
||||
if (cloud.match(pattern, action))<caret>
|
||||
}
|
||||
}
|
||||
-----
|
||||
if (suitable) {
|
||||
expectations.each {pattern, action ->
|
||||
if (cloud.match(pattern, action)) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
def promote(List active) {
|
||||
if (f) {
|
||||
active.removeLast()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user