use of com.intellij.lang.properties.editor.PropertiesValueHighlighter in project intellij-community by JetBrains.
the class PropertiesAnnotator method annotate.
public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
if (!(element instanceof IProperty))
return;
final Property property = (Property) element;
PropertiesFile propertiesFile = property.getPropertiesFile();
Collection<IProperty> others = propertiesFile.findPropertiesByKey(property.getUnescapedKey());
ASTNode keyNode = ((PropertyImpl) property).getKeyNode();
if (others.size() != 1) {
Annotation annotation = holder.createErrorAnnotation(keyNode, PropertiesBundle.message("duplicate.property.key.error.message"));
annotation.registerFix(PropertiesQuickFixFactory.getInstance().createRemovePropertyFix(property));
}
highlightTokens(property, keyNode, holder, new PropertiesHighlighter());
ASTNode valueNode = ((PropertyImpl) property).getValueNode();
if (valueNode != null) {
highlightTokens(property, valueNode, holder, new PropertiesValueHighlighter());
}
}
Aggregations