diff --git a/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java b/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java
index d1853fce045b..c7060b7dc22f 100644
--- a/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java
+++ b/plugins/properties/src/com/intellij/lang/properties/PropertiesDocumentationProvider.java
@@ -27,6 +27,7 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.ui.GuiUtils;
import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
@@ -35,16 +36,25 @@ public class PropertiesDocumentationProvider extends AbstractDocumentationProvid
@Nullable
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
if (element instanceof IProperty) {
- @NonNls String info = "\n\"" + ((IProperty)element).getValue() + "\"";
- PsiFile file = element.getContainingFile();
- if (file != null) {
- info += " [" + file.getName() + "]";
- }
- return info;
+ return "\"" + renderPropertyValue((IProperty)element) + "\"" + getLocationString(element);
}
return null;
}
+ private static String getLocationString(PsiElement element) {
+ PsiFile file = element.getContainingFile();
+ return file != null ? " [" + file.getName() + "]" : "";
+ }
+
+ @NotNull
+ private static String renderPropertyValue(IProperty prop) {
+ String raw = prop.getValue();
+ if (raw == null) {
+ return "empty";
+ }
+ return StringUtil.escapeXml(raw);
+ }
+
public String generateDoc(final PsiElement element, final PsiElement originalElement) {
if (element instanceof IProperty) {
IProperty property = (IProperty)element;
@@ -63,11 +73,8 @@ public class PropertiesDocumentationProvider extends AbstractDocumentationProvid
info += "";
}
}
- info += "\n" + property.getName() + "=\"" + ((IProperty)element).getValue() + "\"";
- PsiFile file = element.getContainingFile();
- if (file != null) {
- info += " [" + file.getName() + "]";
- }
+ info += "\n" + property.getName() + "=\"" + renderPropertyValue(((IProperty)element)) + "\"";
+ info += getLocationString(element);
return info;
}
return null;