mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-66333 Quick documentation lookup on mouse hover
Use matchers in a thread-local manner
This commit is contained in:
@@ -55,8 +55,6 @@ public class JavaDocInfoGenerator {
|
||||
|
||||
private static final @NonNls Pattern ourNotDot = Pattern.compile("[^.]");
|
||||
private static final @NonNls Pattern ourWhitespaces = Pattern.compile("[ \\n\\r\\t]+");
|
||||
private static final @NonNls Matcher ourNotDotMatcher = ourNotDot.matcher("");
|
||||
private static final @NonNls Matcher ourWhitespacesMatcher = ourWhitespaces.matcher("");
|
||||
|
||||
private final Project myProject;
|
||||
private final PsiElement myElement;
|
||||
@@ -864,7 +862,7 @@ public class JavaDocInfoGenerator {
|
||||
String text = description.getText();
|
||||
|
||||
if (text != null) {
|
||||
if (ourWhitespacesMatcher.reset(text).replaceAll("").length() != 0) {
|
||||
if (ourWhitespaces.matcher(text).replaceAll("").length() != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -943,13 +941,16 @@ public class JavaDocInfoGenerator {
|
||||
LOG.error("Class or member expected but found " + myElement.getClass().getName());
|
||||
}
|
||||
|
||||
if (aClass == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String qName = aClass.getQualifiedName();
|
||||
|
||||
if (qName == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return "../" + ourNotDotMatcher.reset(qName).replaceAll("").replaceAll(".", "../");
|
||||
return "../" + ourNotDot.matcher(qName).replaceAll("").replaceAll(".", "../");
|
||||
}
|
||||
|
||||
private void generateValue(StringBuilder buffer,
|
||||
|
||||
Reference in New Issue
Block a user