protected boolean handleSeparatorElement(@NotNull PsiElement element, @NotNull AnnotationHolder holder, IElementType elementType, CsvFile csvFile) {
if (elementType == CsvTypes.COMMA) {
TextAttributes textAttributes = holder.getCurrentAnnotationSession().getUserData(TAB_SEPARATOR_HIGHLIGHT_COLOR_KEY);
if (!Boolean.TRUE.equals(holder.getCurrentAnnotationSession().getUserData(TAB_SEPARATOR_HIGHLIGHT_COLOR_DETERMINED_KEY))) {
String separator = CsvCodeStyleSettings.getCurrentSeparator(csvFile.getProject(), csvFile.getLanguage());
if (CsvEditorSettingsExternalizable.getInstance().isHighlightTabSeparator() && separator.equals(CsvCodeStyleSettings.TAB_SEPARATOR)) {
textAttributes = new TextAttributes(null,
CsvEditorSettingsExternalizable.getInstance().getTabHighlightColor(),
null, null, 0);
holder.getCurrentAnnotationSession().putUserData(TAB_SEPARATOR_HIGHLIGHT_COLOR_KEY, textAttributes);
holder.getCurrentAnnotationSession().putUserData(TAB_SEPARATOR_HIGHLIGHT_COLOR_DETERMINED_KEY, Boolean.TRUE);
}
}
if (textAttributes != null) {
Annotation annotation = holder.createAnnotation(
CSV_COLUMN_INFO_SEVERITY,
element.getTextRange(),
showInfoBalloon(holder.getCurrentAnnotationSession()) ? "↹" : null
);
annotation.setEnforcedTextAttributes(textAttributes);
annotation.setNeedsUpdateOnTyping(false);
}
return true;
}
return false;
}