@@ -65,14 +65,7 @@ public void annotate(@NotNull final PsiElement element, @NotNull final Annotatio
6565 textRange = TextRange .from (textRange .getStartOffset () - 1 , 1 );
6666 }
6767
68- final Annotation annotation =
69- new Annotation (
70- textRange .getStartOffset (),
71- textRange .getEndOffset (),
72- CSV_COLUMN_INFO_SEVERITY ,
73- message ,
74- tooltip
75- );
68+ final Annotation annotation = holder .createAnnotation (CSV_COLUMN_INFO_SEVERITY , textRange , message , tooltip );
7669 annotation .setEnforcedTextAttributes (
7770 CsvEditorSettings .getInstance ().getValueColoring () == CsvEditorSettings .ValueColoring .RAINBOW ?
7871 CsvColorSettings .getTextAttributesOfColumn (columnInfo .getColumnIndex (), holder .getCurrentAnnotationSession ()) :
@@ -106,14 +99,7 @@ protected boolean handleSeparatorElement(@NotNull PsiElement element, @NotNull A
10699 }
107100 if (textAttributes != null ) {
108101 final TextRange textRange = element .getTextRange ();
109- final Annotation annotation =
110- new Annotation (
111- textRange .getStartOffset (),
112- textRange .getEndOffset (),
113- CSV_COLUMN_INFO_SEVERITY ,
114- showInfoBalloon (holder .getCurrentAnnotationSession ()) ? "↹" : null ,
115- null
116- );
102+ final Annotation annotation = holder .createAnnotation (CSV_COLUMN_INFO_SEVERITY , textRange , showInfoBalloon (holder .getCurrentAnnotationSession ()) ? "↹" : null );
117103 annotation .setEnforcedTextAttributes (textAttributes );
118104 annotation .setNeedsUpdateOnTyping (false );
119105 }
0 commit comments