mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-158497 "catch" completion of "try {}"
This commit is contained in:
@@ -164,7 +164,7 @@ public class PreferByKindWeigher extends LookupElementWeigher {
|
||||
isLastStatement(PsiTreeUtil.getParentOfType(myPosition, PsiStatement.class))) {
|
||||
return MyResult.probableKeyword;
|
||||
}
|
||||
if (PsiKeyword.ELSE.equals(keyword) || PsiKeyword.FINALLY.equals(keyword)) {
|
||||
if (PsiKeyword.ELSE.equals(keyword) || PsiKeyword.FINALLY.equals(keyword) || PsiKeyword.CATCH.equals(keyword)) {
|
||||
return MyResult.probableKeyword;
|
||||
}
|
||||
if (PsiKeyword.TRUE.equals(keyword) || PsiKeyword.FALSE.equals(keyword)) {
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class Log {
|
||||
{
|
||||
try {
|
||||
|
||||
} <caret>
|
||||
}
|
||||
}
|
||||
+4
@@ -781,4 +781,8 @@ class ContainerUtil extends ContainerUtilRt {
|
||||
assert (myFixture.lookupElements[0].psiElement as PsiMethod).containingClass.name == 'ContainerUtil'
|
||||
}
|
||||
|
||||
public void testPreferCatchAndFinallyAfterTry() {
|
||||
checkPreferredItems 0, 'catch', 'finally'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user