File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
src/main/com/intellij/lang/jsgraphql/ide/annotator Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 1212import com .intellij .lang .jsgraphql .JSGraphQLKeywords ;
1313import com .intellij .lang .jsgraphql .JSGraphQLTokenTypes ;
1414import com .intellij .lang .jsgraphql .psi .JSGraphQLElementType ;
15- import com .intellij .lang .jsgraphql .psi .JSGraphQLFile ;
1615import com .intellij .lang .jsgraphql .psi .JSGraphQLPsiElement ;
1716import com .intellij .lang .jsgraphql .schema .psi .JSGraphQLSchemaFile ;
1817import com .intellij .psi .PsiElement ;
2120import org .jetbrains .annotations .NotNull ;
2221
2322/**
24- * Warns about using the Schema IDL in regular GraphQL files, and vice versa .
23+ * Warns about using the GraphQL operations in GraphQL IDL files (.graphqls) .
2524 */
2625public class JSGraphQLLanguageWarningAnnotator {
2726
2827 public Annotation annotate (PsiFile file , @ NotNull PsiElement element , @ NotNull AnnotationHolder holder ) {
29- if (file instanceof JSGraphQLFile ) {
30- if (element .getNode ().getElementType () == JSGraphQLTokenTypes .KEYWORD ) {
31- if (JSGraphQLKeywords .SCHEMA_DEFINITION_KEYWORDS .contains (element .getNode ().getText ())) {
32- return holder .createWarningAnnotation (element , "Schema definitions should be written in GraphQL Schema files (.graphqls)" );
33- }
34- }
35- } else if (file instanceof JSGraphQLSchemaFile ) {
28+ if (file instanceof JSGraphQLSchemaFile ) {
3629 if (element .getNode ().getElementType () == JSGraphQLTokenTypes .KEYWORD ) {
3730 if (JSGraphQLKeywords .GRAPHQL_ROOT_KEYWORDS .contains (element .getNode ().getText ())) {
3831 JSGraphQLPsiElement parent = PsiTreeUtil .getParentOfType (element , JSGraphQLPsiElement .class );
You can’t perform that action at this time.
0 commit comments