void (@NotNull PsiReferenceRegistrar registrar) { UastReferenceRegistrar .registerUastReferenceProvider( registrar, UastPatterns.injectionHostUExpression().inCall(UastPatterns.callExpression()), new UastInjectionHostReferenceProvider() { @Override public boolean acceptsTarget(@NotNull PsiElement target) { return target instanceof PsiFileSystemItem; } @Override public @NotNull PsiReference @NotNull [] getReferencesForInjectionHost(@NotNull UExpression expression, @NotNull PsiLanguageInjectionHost host, @NotNull ProcessingContext context) { UCallExpression call = UastUtils.getUCallExpression(expression); if (call == null) return PsiReference.EMPTY_ARRAY; PsiParameter targetParameter = UastUtils.getParameterForArgument(call, expression); if (targetParameter == null || !targetParameter.hasAnnotation(TestFrameworkConstants.TEST_DATA_FILE_ANNOTATION_QUALIFIED_NAME)) { return PsiReference.EMPTY_ARRAY; } String directory = getTestDataDirectory(expression, call); if (directory == null) { return PsiReference.EMPTY_ARRAY; } FileReferenceSet fileReferenceSet = new FileReferenceSet(host); fileReferenceSet.addCustomization( FileReferenceSet.DEFAULT_PATH_EVALUATOR_OPTION, ignore -> { VirtualFile file = LocalFileSystem.getInstance().findFileByPath(directory); return file == null ? null : Collections.singleton(host.getManager().findDirectory(file)); }); return fileReferenceSet.getAllReferences(); } }, PsiReferenceRegistrar.DEFAULT_PRIORITY ); }