mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
IDEA-113710 Complete Current Statement broken for generic methods
This commit is contained in:
@@ -3,6 +3,7 @@ package com.intellij.codeInsight.editorActions.smartEnter;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiTypeParameter;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
|
||||
/**
|
||||
@@ -11,7 +12,7 @@ import com.intellij.util.IncorrectOperationException;
|
||||
public class MissingClassBodyFixer implements Fixer {
|
||||
@Override
|
||||
public void apply(Editor editor, JavaSmartEnterProcessor processor, PsiElement psiElement) throws IncorrectOperationException {
|
||||
if (!(psiElement instanceof PsiClass)) return;
|
||||
if (!(psiElement instanceof PsiClass) || psiElement instanceof PsiTypeParameter) return;
|
||||
PsiClass psiClass = (PsiClass) psiElement;
|
||||
|
||||
if (psiClass.getLBrace() == null) {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
public class Foo {
|
||||
<T> T foo(<caret>)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Foo {
|
||||
<T> T foo() {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
@@ -252,6 +252,8 @@ public class CompleteStatementTest extends EditorActionTestCase {
|
||||
|
||||
public void testCompleteMethodCallAtReturn() throws Exception { doTest(); }
|
||||
|
||||
public void testGenericMethodBody() throws Exception { doTest(); }
|
||||
|
||||
private void doTestBracesNextLineStyle() throws Exception {
|
||||
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
|
||||
settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;
|
||||
|
||||
Reference in New Issue
Block a user