当前位置: 首页>>代码示例>>Java>>正文


Java DotNetVariable.getType方法代码示例

本文整理汇总了Java中consulo.dotnet.psi.DotNetVariable.getType方法的典型用法代码示例。如果您正苦于以下问题:Java DotNetVariable.getType方法的具体用法?Java DotNetVariable.getType怎么用?Java DotNetVariable.getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在consulo.dotnet.psi.DotNetVariable的用法示例。


在下文中一共展示了DotNetVariable.getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAdditionalModifiers

import consulo.dotnet.psi.DotNetVariable; //导入方法依赖的package包/类
@RequiredReadAction
private static CSharpModifier[] getAdditionalModifiers(int index, DotNetLikeMethodDeclaration parent, DotNetVariable variable)
{
	if(index == 0)
	{
		PsiElement msilElement = parent.getOriginalElement();
		// we can use mirror due ExtensionAttribute is in ban list
		if(DotNetAttributeUtil.hasAttribute(msilElement, DotNetTypes.System.Runtime.CompilerServices.ExtensionAttribute))
		{
			return new CSharpModifier[]{CSharpModifier.THIS};
		}
	}

	DotNetModifierList modifierList = variable.getModifierList();
	if(modifierList != null && modifierList.hasModifier(MsilTokens.BRACKET_OUT_KEYWORD))
	{
		DotNetType type = variable.getType();
		if(type instanceof MsilTypeByRefImpl)
		{
			return new CSharpModifier[]{CSharpModifier.OUT};
		}
	}
	return CSharpModifier.EMPTY_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:25,代码来源:MsilParameterAsCSharpParameter.java

示例2: invoke

import consulo.dotnet.psi.DotNetVariable; //导入方法依赖的package包/类
@Override
@RequiredDispatchThread
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException
{
	PsiDocumentManager.getInstance(project).commitAllDocuments();

	DotNetVariable element = myVariablePointer.getElement();
	if(element == null)
	{
		return;
	}

	DotNetType typeOfVariable = element.getType();
	if(typeOfVariable == null)
	{
		return;
	}
	String typeText = CSharpTypeRefPresentationUtil.buildShortText(myToTypeRef, element);

	DotNetType type = CSharpFileFactory.createMaybeStubType(project, typeText, typeOfVariable);

	typeOfVariable.replace(type);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:24,代码来源:ChangeVariableToTypeRefFix.java

示例3: checkImpl

import consulo.dotnet.psi.DotNetVariable; //导入方法依赖的package包/类
@RequiredReadAction
@Nullable
@Override
public CompilerCheckBuilder checkImpl(@NotNull CSharpLanguageVersion languageVersion, @NotNull CSharpHighlightContext highlightContext, @NotNull DotNetVariable element)
{
	if(element instanceof DotNetParameter)
	{
		// see CS0721
		return null;
	}
	DotNetType type = element.getType();
	PsiElement resolve = DotNetTypeRefUtil.resolve(type);
	if(resolve instanceof DotNetTypeDeclaration && ((DotNetTypeDeclaration) resolve).hasModifier(DotNetModifier.STATIC))
	{
		return newBuilder(type, formatElement(element)).addQuickFix(new RemoveModifierFix(DotNetModifier.STATIC, (DotNetModifierListOwner) resolve));
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:CS0723.java

示例4: getType

import consulo.dotnet.psi.DotNetVariable; //导入方法依赖的package包/类
@Nullable
public static DotNetType getType(@NotNull CSharpStubVariableImpl<?> variable)
{
	DotNetType type = variable.getExplicitType();
	if(type != null)
	{
		return type;
	}

	DotNetVariable prevVariable = getPrevVariable(variable);
	return prevVariable == null ? null : prevVariable.getType();
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:13,代码来源:CSharpStubVariableImplUtil.java


注:本文中的consulo.dotnet.psi.DotNetVariable.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。