mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-89212 Quick doc: Don't show markup elements at the 'on mouse hover' hint
This commit is contained in:
@@ -1496,7 +1496,7 @@ public class JavaDocInfoGenerator {
|
||||
@SuppressWarnings({"HardCodedStringLiteral"})
|
||||
public static int generateType(StringBuilder buffer, PsiType type, PsiElement context, boolean generateLink) {
|
||||
if (type instanceof PsiPrimitiveType) {
|
||||
String text = type.getCanonicalText();
|
||||
String text = StringUtil.escapeXml(type.getCanonicalText());
|
||||
buffer.append(text);
|
||||
return text.length();
|
||||
}
|
||||
@@ -1539,7 +1539,7 @@ public class JavaDocInfoGenerator {
|
||||
PsiSubstitutor psiSubst = result.getSubstitutor();
|
||||
|
||||
if (psiClass == null) {
|
||||
String text = "<font color=red>" + type.getCanonicalText() + "</font>";
|
||||
String text = "<font color=red>" + StringUtil.escapeXml(type.getCanonicalText()) + "</font>";
|
||||
buffer.append(text);
|
||||
return text.length();
|
||||
}
|
||||
@@ -1547,7 +1547,7 @@ public class JavaDocInfoGenerator {
|
||||
String qName = psiClass.getQualifiedName();
|
||||
|
||||
if (qName == null || psiClass instanceof PsiTypeParameter) {
|
||||
String text = type.getCanonicalText();
|
||||
String text = StringUtil.escapeXml(type.getCanonicalText());
|
||||
buffer.append(text);
|
||||
return text.length();
|
||||
}
|
||||
@@ -1596,7 +1596,7 @@ public class JavaDocInfoGenerator {
|
||||
|
||||
if (type instanceof PsiDisjunctionType) {
|
||||
if (!generateLink) {
|
||||
final String text = type.getCanonicalText();
|
||||
final String text = StringUtil.escapeXml(type.getCanonicalText());
|
||||
buffer.append(text);
|
||||
return text.length();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -72,26 +72,25 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
|
||||
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
String navigateInfo = null;
|
||||
if (element instanceof PsiClass) {
|
||||
navigateInfo = generateClassInfo((PsiClass)element);
|
||||
return generateClassInfo((PsiClass)element);
|
||||
}
|
||||
else if (element instanceof PsiMethod) {
|
||||
navigateInfo = generateMethodInfo((PsiMethod)element, calcSubstitutor(originalElement));
|
||||
return generateMethodInfo((PsiMethod)element, calcSubstitutor(originalElement));
|
||||
}
|
||||
else if (element instanceof PsiField) {
|
||||
navigateInfo = generateFieldInfo((PsiField)element, calcSubstitutor(originalElement));
|
||||
return generateFieldInfo((PsiField)element, calcSubstitutor(originalElement));
|
||||
}
|
||||
else if (element instanceof PsiVariable) {
|
||||
navigateInfo = generateVariableInfo((PsiVariable)element);
|
||||
return generateVariableInfo((PsiVariable)element);
|
||||
}
|
||||
else if (element instanceof PsiPackage) {
|
||||
navigateInfo = generatePackageInfo((PsiPackage)element);
|
||||
return generatePackageInfo((PsiPackage)element);
|
||||
}
|
||||
else if (element instanceof BeanPropertyElement) {
|
||||
navigateInfo = generateMethodInfo(((BeanPropertyElement) element).getMethod(), PsiSubstitutor.EMPTY);
|
||||
return generateMethodInfo(((BeanPropertyElement) element).getMethod(), PsiSubstitutor.EMPTY);
|
||||
}
|
||||
return StringUtil.escapeXml(StringUtil.unescapeXml(navigateInfo));
|
||||
return null;
|
||||
}
|
||||
|
||||
private static PsiSubstitutor calcSubstitutor(PsiElement originalElement) {
|
||||
|
||||
Reference in New Issue
Block a user