Hi I have a plugin that prior to thursday last week worked fine.
I have implemented four different custom languiages in my plugin.
.feature-model
.feature-to-file
.feature-to-folder
.feature-to-code (only used in injected context in code comments)
the feature-model holds the definitions of the psielement. All bnfs have this:
mixin=“se.isselab.HAnS.referencing.impl.FeatureAnnotationNamedElementImpl”
implements=“se.isselab.HAnS.referencing.FeatureAnnotationNamedElement”
and the reference contributor looks like this:
public class FeatureReferenceContributor extends PsiReferenceContributor {
private final PsiReferenceProvider psiReferenceProvider = new PsiReferenceProvider() {
@Override
public PsiReference @NotNull getReferencesByElement(@NotNull PsiElement element,
@NotNull ProcessingContext context) {
var featureReference = new FeatureReference(element, element.getTextRange().shiftLeft(element.getTextOffset()));
return new PsiReference{featureReference};
}
};@Override public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(PlatformPatterns.psiElement(FolderAnnotationLpq.class),psiReferenceProvider); registrar.registerReferenceProvider(PlatformPatterns.psiElement(FileAnnotationLpq.class),psiReferenceProvider); registrar.registerReferenceProvider(PlatformPatterns.psiElement(CodeAnnotationLpq.class),psiReferenceProvider); }
}
in the plugin.xml:
<psi.referenceContributor implementation=“se.isselab.HAnS.referencing.FeatureReferenceContributor” language=“”/>
For some reason finding the usages of the codeAnnotations still work but finding usages of the file and folder annotations does no longer work. I have tried to debug and the contributor is running but I don’t understand why the references do not work properly.
Source code: isselab/HAnS: HAnS - Helping Annotate Software
please help!