Resolve references from custom language

The string element you’re trying to resolve in the sample is a PsiLiteralExpression, which appears to be one of the classes that getReferencesByElement() can accept.

Although the exact rules aren’t clear, an element seems to be passed to getReferencesByElement() if it (1) inherits from certain PSI classes or (2) overrides PsiElement.getReferences() as shown below. (This is the technique I used to enable reference resolution for elements in my own custom language.)

@Override
public @NotNull PsiReference[] getReferences() {
  return ReferenceProvidersRegistry.getReferencesFromProviders(this);
}

With that in mind, would it be possible to create a custom PSI element class for a dummy call, then have your injection recognize that element type and add the above overrides?