Java 类com.intellij.psi.PsiReferenceRegistrar 实例源码

项目:intellij-plugin    文件:CoffigYamlReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(PlatformPatterns.psiElement(YAMLScalar.class),
            new PsiReferenceProvider() {
                @NotNull
                @Override
                public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
                    if (isConfigFile(element)) {
                        String valueText = ((YAMLScalar) element).getTextValue();
                        List<MacroResolver.Match> matches = new MacroResolver().resolve(valueText);
                        List<PsiReference> references = new ArrayList<>();
                        matches.stream()
                                .filter(match -> !match.isEscaped())
                                .map(match -> resolvePsiReferences(element, match.getReference(), (element instanceof YAMLQuotedText ? 1 : 0) + match.getStartPos()))
                                .forEach(references::addAll);
                        return references.toArray(new PsiReference[references.size()]);
                    }
                    return PsiReference.EMPTY_ARRAY;
                }
            });
}
项目:intellij-plugin    文件:CoffigJavaReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiLiteralExpression.class),
            new PsiReferenceProvider() {
                @NotNull
                @Override
                public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
                    if (isLiteralOfConfigurationAnnotation(element) || isCoffigMethod(element)) {
                        PsiLiteralExpression literalExpression = (PsiLiteralExpression) element;
                        String value = literalExpression.getValue() instanceof String ? (String) literalExpression.getValue() : null;
                        List<PsiReference> psiReferences = resolvePsiReferences(element, value, 1);
                        return psiReferences.toArray(new PsiReference[psiReferences.size()]);
                    }
                    return PsiReference.EMPTY_ARRAY;
                }
            });
}
项目:intellij-ce-playground    文件:PsiReferenceRegistrarImpl.java   
public PsiReferenceRegistrarImpl(final Language language) {
  myBindingCache = new ConcurrentFactoryMap<Class, ProviderBinding[]>() {
    @Nullable
    @Override
    protected ProviderBinding[] create(Class key) {
      List<ProviderBinding> result = ContainerUtil.newSmartList();
      for (Class<?> bindingClass : myBindingsMap.keySet()) {
        if (bindingClass.isAssignableFrom(key)) {
          result.add(myBindingsMap.get(bindingClass));
        }
      }
      for (Class<?> bindingClass : myNamedBindingsMap.keySet()) {
        if (bindingClass.isAssignableFrom(key)) {
          result.add(myNamedBindingsMap.get(bindingClass));
        }
      }
      if (language != Language.ANY) {
        final PsiReferenceRegistrar anyRegistrar = ReferenceProvidersRegistry.getInstance().getRegistrar(Language.ANY);
        Collections.addAll(result, ((PsiReferenceRegistrarImpl)anyRegistrar).myBindingCache.get(key));
      }
      //noinspection unchecked
      return result.toArray(new ProviderBinding[result.size()]);
    }
  };
}
项目:magento2plugin    文件:ServiceReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar psiReferenceRegistrar) {
    // <service class="\Namespace\Interface" />
    XmlAttributeValuePattern serviceTag = XmlHelper.getTagAttributeValuePattern(
        XmlHelper.SERVICE_TAG,
        XmlHelper.CLASS_ATTRIBUTE
    );
    psiReferenceRegistrar.registerReferenceProvider(
        serviceTag,
        new XmlReferenceProvider(new ReferenceResultsFiller[]{
            InterfacesResultsFiller.INSTANCE
        }));

    // <service method="MethodName"/>
    XmlAttributeValuePattern methodAttribute = XmlHelper.getMethodAttributePattern();
    psiReferenceRegistrar.registerReferenceProvider(
        methodAttribute,
        new XmlReferenceProvider(new ReferenceResultsFiller[]{
            new ServiceMethodResultsFiller()
        })
    );
}
项目:k-intellij-plugin    文件:KReferenceContributor.java   
@Override
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
  // references from same language
  registrar.registerReferenceProvider(
    PlatformPatterns.psiElement(KUserId.class).withLanguage(KLanguage.INSTANCE),
    new PsiReferenceProvider() {
      @NotNull
      @Override
      public PsiReference[] getReferencesByElement(PsiElement element, ProcessingContext context) {
        if (element instanceof KUserId) {
          final String key = element.getText();
          return new PsiReference[]{new KReference((KUserId)element, new TextRange(0, key.length()))};
        }
        return new PsiReference[0];
      }
    }
  );
}
项目:eclipse-from-idea-development    文件:PluginXmlPropertiesProvider.java   
@Override
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
  final XmlFilePattern.Capture filePattern = xmlFile().withName(string().oneOf("plugin.xml", "feature.xml", "site.xml"));

  registrar.registerReferenceProvider(
      XmlPatterns.xmlAttributeValue().inFile(filePattern).withValue(string().startsWith("%")),
      new PluginXmlPropertiesReferenceProvider()
  );
  registrar.registerReferenceProvider(
      PlatformPatterns.psiElement(XmlToken.class).inside(
          xmlText().inside(
              xmlTag().inFile(filePattern)
          )
      ).withText(string().startsWith("%")),
      new PluginXmlPropertiesReferenceProvider()
  );
}
项目:yiistorm    文件:YiiReferenceContributor.java   
@Override
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(StandardPatterns.instanceOf(PhpPsiElement.class), new YiiPsiReferenceProvider());
    registrar.registerReferenceProvider(
            PlatformPatterns.psiElement(PsiElement.class).withParent(isParamListInMethodWithName(".+?widget\\(.+"))
            , new WidgetCallReferenceProvider());
    //View-to-view
    registrar.registerReferenceProvider(
            PlatformPatterns.psiElement(PhpPsiElement.class)
                    .withParent(isParamListInMethodWithName(".+?render(Partial)*\\(.+"))
                    .andNot(inFile(PlatformPatterns.string().endsWith("Controller.php")))
            , new ViewRenderViewReferenceProvider());
    //Controller-to-view
    registrar.registerReferenceProvider(
            PlatformPatterns.psiElement(PhpPsiElement.class)
                    .withParent(isParamListInMethodWithName("(?sim).+?render(Partial)*\\(.+"))
                    .and(inFile(PlatformPatterns.string().endsWith("Controller.php")))
            , new ControllerRenderViewReferenceProvider());
}
项目:consulo-xslt    文件:XsltReferenceContributor.java   
public void registerReferenceProviders(PsiReferenceRegistrar registrar)
{
    registrar.registerReferenceProvider(psiElement(XmlAttributeValue.class).withParent(xmlAttribute().withLocalName("name", "href", "mode", "elements", "exclude-result-prefixes",
            "extension-element-prefixes", "stylesheet-prefix").withParent(xmlTag().withNamespace(XsltSupport.XSLT_NS))), new XsltReferenceProvider());

    registrar.registerReferenceProvider(xmlAttributeValue().withValue(string().matches("[^()]+")).withParent(xmlAttribute("as").withParent(xmlTag().withNamespace(XsltSupport.XSLT_NS))),
            SchemaTypeProvider.INSTANCE);

    registrar.registerReferenceProvider(xmlAttributeValue().withParent(xmlAttribute("as").withParent(xmlTag().withNamespace(XsltSupport.XSLT_NS))).withValue(string().contains(":")),
            new PsiReferenceProvider()
    {
        @NotNull
        @Override
        public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context)
        {
            return new PsiReference[]{new NamespacePrefixReference(element)};
        }
    });
}
项目:magento2-phpstorm-plugin    文件:PhpReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    // ->dispatch("event_name")
    registrar.registerReferenceProvider(
            PhpPatternsHelper.STRING_METHOD_ARGUMENT,
            new EventDispatchReferenceProvider()
    );
}
项目:hybris-integration-intellij-idea-plugin    文件:HybrisSpringProcessReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(
        tagAttributeValuePattern("action", "bean", ITEMS_TYPE_FILE_NAME),
        new HybrisSpringProcessReferenceProvider()
    );
}
项目:hybris-integration-intellij-idea-plugin    文件:HybrisProcessReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(
        tagAttributeValuePattern("transition", "to", ITEMS_TYPE_FILE_NAME),
        new HybrisTransitionProcessReferenceProvider()
    );
    registrar.registerReferenceProvider(
        tagAttributeValuePattern("then", ITEMS_TYPE_FILE_NAME),
        new HybrisTransitionProcessReferenceProvider()
    );
}
项目:hybris-integration-intellij-idea-plugin    文件:HybrisItemXmlReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(
        tagAttributeValuePattern("enumtype", "code", ITEMS_TYPE_FILE_NAME),
        new HybrisEnumItemReferenceProvider()
    );
    registrar.registerReferenceProvider(
        tagAttributeValuePattern("value", "code", ITEMS_TYPE_FILE_NAME).inside(insideTagPattern("enumtype")),
        new HybrisEnumLiteralItemReferenceProvider()
    );
    registrar.registerReferenceProvider(
        tagAttributeValuePattern("itemtype", "code", ITEMS_TYPE_FILE_NAME),
        new HybrisModelItemReferenceProvider()
    );
}
项目:intellij-neos    文件:NodeTypeReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(
            PlatformPatterns.psiElement(YAMLKeyValue.class),
            new NodeTypeReferenceProvider()
    );
}
项目:intellij-swagger    文件:OpenApiYamlReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_SCHEMAS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_RESPONSES_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_PARAMETERS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_EXAMPLES_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_REQUEST_BODIES_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_HEADERS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_LINKS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_CALLBACKS_PREFIX), createLocalReferenceProvider());

    registrar.registerReferenceProvider(filePattern(), createFileReferenceProvider());
    registrar.registerReferenceProvider(componentFileReferencePattern(), createComponentFileReferenceProvider());
}
项目:intellij-swagger    文件:OpenApiJsonReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_SCHEMAS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_RESPONSES_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_PARAMETERS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_EXAMPLES_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_REQUEST_BODIES_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_HEADERS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_LINKS_PREFIX), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localReferencePattern(OpenApiConstants.LOCAL_CALLBACKS_PREFIX), createLocalReferenceProvider());

    registrar.registerReferenceProvider(filePattern(), createFileReferenceProvider());
    registrar.registerReferenceProvider(componentFileReferencePattern(), createComponentFileReferenceProvider());
}
项目:intellij-swagger    文件:SwaggerYamlReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(localDefinitionsPattern(), createLocalReferenceProvider());

    registrar.registerReferenceProvider(externalDefinitionsInRootPattern(), createExternalDefinitionsInRootReferenceProvider());
    registrar.registerReferenceProvider(externalDefinitionsNotInRootPattern(), createExternalDefinitionsNotInRootReferenceProvider());

    registrar.registerReferenceProvider(localParametersPattern(), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localResponsesPattern(), createLocalReferenceProvider());

    registrar.registerReferenceProvider(filePattern(), createFileReferenceProvider());
    registrar.registerReferenceProvider(tagsPattern(), createTagsReferenceProvider());
}
项目:intellij-swagger    文件:SwaggerJsonReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(localDefinitionsPattern(), createLocalReferenceProvider());
    registrar.registerReferenceProvider(externalDefinitionsInRootPattern(), createExternalDefinitionsInRootReferenceProvider());
    registrar.registerReferenceProvider(externalDefinitionsNotInRootPattern(), createExternalDefinitionsNotInRootReferenceProvider());

    registrar.registerReferenceProvider(localParametersPattern(), createLocalReferenceProvider());
    registrar.registerReferenceProvider(localResponsesPattern(), createLocalReferenceProvider());

    registrar.registerReferenceProvider(filePattern(), createFileReferenceProvider());
    registrar.registerReferenceProvider(tagsPattern(), createTagsReferenceProvider());
}
项目:intellij-ce-playground    文件:DomReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
  GenericValueReferenceProvider provider = new GenericValueReferenceProvider();

  registrar.registerReferenceProvider(XmlPatterns.xmlTag(), provider);
  registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue(), provider);
}
项目:intellij-ce-playground    文件:RelaxNGReferenceContributor.java   
@Override
  public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, new String[]{
      "name"
    }, new PatternFilter(xmlAttributeValue().withParent(NAME_PATTERN)), true, new PrefixReferenceProvider());

