mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-180276 Broken generics parameter type for completion
This commit is contained in:
+3
-1
@@ -21,6 +21,7 @@ import com.intellij.openapi.editor.Inlay;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.PsiImplUtil;
|
||||
import com.intellij.psi.impl.source.resolve.CompletionParameterTypeInferencePolicy;
|
||||
@@ -586,7 +587,8 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
|
||||
}
|
||||
if (context.isSingleParameterInfo()) buffer.append("<b>");
|
||||
appendModifierList(buffer, param);
|
||||
buffer.append(paramType.getPresentableText(true));
|
||||
String type = paramType.getPresentableText(true);
|
||||
buffer.append(context.isSingleParameterInfo() ? StringUtil.escapeXml(type) : type);
|
||||
String name = param.getName();
|
||||
if (name != null && !context.isSingleParameterInfo()) {
|
||||
buffer.append(" ");
|
||||
|
||||
+7
@@ -708,6 +708,13 @@ public class CompletionHintsTest extends LightFixtureCompletionTestCase {
|
||||
checkResultWithInlays("class C { void m() { String local = \"a\"; String local2 = \"b\"; System.getProperty(<hint text=\"key:\"/>local, <HINT text=\"def:\"/><caret>) } }");
|
||||
}
|
||||
|
||||
public void testGenericType() throws Exception {
|
||||
configureJava("class C { void abcd(Class<?> c) {} void m() { abc<caret> } }");
|
||||
complete();
|
||||
waitForAllAsyncStuff();
|
||||
checkHintContents("<html><b>Class<?></b></html>");
|
||||
}
|
||||
|
||||
private void checkResult(String text) {
|
||||
myFixture.checkResult(text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user