本文整理匯總了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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}