本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
}
示例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());
}
}
示例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;
}
示例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()]);
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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];
}