//    final XmlAttributeValuePattern id = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_REF_TYPE);
//    final XmlAttributeValuePattern idref = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_TYPE);
//    registry.registerXmlAttributeValueReferenceProvider(null, new PatternFilter(or(id, idref)), false, new IdRefProvider());

  }
项目:intellij-ce-playground    文件:TestNGSuiteReferenceContributor.java   
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(ourTestClassPattern, new JavaClassReferenceProvider());
  registrar.registerReferenceProvider(ourListenerClassPattern, new JavaClassReferenceProvider());

  final JavaClassReferenceProvider methodSelectorProvider = new JavaClassReferenceProvider();
  methodSelectorProvider.setOption(JavaClassReferenceProvider.EXTEND_CLASS_NAMES, new String[]{"org.testng.IMethodSelector"});
  registrar.registerReferenceProvider(ourMethodSelectorPattern, methodSelectorProvider);

  registrar.registerReferenceProvider(ourSuiteFilePattern, new PathListReferenceProvider(){
    @Override
    protected boolean disableNonSlashedPaths() {
      return false;
    }
  });
}
项目:intellij-ce-playground    文件:MavenPropertyPsiReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
  ElementPattern pattern = XmlPatterns.xmlTag().withParent(DomPatterns.tagWithDom("properties", DomPatterns.domElement(MavenDomProperties.class)));
  registrar.registerReferenceProvider(pattern, new MavenPropertyPsiReferenceProvider(), PsiReferenceRegistrar.DEFAULT_PRIORITY);
  registrar.registerReferenceProvider(PlatformPatterns.psiElement(),
                                      new MavenFilteredPropertyPsiReferenceProvider(),
                                      PsiReferenceRegistrar.DEFAULT_PRIORITY);
}
项目:intellij-ce-playground    文件:GroovyReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull final PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(PlatformPatterns.psiElement(GrLiteral.class), new PropertiesReferenceProvider());

  registrar.registerReferenceProvider(GroovyPatterns.stringLiteral().withParent(GrAnnotationNameValuePair.class),
                                      new SpockUnrollReferenceProvider());

}
项目:intellij    文件:JavaClassReferenceContributor.java   
@Override
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
  JavaClassReferenceProvider provider = new JavaClassReferenceProvider();
  provider.setOption(JavaClassReferenceProvider.CLASS_KIND, ClassKind.CLASS);
  registrar.registerReferenceProvider(
      JavaClassQualifiedNameReference.PATTERN, new JavaClassReferenceProvider());
}
项目:IntelliJ_Jahia_plugin    文件:CndReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    CndReferenceProvider cndReferenceProvider = new CndReferenceProvider();
    registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiLiteralExpression.class),        cndReferenceProvider);  //Java

    registrar.registerReferenceProvider(PlatformPatterns.psiElement(CndTypes.SUPER_TYPE),               cndReferenceProvider);  //Cnd super types
    registrar.registerReferenceProvider(PlatformPatterns.psiElement(CndTypes.EXTENSION),                cndReferenceProvider);  //Cnd extends types
    registrar.registerReferenceProvider(PlatformPatterns.psiElement(CndTypes.SUB_NODE_TYPE),            cndReferenceProvider);  //Cnd subnode types
    registrar.registerReferenceProvider(PlatformPatterns.psiElement(CndTypes.SUB_NODE_DEFAULT_TYPE),    cndReferenceProvider);  //Cnd subnode default type

    registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlElementType.XML_ATTRIBUTE_VALUE),    cndReferenceProvider);  //XML

    registrar.registerReferenceProvider(PlatformPatterns.psiElement(PropertiesTokenTypes.KEY_CHARACTERS),    cndReferenceProvider);  //Properties
}
项目:spoofax-intellij    文件:MetaborgReferenceContributor.java   
/**
 * {@inheritDoc}
 */
