I tried to provide references from the schema.graphqls
files to the corresponding classes (framework-dependent elements). However, the GraphQL plugin uses its own reference resolution mechanism there, and only the already supported PSI elements have reference resolution in that file, as seen in GraphQLReferenceService. I attempted to add support for custom elements via ReferenceContributor
, but it doesn’t work the same way because the GraphQL plugin doesn’t use something like ReferenceProvidersRegistry.getReferencesFromProviders(this)
.
I managed to get it working using the lang.directNavigationProvider
extension point. However, it is marked as @Experimental
, so I assume it’s not the best idea to rely on it just yet.
Could someone advise on how to provide custom references in such cases, where the language does not allow attaching them via ReferenceContributor
?
As a fallback, I’ll use the codeInsight.lineMarkerProvider
extension point. However, references are more appropriate in this context. I also want class references from GraphQL files to be recognized as used, to enable navigation back to their usages, and to ensure FQNs in GraphQL files are renamed automatically when the class is renamed.