mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-136397 Close brace in try resource block
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void m() {
|
||||
try (<caret>){
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
void m() {
|
||||
try <caret>{
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,10 @@ public class JavaTypingTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
doTest('{');
|
||||
}
|
||||
|
||||
public void testInsertPairParenBeforeTryBlock() {
|
||||
doTest('(');
|
||||
}
|
||||
|
||||
private void doTest(char c) {
|
||||
myFixture.configureByFile(getTestName(true) + "_before.java");
|
||||
myFixture.type(c);
|
||||
|
||||
@@ -339,13 +339,9 @@ public class TypedHandler extends TypedActionHandlerBase {
|
||||
if (!iterator.atEnd()) {
|
||||
iterator.advance();
|
||||
|
||||
if (!iterator.atEnd()) {
|
||||
if (!BraceMatchingUtil.isPairedBracesAllowedBeforeTypeInFileType(braceTokenType, iterator.getTokenType(), fileType)) {
|
||||
return;
|
||||
}
|
||||
if (BraceMatchingUtil.isLBraceToken(iterator, fileText, fileType)) {
|
||||
return;
|
||||
}
|
||||
if (!iterator.atEnd() &&
|
||||
!BraceMatchingUtil.isPairedBracesAllowedBeforeTypeInFileType(braceTokenType, iterator.getTokenType(), fileType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
iterator.retreat();
|
||||
|
||||
Reference in New Issue
Block a user