@Override
public void registerReferenceProviders(final PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(
            PlatformPatterns.psiElement(MetaborgReferenceElement.class),
            this.referenceProviderFactory.create()
    );
}
项目:intellij-pants-plugin    文件:PantsReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(
    psiElement(PyStringLiteralExpression.class),
    new PantsTargetPathReferenceProvider()
  );
}
项目:intellij-haskforce    文件:HaskellReferenceContributor.java   
@Override
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
    PsiElementPattern.Capture<PsiNamedElement> variableCapture =
            PlatformPatterns.psiElement(PsiNamedElement.class).withParent(HaskellVars.class).withParent(HaskellGendecl.class).withLanguage(HaskellLanguage.INSTANCE);
    registrar.registerReferenceProvider(variableCapture,
            new HaskellReferenceProvider());
}
项目:tools-idea    文件:RelaxNGReferenceContributor.java   
@Override
  public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, new String[]{
      "name"
    }, new PatternFilter(xmlAttributeValue().withParent(NAME_PATTERN)), true, new PrefixReferenceProvider());

//    final XmlAttributeValuePattern id = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_REF_TYPE);
//    final XmlAttributeValuePattern idref = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_TYPE);
//    registry.registerXmlAttributeValueReferenceProvider(null, new PatternFilter(or(id, idref)), false, new IdRefProvider());

  }
