当前位置: 首页>>代码示例>>Java>>正文


Java ReferenceProvidersRegistry类代码示例

本文整理汇总了Java中com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry的典型用法代码示例。如果您正苦于以下问题:Java ReferenceProvidersRegistry类的具体用法?Java ReferenceProvidersRegistry怎么用?Java ReferenceProvidersRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReferenceProvidersRegistry类属于com.intellij.psi.impl.source.resolve.reference包,在下文中一共展示了ReferenceProvidersRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] getReferences() {
	List<SQFVariableInStringReference> currentFileRefs = SQFScope.getVariableReferencesFor(this);
	PsiReference[] refsFromProviders = ReferenceProvidersRegistry.getReferencesFromProviders(this);
	if (currentFileRefs.size() == 0 && refsFromProviders.length == 0) {
		return PsiReference.EMPTY_ARRAY;
	}
	PsiReference[] refsAsArray = new PsiReference[currentFileRefs.size() + refsFromProviders.length];
	int i = 0;
	for (; i < currentFileRefs.size(); i++) {
		refsAsArray[i] = currentFileRefs.get(i);
	}
	for (int j = 0; j < refsFromProviders.length; i++, j++) {
		refsAsArray[i] = refsFromProviders[j];
	}
	return refsAsArray;
}
 
开发者ID:kayler-renslow,项目名称:arma-intellij-plugin,代码行数:19,代码来源:SQFString.java

示例2: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Override
@NotNull
public PsiReference[] getReferences() {
  final IElementType elementType = getElementType();

  if (elementType == XmlTokenType.XML_DATA_CHARACTERS ||
      elementType == XmlTokenType.XML_CHAR_ENTITY_REF) {
    return ReferenceProvidersRegistry.getReferencesFromProviders(this);
  } else if (elementType == XmlTokenType.XML_NAME && getParent() instanceof PsiErrorElement) {
    final PsiElement element = getPrevSibling();
    
    if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_END_TAG_START) {
      return new PsiReference[] {TagNameReference.createTagNameReference(this, getNode(), false)};
    }
  }

  return super.getReferences();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:XmlTokenImpl.java

示例3: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@NotNull
public PsiReference[] getReferences() {
  final IElementType elementType = getElementType();

  if (elementType == XmlTokenType.XML_DATA_CHARACTERS ||
      elementType == XmlTokenType.XML_CHAR_ENTITY_REF) {
    return ReferenceProvidersRegistry.getReferencesFromProviders(this);
  } else if (elementType == XmlTokenType.XML_NAME && getParent() instanceof PsiErrorElement) {
    final PsiElement element = getPrevSibling();
    
    if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_END_TAG_START) {
      return new PsiReference[] {TagNameReference.createTagNameReference(this, getNode(), false)};
    }
  }

  return super.getReferences();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:XmlTokenImpl.java

示例4: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@NotNull
public PsiReference[] getReferences() {
  final IElementType elementType = getElementType();

  if (elementType == XmlTokenType.XML_DATA_CHARACTERS ||
      elementType == XmlTokenType.XML_CHAR_ENTITY_REF) {
    return ReferenceProvidersRegistry.getReferencesFromProviders(this, XmlToken.class);
  } else if (elementType == XmlTokenType.XML_NAME && getParent() instanceof PsiErrorElement) {
    final PsiElement element = getPrevSibling();
    
    if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_END_TAG_START) {
      return new PsiReference[] {TagNameReference.createTagNameReference(this, getNode(), false)};
    }
  }

  return super.getReferences();
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:18,代码来源:XmlTokenImpl.java

