@@ -87,10 +87,8 @@ public void visitFieldDefinition(@NotNull GraphQLFieldDefinition fieldDefinition
8787
8888 @ Override
8989 public void visitInputValueDefinition (@ NotNull GraphQLInputValueDefinition element ) {
90-
9190 // first reset the bold font display from keywords such as input/type being used as field name
92- Annotation annotation = holder .createInfoAnnotation (element .getNameIdentifier (), null );
93- annotation .setEnforcedTextAttributes (TextAttributes .ERASE_MARKER );
91+ resetAttributes (element .getNameIdentifier (), holder );
9492
9593 final GraphQLArgumentsDefinition arguments = PsiTreeUtil .getParentOfType (element , GraphQLArgumentsDefinition .class );
9694 if (arguments != null ) {
@@ -104,10 +102,8 @@ public void visitInputValueDefinition(@NotNull GraphQLInputValueDefinition eleme
104102
105103 @ Override
106104 public void visitArgument (@ NotNull GraphQLArgument argument ) {
107-
108105 // first reset the bold font display from keywords such as input/type being used as argument name
109- Annotation annotation = holder .createInfoAnnotation (argument .getNameIdentifier (), null );
110- annotation .setEnforcedTextAttributes (TextAttributes .ERASE_MARKER );
106+ resetAttributes (argument .getNameIdentifier (), holder );
111107
112108 // then apply argument font style
113109 applyTextAttributes (argument .getNameIdentifier (), ARGUMENT );
@@ -150,8 +146,7 @@ public void visitDirective(@NotNull GraphQLDirective directive) {
150146 @ Override
151147 public void visitObjectField (@ NotNull GraphQLObjectField objectField ) {
152148 // first reset the bold font display from keywords such as input/type being used as object field name
153- Annotation annotation = holder .createInfoAnnotation (objectField .getNameIdentifier (), null );
154- annotation .setEnforcedTextAttributes (TextAttributes .ERASE_MARKER );
149+ resetAttributes (objectField .getNameIdentifier (), holder );
155150
156151 // then apply argument font style
157152 applyTextAttributes (objectField .getNameIdentifier (), ARGUMENT );
@@ -164,4 +159,9 @@ private void applyTextAttributes(@Nullable PsiElement element, @NotNull TextAttr
164159 }
165160 });
166161 }
162+
163+ private void resetAttributes (@ NotNull PsiElement element , @ NotNull AnnotationHolder holder ) {
164+ Annotation annotation = holder .createInfoAnnotation (element , null );
165+ annotation .setEnforcedTextAttributes (TextAttributes .ERASE_MARKER );
166+ }
167167}
0 commit comments