当前位置: 首页>>代码示例>>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;未经允许,请勿转载。