示例5: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Override
@NotNull
public PsiReference[] getReferences()
{
	final PsiElement dtdUrlElement = getDtdUrlElement();

	PsiReference uriRef = null;
	if(dtdUrlElement != null)
	{
		uriRef = createUrlReference(dtdUrlElement);
	}

	final PsiReference[] refs = ReferenceProvidersRegistry.getReferencesFromProviders(this);

	return uriRef == null ? refs : ArrayUtil.mergeArrays(new PsiReference[]{uriRef}, refs);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:17,代码来源:XmlDoctypeImpl.java

示例6: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] getReferences() {
  if (getTokenType() == JavaDocTokenType.DOC_COMMENT_DATA) {
    return ReferenceProvidersRegistry.getReferencesFromProviders(this, PsiDocToken.class);
  }
  return super.getReferences();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PsiDocTokenImpl.java

示例7: setUp

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();

  final LocalInspectionTool[] tools = configureLocalInspectionTools();

  CodeInsightTestFixtureImpl.configureInspections(tools, getProject(), Collections.<String>emptyList(),
                                                  getTestRootDisposable());

  DaemonCodeAnalyzerImpl daemonCodeAnalyzer = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(getProject());
  daemonCodeAnalyzer.prepareForTest();
  final StartupManagerImpl startupManager = (StartupManagerImpl)StartupManagerEx.getInstanceEx(getProject());
  startupManager.runStartupActivities();
  startupManager.startCacheUpdate();
  startupManager.runPostStartupActivities();
  DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(false);

  if (isPerformanceTest()) {
    IntentionManager.getInstance().getAvailableIntentionActions();  // hack to avoid slowdowns in PyExtensionFactory
    PathManagerEx.getTestDataPath(); // to cache stuff
    ReferenceProvidersRegistry.getInstance(); // pre-load tons of classes
    InjectedLanguageManager.getInstance(getProject()); // zillion of Dom Sem classes
    LanguageAnnotators.INSTANCE.allForLanguage(JavaLanguage.INSTANCE); // pile of annotator classes loads
    LanguageAnnotators.INSTANCE.allForLanguage(StdLanguages.XML);
    ProblemHighlightFilter.EP_NAME.getExtensions();
    Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
    Extensions.getExtensions(XmlSchemaProvider.EP_NAME);
    Extensions.getExtensions(XmlFileNSInfoProvider.EP_NAME);
    Extensions.getExtensions(ExternalAnnotatorsFilter.EXTENSION_POINT_NAME);
    Extensions.getExtensions(IndexPatternBuilder.EP_NAME);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:DaemonAnalyzerTestCase.java

示例8: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@NotNull
@Override
public List<PsiReference> getReferences(@NotNull PsiElement element, @NotNull Hints hints) {
  if (element instanceof ContributedReferenceHost) {
    return Arrays.asList(ReferenceProvidersRegistry.getReferencesFromProviders(element, hints));
  }
  else {
    return Arrays.asList(element.getReferences());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PsiReferenceServiceImpl.java

示例9: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] getReferences() {
  final long count = getManager().getModificationTracker().getModificationCount();
  if (count != myModCount) {
    synchronized (myRefLock) {
      if (count != myModCount) {
        myRefs = ReferenceProvidersRegistry.getReferencesFromProviders(this);
        myModCount = count;
      }
    }
  }

  return myRefs;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JsonLiteralMixin.java

示例10: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Override
@NotNull
public PsiReference[] getReferences() {
  ProgressManager.checkCanceled();
  final ASTNode startTagName = XmlChildRole.START_TAG_NAME_FINDER.findChild(this);
  if (startTagName == null) return PsiReference.EMPTY_ARRAY;
  final ASTNode endTagName = XmlChildRole.CLOSING_TAG_NAME_FINDER.findChild(this);
  List<PsiReference> refs = new ArrayList<PsiReference>();
  String prefix = getNamespacePrefix();

  TagNameReference startTagRef = TagNameReference.createTagNameReference(this, startTagName, true);
  if (startTagRef != null) {
    refs.add(startTagRef);
  }
  if (!prefix.isEmpty()) {
    refs.add(createPrefixReference(startTagName, prefix, startTagRef));
  }
  if (endTagName != null) {
    TagNameReference endTagRef = TagNameReference.createTagNameReference(this, endTagName, false);
    if (endTagRef != null) {
      refs.add(endTagRef);
    }
    prefix = XmlUtil.findPrefixByQualifiedName(endTagName.getText());
    if (StringUtil.isNotEmpty(prefix)) {
      refs.add(createPrefixReference(endTagName, prefix, endTagRef));
    }
  }


  // ArrayList.addAll() makes a clone of the collection
  //noinspection ManualArrayToCollectionCopy
  for (PsiReference ref : ReferenceProvidersRegistry.getReferencesFromProviders(this, XmlTag.class)) {
    refs.add(ref);
  }

  return ContainerUtil.toArray(refs, new PsiReference[refs.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:XmlTagImpl.java

示例11: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Override
@NotNull
public PsiReference[] getReferences() {
  PsiReference[] cachedReferences = myCachedReferences;
  final long curModCount = getManager().getModificationTracker().getModificationCount();
  if (cachedReferences != null && myModCount == curModCount) {
    return cachedReferences;
  }
  cachedReferences = ReferenceProvidersRegistry.getReferencesFromProviders(this);
  myCachedReferences = cachedReferences;
  myModCount = curModCount;
  return cachedReferences;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:XmlAttributeValueImpl.java

示例12: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Override
@NotNull
public PsiReference[] getReferences() {
  final PsiElement dtdUrlElement = getDtdUrlElement();

  PsiReference uriRef = null;
  if (dtdUrlElement != null) {
    uriRef = createUrlReference(dtdUrlElement);
  }

  final PsiReference[] refs = ReferenceProvidersRegistry.getReferencesFromProviders(this);

  return uriRef == null ? refs : ArrayUtil.mergeArrays(new PsiReference[] {uriRef}, refs);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:XmlDoctypeImpl.java

示例13: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@NotNull
public PsiReference[] getReferences() {
  final PrefixedName prefixedName = getQName();
  if (prefixedName != null && prefixedName.getPrefix() != null) {
    final PsiReference[] references =
      ReferenceProvidersRegistry.getReferencesFromProviders(this, PsiReferenceService.Hints.NO_HINTS);

    final PrefixReferenceImpl reference = new PrefixReferenceImpl(this, ((PrefixedNameImpl)prefixedName).getPrefixNode());
    return references.length > 0 ? ArrayUtil.append(references, reference) : new PsiReference[]{ reference };
  }
  return super.getReferences();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:XPath2TypeElementImpl.java

示例14: getReferences

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Override
public PsiReference[] getReferences(String attributeName, StringLiteral literal) {
  if (!JAVA_CLASS_STRING_TYPES.contains(attributeName)) {
    return PsiReference.EMPTY_ARRAY;
  }
  return ReferenceProvidersRegistry.getReferencesFromProviders(literal);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:8,代码来源:JavaClassQualifiedNameReference.java

示例15: getReference

import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; //导入依赖的package包/类
@Nullable
public static PsiReference getReference(RobotKeyword element) {
    PsiReference[] refs = ReferenceProvidersRegistry.getReferencesFromProviders(element);
    if (refs.length <= 0) {
        return null;
    }
    return refs[0];
}
 
开发者ID:charlescapps,项目名称:robot-intellij-plugin,代码行数:9,代码来源:RobotImplUtil.java


注:本文中的com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。