當前位置: 首頁>>代碼示例>>Java>>正文


Java ResolveResult.isValidResult方法代碼示例

本文整理匯總了Java中com.intellij.psi.ResolveResult.isValidResult方法的典型用法代碼示例。如果您正苦於以下問題:Java ResolveResult.isValidResult方法的具體用法?Java ResolveResult.isValidResult怎麽用?Java ResolveResult.isValidResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.psi.ResolveResult的用法示例。


在下文中一共展示了ResolveResult.isValidResult方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: resolveXsltReference

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
@Nullable
private static PsiElement resolveXsltReference(PsiReference reference) {
    final PsiElement element = reference.resolve();
    if (element != null) {
        return element;
    }
    if (reference instanceof PsiPolyVariantReference) {
        final ResolveResult[] results = ((PsiPolyVariantReference)reference).multiResolve(false);
        for (ResolveResult result : results) {
            if (result.isValidResult() && result.getElement() instanceof XsltElement) {
                return result.getElement();
            }
        }
    }
    return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:XsltResolveTest.java

示例2: findFirstValidResult

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
@Nullable
public static ResolveResult findFirstValidResult(ResolveResult[] resolveResults)
{
	if(resolveResults.length == 0)
	{
		return null;
	}
	for(ResolveResult resolveResult : resolveResults)
	{
		if(resolveResult.isValidResult() && isAssignable(resolveResult))
		{
			return resolveResult;
		}
	}
	return null;
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:17,代碼來源:CSharpResolveUtil.java

示例3: resolve

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
@NotNull
@Override
@RequiredReadAction
public ResolveResult[] resolve(@NotNull CSharpOperatorReferenceImpl reference, boolean incompleteCode)
{
	if(!incompleteCode)
	{
		return multiResolveImpl(reference);
	}
	else
	{
		ResolveResult[] resolveResults = reference.multiResolve(false);

		List<ResolveResult> filter = new SmartList<>();
		for(ResolveResult resolveResult : resolveResults)
		{
			if(resolveResult.isValidResult())
			{
				filter.add(resolveResult);
			}
		}
		return ContainerUtil.toArray(filter, ResolveResult.EMPTY_ARRAY);
	}
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:25,代碼來源:CSharpOperatorReferenceImpl.java

示例4: hasElementWithName

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
@Nullable
private static CSharpTypeDeclaration hasElementWithName(ResolveResult[] resolveResults, String ref)
{
	for(ResolveResult resolveResult : resolveResults)
	{
		if(!resolveResult.isValidResult())
		{
			continue;
		}
		PsiElement resolveResultElement = resolveResult.getElement();
		if(resolveResultElement instanceof CSharpTypeDeclaration && Comparing.equal(((CSharpTypeDeclaration) resolveResultElement).getName(),
				ref))
		{
			return (CSharpTypeDeclaration) resolveResultElement;
		}
	}
	return null;
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:19,代碼來源:CS1614.java

示例5: isValidReference

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
public static boolean isValidReference(final PsiReference reference) {
  if (!(reference instanceof PyReferenceImpl)) return false;
  ResolveResult[] results = ((PyReferenceImpl)reference).multiResolve(true);
  if(results.length == 0) return false;
  for (ResolveResult result : results) {
    if (!result.isValidResult()) return false;
  }
  return true;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:PyRenameUnresolvedRefQuickFix.java

示例6: filterValidResults

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
@NotNull
public static ResolveResult[] filterValidResults(@NotNull ResolveResult[] resolveResults)
{
	List<ResolveResult> filter = new SmartList<ResolveResult>();
	for(ResolveResult resolveResult : resolveResults)
	{
		if(resolveResult.isValidResult() && isAssignable(resolveResult))
		{
			filter.add(resolveResult);
		}
	}
	return ContainerUtil.toArray(filter, ResolveResult.EMPTY_ARRAY);
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:14,代碼來源:CSharpResolveUtil.java

示例7: resolveToCallables

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
@NotNull
@RequiredReadAction
private static ItemToShow[] resolveToCallables(PsiElement element, CreateParameterInfoContext context)
{
	List<ItemToShow> list = new SmartList<>();
	if(element instanceof CSharpCallArgumentListOwner)
	{
		ResolveResult[] resolveResults = ((CSharpCallArgumentListOwner) element).multiResolve(false);

		for(ResolveResult resolveResult : resolveResults)
		{
			CSharpSimpleLikeMethod likeMethod = resolveSimpleMethod(resolveResult, element);
			if(likeMethod != null)
			{
				ItemToShow item = new ItemToShow(likeMethod, element);
				list.add(item);
				if(resolveResult.isValidResult() && context.getHighlightedElement() == null)
				{
					context.setHighlightedElement(item.valid());
				}
			}
		}
	}

	ContainerUtil.sort(list, (o1, o2) ->
	{
		if(o1.isValid())
		{
			return -1;
		}
		if(o2.isValid())
		{
			return 1;
		}
		return o1.myLikeMethod.getParameterInfos().length - o2.myLikeMethod.getParameterInfos().length;
	});
	return ContainerUtil.toArray(list, ItemToShow.ARRAY_FACTORY);
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:39,代碼來源:CSharpParameterInfoHandler.java

示例8: build

import com.intellij.psi.ResolveResult; //導入方法依賴的package包/類
private String build(String prefix, String elementText, ResolveResult result)
{
	return prefix + "[" + elementText + "]=" + result.isValidResult() + "|" + CSharpResolveUtil.isAssignable(result);
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:5,代碼來源:ResultElementBuilder.java


注:本文中的com.intellij.psi.ResolveResult.isValidResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。