File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/com/intellij/lang/jsgraphql/ide/project Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 4444import com .intellij .psi .search .GlobalSearchScope ;
4545import com .intellij .psi .search .GlobalSearchScopesCore ;
4646import com .intellij .psi .search .scope .packageSet .NamedScope ;
47+ import com .intellij .psi .util .PsiTreeUtil ;
4748import com .intellij .testFramework .LightVirtualFile ;
4849import com .intellij .util .Processor ;
4950import com .intellij .util .indexing .FileBasedIndex ;
@@ -183,8 +184,8 @@ public List<GraphQLFragmentDefinition> getKnownFragmentDefinitions(PsiElement sc
183184 final List <GraphQLFragmentDefinition > fragmentDefinitions = Lists .newArrayList ();
184185 GlobalSearchScope schemaScope = getSchemaScope (scopedElement );
185186 if (GraphQLFileType .isGraphQLScratchFile (myProject , getVirtualFile (scopedElement .getContainingFile ()))) {
186- // include the fragments in the currently edited scratch file
187- schemaScope = schemaScope . union ( GlobalSearchScope . fileScope (scopedElement .getContainingFile ()));
187+ // include the fragments defined in the currently edited scratch file (scratch files don't appear to be indexed)
188+ fragmentDefinitions . addAll ( PsiTreeUtil . getChildrenOfTypeAsList (scopedElement .getContainingFile (). getOriginalFile (), GraphQLFragmentDefinition . class ));
188189 }
189190
190191 final PsiManager psiManager = PsiManager .getInstance (myProject );
You can’t perform that action at this time.
0 commit comments