mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-119740 Ctrl+Shift+Space does not complete exception type after "final"
This commit is contained in:
+4
-4
@@ -302,10 +302,10 @@ public class JavaSmartCompletionContributor extends CompletionContributor {
|
||||
});
|
||||
|
||||
final Key<PsiTryStatement> tryKey = Key.create("try");
|
||||
extend(CompletionType.SMART, psiElement().afterLeaf(
|
||||
psiElement().withText("("))
|
||||
.withSuperParent(3, psiElement(PsiCatchSection.class).withParent(
|
||||
psiElement(PsiTryStatement.class).save(tryKey))), new CompletionProvider<CompletionParameters>() {
|
||||
extend(CompletionType.SMART, psiElement().insideStarting(
|
||||
psiElement(PsiTypeElement.class).withParent(
|
||||
psiElement(PsiCatchSection.class).withParent(
|
||||
psiElement(PsiTryStatement.class).save(tryKey)))), new CompletionProvider<CompletionParameters>() {
|
||||
@Override
|
||||
protected void addCompletions(@NotNull final CompletionParameters parameters, final ProcessingContext context, @NotNull final CompletionResultSet result) {
|
||||
final PsiCodeBlock tryBlock = context.get(tryKey).getTryBlock();
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class A{
|
||||
|
||||
{
|
||||
try{
|
||||
throw new Exception();
|
||||
}
|
||||
catch(final Exception <caret>)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A{
|
||||
|
||||
{
|
||||
try{
|
||||
throw new Exception();
|
||||
}
|
||||
catch(final <caret>)
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -317,7 +317,8 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
checkResultByFile(path + "/after2.java");
|
||||
}
|
||||
|
||||
public void testInsideCatch() throws Exception { doTest(); }
|
||||
public void testInsideCatch() { doTest(); }
|
||||
public void testInsideCatchFinal() { doTest(); }
|
||||
|
||||
public void testGenerics6() throws Exception {
|
||||
String path = "/generics";
|
||||
|
||||
Reference in New Issue
Block a user