|
14 | 14 | import com.intellij.lang.jsgraphql.GraphQLSettings; |
15 | 15 | import com.intellij.lang.jsgraphql.endpoint.ide.project.JSGraphQLEndpointNamedTypeRegistry; |
16 | 16 | import com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionService; |
17 | | -import com.intellij.lang.jsgraphql.ide.search.GraphQLPsiSearchHelper; |
18 | 17 | import com.intellij.lang.jsgraphql.ide.project.graphqlconfig.GraphQLConfigManager; |
| 18 | +import com.intellij.lang.jsgraphql.ide.search.GraphQLPsiSearchHelper; |
19 | 19 | import com.intellij.lang.jsgraphql.psi.GraphQLFile; |
20 | 20 | import com.intellij.lang.jsgraphql.psi.GraphQLPsiUtil; |
21 | 21 | import com.intellij.lang.jsgraphql.types.GraphQLException; |
@@ -70,7 +70,8 @@ public static GraphQLRegistryProvider getInstance(@NotNull Project project) { |
70 | 70 | public GraphQLRegistryProvider(Project project) { |
71 | 71 | this.project = project; |
72 | 72 | graphQLFilesScope = GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(project), GraphQLFileType.INSTANCE); |
73 | | - jsonIntrospectionScope = GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.projectScope(project), JsonFileType.INSTANCE); |
| 73 | + jsonIntrospectionScope = GlobalSearchScope |
| 74 | + .getScopeRestrictedByFileTypes(GlobalSearchScope.projectScope(project), JsonFileType.INSTANCE); |
74 | 75 | psiManager = PsiManager.getInstance(project); |
75 | 76 | graphQLEndpointNamedTypeRegistry = JSGraphQLEndpointNamedTypeRegistry.getService(project); |
76 | 77 | graphQLPsiSearchHelper = GraphQLPsiSearchHelper.getInstance(project); |
@@ -127,7 +128,13 @@ public GraphQLRegistryInfo getRegistryInfo(@NotNull PsiElement scopedElement) { |
127 | 128 | } |
128 | 129 |
|
129 | 130 | TypeDefinitionRegistry registry = processor.getCompositeRegistry().buildTypeDefinitionRegistry(); |
130 | | - LOG.info(String.format("Registry build completed in %d ms", TimeoutUtil.getDurationMillis(start))); |
| 131 | + |
| 132 | + if (LOG.isDebugEnabled()) { |
| 133 | + long durationMillis = TimeoutUtil.getDurationMillis(start); |
| 134 | + VirtualFile file = GraphQLPsiUtil.getPhysicalVirtualFile(scopedElement.getContainingFile()); |
| 135 | + String requester = file != null ? file.getPath() : "<unknown>"; |
| 136 | + LOG.debug(String.format("Registry build completed in %d ms, requester: %s", durationMillis, requester)); |
| 137 | + } |
131 | 138 | return new GraphQLRegistryInfo(registry, errors, processor.isProcessed()); |
132 | 139 | }); |
133 | 140 |
|
@@ -171,7 +178,8 @@ private boolean processJsonFile(GraphQLSchemaDocumentProcessor processor, |
171 | 178 | } catch (SchemaProblem e) { |
172 | 179 | errors.add(e); |
173 | 180 | } catch (Exception e) { |
174 | | - final List<SourceLocation> sourceLocation = Collections.singletonList(new SourceLocation(1, 1, GraphQLPsiUtil.getFileName(psiFile))); |
| 181 | + final List<SourceLocation> sourceLocation = Collections.singletonList( |
| 182 | + new SourceLocation(1, 1, GraphQLPsiUtil.getFileName(psiFile))); |
175 | 183 | errors.add(new SchemaProblem(Collections.singletonList(new InvalidSyntaxError(sourceLocation, e.getMessage())))); |
176 | 184 | } |
177 | 185 | return true; |
|
0 commit comments