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


Java DotNetVariable.toTypeRef方法代碼示例

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


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

示例1: getParametersForLookup

import consulo.dotnet.psi.DotNetVariable; //導入方法依賴的package包/類
@Nullable
@Override
@RequiredReadAction
public ItemToShow[] getParametersForLookup(LookupElement item, ParameterInfoContext context)
{
	Object object = item.getObject();

	if(object instanceof DotNetLikeMethodDeclaration)
	{
		return new ItemToShow[]{new ItemToShow((CSharpSimpleLikeMethod) object, context.getFile())};
	}
	if(object instanceof DotNetVariable)
	{
		DotNetVariable variable = (DotNetVariable) object;
		DotNetTypeRef dotNetTypeRef = variable.toTypeRef(tracksParameterIndex());

		DotNetTypeResolveResult typeResolveResult = dotNetTypeRef.resolve();
		if(typeResolveResult instanceof CSharpLambdaResolveResult)
		{
			return new ItemToShow[]{new ItemToShow((CSharpSimpleLikeMethod) typeResolveResult, variable)};
		}
	}
	return ItemToShow.EMPTY_ARRAY;
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:25,代碼來源:CSharpParameterInfoHandler.java

示例2: getVariables

import consulo.dotnet.psi.DotNetVariable; //導入方法依賴的package包/類
@Nullable
@Override
protected PsiElement[] getVariables(Expression[] params, ExpressionContext context)
{
	final PsiElement psiElementAtStartOffset = context.getPsiElementAtStartOffset();
	if(psiElementAtStartOffset == null)
	{
		return PsiElement.EMPTY_ARRAY;
	}

	List<DotNetVariable> variables = CSharpLiveTemplateMacroUtil.resolveAllVariables(context.getPsiElementAtStartOffset());

	List<DotNetVariable> list = new SmartList<DotNetVariable>();
	for(DotNetVariable variable : variables)
	{
		DotNetTypeRef typeRefOfVariable = variable.toTypeRef(true);

		if(CSharpTypeDeclarationImplUtil.isInheritOrSelf(typeRefOfVariable, psiElementAtStartOffset, ourAcceptableTypes))
		{
			list.add(variable);
		}
	}
	return list.toArray(new PsiElement[list.size()]);
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:25,代碼來源:ForeachVariableMacro.java

示例3: getVariables

import consulo.dotnet.psi.DotNetVariable; //導入方法依賴的package包/類
@Nullable
@Override
protected PsiElement[] getVariables(Expression[] params, ExpressionContext context)
{
	final PsiElement psiElementAtStartOffset = context.getPsiElementAtStartOffset();
	if(psiElementAtStartOffset == null)
	{
		return PsiElement.EMPTY_ARRAY;
	}

	List<DotNetVariable> variables = CSharpLiveTemplateMacroUtil.resolveAllVariables(context.getPsiElementAtStartOffset());

	List<DotNetVariable> list = new SmartList<DotNetVariable>();
	for(DotNetVariable variable : variables)
	{
		DotNetTypeRef typeRefOfVariable = variable.toTypeRef(true);

		if(CSharpTypeDeclarationImplUtil.isInheritOrSelf(typeRefOfVariable, psiElementAtStartOffset, DotNetTypes2.System.Collections.Generic
				.IList$1))
		{
			list.add(variable);
		}
	}
	return list.toArray(new PsiElement[list.size()]);
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:26,代碼來源:IListVariableMacro.java

示例4: getVariables

import consulo.dotnet.psi.DotNetVariable; //導入方法依賴的package包/類
@Nullable
@Override
protected PsiElement[] getVariables(Expression[] params, ExpressionContext context)
{
	final PsiElement psiElementAtStartOffset = context.getPsiElementAtStartOffset();
	if(psiElementAtStartOffset == null)
	{
		return PsiElement.EMPTY_ARRAY;
	}

	List<DotNetVariable> variables = CSharpLiveTemplateMacroUtil.resolveAllVariables(context.getPsiElementAtStartOffset());

	List<DotNetVariable> list = new SmartList<DotNetVariable>();
	for(DotNetVariable variable : variables)
	{
		DotNetTypeRef typeRefOfVariable = variable.toTypeRef(true);

		if(typeRefOfVariable instanceof CSharpArrayTypeRef && ((CSharpArrayTypeRef) typeRefOfVariable).getDimensions() == 0)
		{
			list.add(variable);
		}
	}
	return list.toArray(new PsiElement[list.size()]);
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:25,代碼來源:ArrayVariableMacro.java

示例5: resolveLeftLambdaTypeRefForVariable

import consulo.dotnet.psi.DotNetVariable; //導入方法依賴的package包/類
@Nullable
@RequiredReadAction
public static CSharpLambdaResolveResult resolveLeftLambdaTypeRefForVariable(DotNetVariable variable)
{
	DotNetTypeRef leftTypeRef = variable.toTypeRef(false);
	DotNetTypeResolveResult typeResolveResult = leftTypeRef.resolve();
	return typeResolveResult instanceof CSharpLambdaResolveResult ? (CSharpLambdaResolveResult) typeResolveResult : null;
}
 
開發者ID:consulo,項目名稱:consulo-csharp,代碼行數:9,代碼來源:CSharpLambdaExpressionImplUtil.java


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