项目:tools-idea    文件:TestNGSuiteReferenceContributor.java   
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(ourTestClassPattern, new JavaClassReferenceProvider());
  registrar.registerReferenceProvider(ourListenerClassPattern, new JavaClassReferenceProvider());

  final JavaClassReferenceProvider methodSelectorProvider = new JavaClassReferenceProvider();
  methodSelectorProvider.setOption(JavaClassReferenceProvider.EXTEND_CLASS_NAMES, new String[]{"org.testng.IMethodSelector"});
  registrar.registerReferenceProvider(ourMethodSelectorPattern, methodSelectorProvider);

  registrar.registerReferenceProvider(ourSuiteFilePattern, new PathListReferenceProvider(){
    @Override
    protected boolean disableNonSlashedPaths() {
      return false;
    }
  });
}
项目:tools-idea    文件:MavenPropertyPsiReferenceContributor.java   
@Override
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
  ElementPattern pattern = XmlPatterns.xmlTag().withParent(DomPatterns.withDom(DomPatterns.domElement(MavenDomProperties.class)));
  registrar.registerReferenceProvider(pattern, new MavenPropertyPsiReferenceProvider(), PsiReferenceRegistrar.DEFAULT_PRIORITY);
  registrar.registerReferenceProvider(PlatformPatterns.psiElement(),
                                      new MavenFilteredPropertyPsiReferenceProvider(),
                                      PsiReferenceRegistrar.DEFAULT_PRIORITY);
}
项目:consulo-css    文件:XStyleSheetToHtmlReferenceContributor.java   
@Override
public void registerReferenceProviders(PsiReferenceRegistrar psiReferenceRegistrar)
{
    XmlUtil.registerXmlAttributeValueReferenceProvider(psiReferenceRegistrar, new String[]{"id"}, null, false, new HtmlIdOrClassToCssFileReferenceProvider(XStyleSheetSimpleSelectorType.ID));

    XmlUtil.registerXmlAttributeValueReferenceProvider(psiReferenceRegistrar, new String[]{"class"}, null, false, new HtmlIdOrClassToCssFileReferenceProvider(XStyleSheetSimpleSelectorType.CLASS));

    HtmlHrefToCssFileReferenceProvider provider = new HtmlHrefToCssFileReferenceProvider();

    XmlUtil.registerXmlAttributeValueReferenceProvider(psiReferenceRegistrar, new String[]{"href"}, provider.getElementFilter(), false, provider);
}
项目:consulo-xml    文件:RelaxNGReferenceContributor.java   
@Override
  public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    XmlUtil.registerXmlAttributeValueReferenceProvider(registrar, new String[]{
      "name"
    }, new PatternFilter(xmlAttributeValue().withParent(NAME_PATTERN)), true, new PrefixReferenceProvider());

