File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/com/magento/idea/magento2plugin/stubs/indexes/graphql Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 88import com .intellij .lang .jsgraphql .psi .*;
99import com .intellij .openapi .vfs .VirtualFile ;
1010import com .intellij .psi .PsiElement ;
11+ import com .intellij .psi .PsiFile ;
1112import com .intellij .psi .PsiManager ;
1213import com .intellij .psi .search .GlobalSearchScope ;
1314import com .intellij .util .indexing .*;
@@ -127,10 +128,12 @@ public static List<GraphQLQuotedString> getGraphQLUsages(@NotNull PhpClass phpCl
127128
128129 PsiManager psiManager = PsiManager .getInstance (phpClass .getProject ());
129130 for (VirtualFile virtualFile : containingFiles ) {
130- GraphQLFile file = (GraphQLFile ) psiManager .findFile (virtualFile );
131- if (file == null ) {
131+ final PsiFile fileCandidate = psiManager .findFile (virtualFile );
132+
133+ if (!(fileCandidate instanceof GraphQLFile )) {
132134 continue ;
133135 }
136+ GraphQLFile file = (GraphQLFile ) fileCandidate ;
134137 PsiElement [] children = file .getChildren ();
135138 findMatchingQuotedString (children , classFqn , quotedStrings );
136139 }
You can’t perform that action at this time.
0 commit comments