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