//    final XmlAttributeValuePattern id = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_REF_TYPE);
//    final XmlAttributeValuePattern idref = xmlAttributeValue().withParent(xmlAttribute()).with(IdRefProvider.HAS_ID_TYPE);
//    registry.registerXmlAttributeValueReferenceProvider(null, new PatternFilter(or(id, idref)), false, new IdRefProvider());

  }
项目:consulo-apache-velocity    文件:VtlReferenceContributor.java   
private void registerExternalMacroLibraryProvider(PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(VTLMACROLIBRARY_COMMENT, new PsiReferenceProvider() {
        @NotNull
        public PsiReference[] getReferencesByElement(@NotNull final PsiElement element, @NotNull final ProcessingContext context) {
            final List<PsiReference> result = new SmartList<PsiReference>();
            if (findAndAddReferencesByElement(element, "path=\"", "\"", result)) {
                findAndAddReferencesByElement(element, "file=\"", "\"", result);
            }
            return result.toArray(PsiReference.EMPTY_ARRAY);
        }
    });
}
项目:consulo-apache-velocity    文件:VtlReferenceContributor.java   
private void registerVelocityPropertiesProvider(PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(VELOCITY_PROPERTIES_COMMENT, new PsiReferenceProvider() {
        @NotNull
        public PsiReference[] getReferencesByElement(@NotNull final PsiElement element, @NotNull final ProcessingContext context) {
            final List<PsiReference> result = new SmartList<PsiReference>();
            if (findAndAddReferencesByElement(element, "path=\"", "\"", result)) {
                findAndAddReferencesByElement(element, "runtime_root=\"", "\"", result);
                findAndAddReferencesByElement(element, "file=\"", "\"", result);
            }
            return result.toArray(PsiReference.EMPTY_ARRAY);
        }
    });
}
项目:yii2support    文件:PsiReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar psiReferenceRegistrar) {
    psiReferenceRegistrar.registerReferenceProvider(ElementPattern(), new PsiReferenceProvider());
}
项目:yii2support    文件:ObjectFactoryReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar psiReferenceRegistrar) {
    psiReferenceRegistrar.registerReferenceProvider(ElementPattern(), new ObjectFactoryReferenceProvider());
}
项目:mule-intellij-plugins    文件:IncludeReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
    registrar.registerReferenceProvider(psiElement()
                    .withText(string().startsWith(INCLUDE_TAG))
            , new IncludeFilePathReferenceProvider());
}
项目:intellij-ce-playground    文件:JavaReflectionReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(PATTERN, new JavaReflectionReferenceProvider());
}
项目:intellij-ce-playground    文件:CommentsReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiComment.class), COMMENTS_REFERENCE_PROVIDER_TYPE.getProvider());
}
项目:intellij-ce-playground    文件:DocStringReferenceContributor.java   
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(DocStringTagCompletionContributor.DOCSTRING_PATTERN,
                                      new DocStringReferenceProvider());
}