本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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();
}