|
20 | 20 | import com.intellij.lang.jsgraphql.ide.actions.GraphQLEditConfigAction; |
21 | 21 | import com.intellij.lang.jsgraphql.ide.actions.GraphQLExecuteEditorAction; |
22 | 22 | import com.intellij.lang.jsgraphql.ide.actions.GraphQLToggleVariablesAction; |
23 | | -import com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionService; |
24 | 23 | import com.intellij.lang.jsgraphql.ide.highlighting.query.GraphQLQueryContext; |
25 | 24 | import com.intellij.lang.jsgraphql.ide.highlighting.query.GraphQLQueryContextHighlightVisitor; |
| 25 | +import com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionService; |
26 | 26 | import com.intellij.lang.jsgraphql.ide.notifications.GraphQLNotificationUtil; |
27 | 27 | import com.intellij.lang.jsgraphql.ide.project.graphqlconfig.GraphQLConfigManager; |
28 | 28 | import com.intellij.lang.jsgraphql.ide.project.graphqlconfig.GraphQLConfigurationListener; |
@@ -170,9 +170,12 @@ private void reloadEndpoints() { |
170 | 170 | if (myProject.isDisposed()) return; |
171 | 171 | final FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject); |
172 | 172 | final GraphQLConfigManager graphQLConfigManager = GraphQLConfigManager.getService(myProject); |
173 | | - List<VirtualFile> files = Arrays.stream(fileEditorManager.getOpenFiles()) |
174 | | - .filter(f -> GraphQLFileType.isGraphQLFile(myProject, f)) |
175 | | - .collect(Collectors.toList()); |
| 173 | + List<VirtualFile> files = ReadAction.compute( |
| 174 | + () -> Arrays.stream(fileEditorManager.getOpenFiles()) |
| 175 | + .filter(f -> GraphQLFileType.isGraphQLFile(myProject, f)) |
| 176 | + .collect(Collectors.toList()) |
| 177 | + ); |
| 178 | + if (myProject.isDisposed()) return; |
176 | 179 |
|
177 | 180 | for (VirtualFile file : files) { |
178 | 181 | List<GraphQLConfigEndpoint> endpoints = |
|
0 commit comments