Javascript Reference Contributor
Hi guys, sorry for this question, it looks pretty simple but still I can not do it workable
I am trying to create javascript reference contributor to navigate from javascript to some php entities (plugin for PhpStorm)
For the first I declared it in this way
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
registrar.registerReferenceProvider(
PlatformPatterns.psiElement(JSLiteralExpression.class).and(new FilterPattern(new ElementFilter() {
public boolean isAcceptable(Object element, PsiElement context) {
return ((JSLiteralExpression)element).isQuotedLiteral();
}
public boolean isClassAcceptable(Class hintClass) {
return true;
}
})),
new PsiReferenceProvider() {
@NotNull
public PsiReference[] getReferencesByElement(@NotNull PsiElement psiElement, @NotNull ProcessingContext processingContext) {
String rawText = psiElement.getText();
String text = StringUtil.unquoteString(rawText);
return PsiReference.EMPTY_ARRAY;
}
});
}
My debugger stops on the line
registrar.registerReferenceProvider
but never visited the method
getReferencesByElement
What I am doing wrong? Maybe some conflict with internal javascript contributors?
Please sign in to leave a comment.
My fault! I forgot to add dependency in my plugin