當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。