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 44
44
import com .intellij .psi .search .GlobalSearchScope ;
45
45
import com .intellij .psi .search .GlobalSearchScopesCore ;
46
46
import com .intellij .psi .search .scope .packageSet .NamedScope ;
47
+ import com .intellij .psi .util .PsiTreeUtil ;
47
48
import com .intellij .testFramework .LightVirtualFile ;
48
49
import com .intellij .util .Processor ;
49
50
import com .intellij .util .indexing .FileBasedIndex ;
@@ -183,8 +184,8 @@ public List<GraphQLFragmentDefinition> getKnownFragmentDefinitions(PsiElement sc
183
184
final List <GraphQLFragmentDefinition > fragmentDefinitions = Lists .newArrayList ();
184
185
GlobalSearchScope schemaScope = getSchemaScope (scopedElement );
185
186
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 ));
188
189
}
189
190
190
191
final PsiManager psiManager = PsiManager .getInstance (myProject );
You can’t perform that action at this time.
0 commit comments