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 12
12
import com .intellij .lang .jsgraphql .JSGraphQLKeywords ;
13
13
import com .intellij .lang .jsgraphql .JSGraphQLTokenTypes ;
14
14
import com .intellij .lang .jsgraphql .psi .JSGraphQLElementType ;
15
- import com .intellij .lang .jsgraphql .psi .JSGraphQLFile ;
16
15
import com .intellij .lang .jsgraphql .psi .JSGraphQLPsiElement ;
17
16
import com .intellij .lang .jsgraphql .schema .psi .JSGraphQLSchemaFile ;
18
17
import com .intellij .psi .PsiElement ;
21
20
import org .jetbrains .annotations .NotNull ;
22
21
23
22
/**
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) .
25
24
*/
26
25
public class JSGraphQLLanguageWarningAnnotator {
27
26
28
27
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 ) {
36
29
if (element .getNode ().getElementType () == JSGraphQLTokenTypes .KEYWORD ) {
37
30
if (JSGraphQLKeywords .GRAPHQL_ROOT_KEYWORDS .contains (element .getNode ().getText ())) {
38
31
JSGraphQLPsiElement parent = PsiTreeUtil .getParentOfType (element , JSGraphQLPsiElement .class );
You can’t perform that action at this time.
0 commit comments