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


Java DotNetReferenceExpression类代码示例

本文整理汇总了Java中consulo.dotnet.psi.DotNetReferenceExpression的典型用法代码示例。如果您正苦于以下问题:Java DotNetReferenceExpression类的具体用法?Java DotNetReferenceExpression怎么用?Java DotNetReferenceExpression使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: evaluate

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@Override
public void evaluate(@NotNull DotNetStackFrameProxy stackFrameMirror,
		@NotNull DotNetDebugContext dotNetDebugContext,
		@NotNull DotNetReferenceExpression dotNetReferenceExpression,
		@NotNull Set<Object> set,
		@NotNull Consumer<XNamedValue> consumer)
{
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:9,代码来源:UnityScriptDebuggerProvider.java

示例2: resolveToCallable

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@Nullable
@Override
public PsiElement resolveToCallable()
{
	if(!canResolve())
	{
		return null;
	}
	DotNetReferenceExpression expressionForResolving = getExpressionForResolving();
	return expressionForResolving != null ? expressionForResolving.resolve() : null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:12,代码来源:CSharpNewExpressionImpl.java

示例3: multiResolve

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@NotNull
@Override
public ResolveResult[] multiResolve(boolean incompleteCode)
{
	if(!canResolve())
	{
		return ResolveResult.EMPTY_ARRAY;
	}
	DotNetReferenceExpression expressionForResolving = getExpressionForResolving();
	return expressionForResolving != null ? expressionForResolving.multiResolve(incompleteCode) : ResolveResult.EMPTY_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:12,代码来源:CSharpNewExpressionImpl.java

示例4: getReferenceText

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@RequiredReadAction
@Override
@Nullable
public String getReferenceText()
{
	CSharpWithStringValueStub<CSharpUsingNamespaceStatement> stub = getGreenStub();
	if(stub != null)
	{
		return stub.getReferenceText();
	}

	DotNetReferenceExpression namespaceReference = getNamespaceReference();
	return namespaceReference == null ? null : namespaceReference.getText();
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:15,代码来源:CSharpUsingNamespaceStatementImpl.java

示例5: getReferenceText

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@NotNull
@Override
public String getReferenceText()
{
	CSharpWithStringValueStub<CSharpUserType> stub = getGreenStub();
	if(stub != null)
	{
		//noinspection ConstantConditions
		return stub.getReferenceText();
	}
	DotNetReferenceExpression referenceExpression = getReferenceExpression();
	return referenceExpression.getText();
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:14,代码来源:CSharpStubUserTypeImpl.java

示例6: getExpressionRangeAtOffset

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@RequiredReadAction
@Nullable
public TextRange getExpressionRangeAtOffset(@NotNull PsiFile psiFile, int offset, boolean sideEffectsAllowed)
{
	PsiElement elementAt = psiFile.findElementAt(offset);
	if(elementAt == null)
	{
		return null;
	}

	PsiNameIdentifierOwner owner = PsiTreeUtil.getParentOfType(elementAt, PsiNameIdentifierOwner.class);
	if(owner != null)
	{
		PsiElement nameIdentifier = owner.getNameIdentifier();
		TextRange textRange = nameIdentifier == null ? null : nameIdentifier.getTextRange();
		if(textRange != null && textRange.contains(offset))
		{
			return textRange;
		}
	}

	DotNetReferenceExpression referenceExpression = PsiTreeUtil.getParentOfType(elementAt, DotNetReferenceExpression.class);
	if(referenceExpression != null)
	{
		// skip type references
		if(PsiTreeUtil.getParentOfType(referenceExpression, DotNetType.class) != null)
		{
			return null;
		}
		return referenceExpression.getTextRange();
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:34,代码来源:DotNetDebuggerProvider.java

示例7: getNamespaceReference

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@Nullable
@Override
public DotNetReferenceExpression getNamespaceReference()
{
	return null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpLightUsingNamespaceStatementBuilder.java

示例8: process

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@RequiredReadAction
@Override
public void process(@NotNull CSharpResolveOptions options,
		@NotNull DotNetGenericExtractor defaultExtractor,
		@Nullable PsiElement forceQualifierElement,
		@NotNull final Processor<ResolveResult> processor)
{
	PsiElement element = options.getElement();

	String qName = StringUtil.strip(element.getText(), CSharpReferenceExpression.DEFAULT_REF_FILTER);

	DotNetNamespaceAsElement namespace = null;

	PsiElement qualifier = options.getQualifier();

	PsiElement parent = element.getParent();
	if(!options.isCompletion())
	{
		if(parent instanceof CSharpUsingNamespaceStatement)
		{
			DotNetNamespaceAsElement namespaceAsElement = ((CSharpUsingNamespaceStatement) parent).resolve();
			if(namespaceAsElement != null)
			{
				processor.process(new CSharpResolveResult(namespaceAsElement));
			}
		}
		else
		{
			namespace = DotNetPsiSearcher.getInstance(element.getProject()).findNamespace(qName, element.getResolveScope());

			if(namespace != null)
			{
				processor.process(new CSharpResolveResult(namespace));
			}
		}
	}
	else
	{
		processDefaultCompletion(processor, element, qualifier);

		if(parent instanceof CSharpUsingNamespaceStatement)
		{
			PsiElement parentOfStatement = parent.getParent();
			if(parentOfStatement instanceof CSharpNamespaceDeclaration)
			{
				DotNetReferenceExpression namespaceReference = ((CSharpNamespaceDeclaration) parentOfStatement).getNamespaceReference();
				if(namespaceReference != null)
				{
					PsiElement resolvedElement = namespaceReference.resolve();
					if(resolvedElement instanceof DotNetNamespaceAsElement)
					{
						processNamespaceChildren(processor, element, (DotNetNamespaceAsElement) resolvedElement);
					}
				}
			}
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:59,代码来源:QualifiedNamespaceKindProcessor.java

示例9: getNamespaceReference

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@Override
public DotNetReferenceExpression getNamespaceReference()
{
	return findChildByClass(DotNetReferenceExpression.class);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:6,代码来源:CSharpUsingNamespaceStatementImpl.java

示例10: getNamespaceReference

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@Nullable
DotNetReferenceExpression getNamespaceReference();
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:3,代码来源:CSharpNamespaceDeclaration.java

示例11: evaluate

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@Override
public void evaluate(@NotNull DotNetStackFrameProxy frame,
		@NotNull DotNetDebugContext debuggerContext,
		@NotNull DotNetReferenceExpression referenceExpression,
		@NotNull Set<Object> visitedVariables,
		@NotNull Consumer<XNamedValue> consumer)
{
	try
	{
		List<Evaluator> evaluators = ApplicationManager.getApplication().runReadAction((Computable<List<Evaluator>>) () ->
		{
			PsiElement resolvedElement = referenceExpression.resolve();
			if(referenceExpression.getParent() instanceof CSharpMethodCallExpressionImpl || resolvedElement instanceof DotNetLikeMethodDeclaration)
			{
				return Collections.emptyList();
			}
			CSharpExpressionEvaluator expressionEvaluator = new CSharpExpressionEvaluator();
			referenceExpression.accept(expressionEvaluator);
			return expressionEvaluator.getEvaluators();
		});

		if(evaluators.isEmpty())
		{
			return;
		}

		CSharpEvaluateContext evaluateContext = new CSharpEvaluateContext(debuggerContext, frame, referenceExpression);
		evaluateContext.evaluate(evaluators);
		Pair<DotNetValueProxy, Object> objectPair = evaluateContext.pop();
		if(objectPair != null && objectPair.getSecond() instanceof DotNetFieldOrPropertyProxy)
		{
			DotNetFieldOrPropertyProxy fieldOrPropertyMirror = (DotNetFieldOrPropertyProxy) objectPair.getSecond();
			if(visitedVariables.contains(fieldOrPropertyMirror))
			{
				return;
			}

			visitedVariables.add(fieldOrPropertyMirror);

			DotNetTypeProxy parent = fieldOrPropertyMirror.getParentType();

			DotNetValueProxy thisObjectValue = ThisObjectEvaluator.calcThisObject(frame, frame.getThisObject());
			DotNetTypeProxy type = thisObjectValue.getType();
			if(thisObjectValue instanceof DotNetObjectValueProxy && parent.equals(type))
			{
				consumer.consume(new DotNetFieldOrPropertyValueNode(debuggerContext, fieldOrPropertyMirror, frame, (DotNetObjectValueProxy) thisObjectValue));
			}
			else if(thisObjectValue instanceof DotNetStructValueProxy && parent.equals(type))
			{
				DotNetStructValueProxy structValueMirror = (DotNetStructValueProxy) thisObjectValue;

				DotNetStructValueInfo valueInfo = new DotNetStructValueInfo(structValueMirror, null, fieldOrPropertyMirror, objectPair.getFirst());

				consumer.consume(new DotNetFieldOrPropertyValueNode(debuggerContext, fieldOrPropertyMirror, frame, null, valueInfo));
			}
			else
			{
				consumer.consume(new CSharpWatcherNode(debuggerContext, ApplicationManager.getApplication().runReadAction((Computable<String>) referenceExpression::getText), frame, objectPair
						.getFirst()));
			}
		}
	}
	catch(Exception e)
	{
		// ignored
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:68,代码来源:CSharpDebuggerProvider.java

示例12: processUsage

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@Override
@RequiredReadAction
public boolean processUsage(@NotNull ChangeInfo changeInfo, @NotNull UsageInfo usageInfo, boolean beforeMethodChange, @NotNull UsageInfo[] usages)
{
	if(!(changeInfo instanceof CSharpChangeInfo))
	{
		return false;
	}
	PsiElement element = usageInfo.getElement();
	if(!(element instanceof DotNetReferenceExpression))
	{
		return false;
	}

	if(!beforeMethodChange)
	{
		return true;
	}

	if(changeInfo.isNameChanged())
	{
		((DotNetReferenceExpression) element).handleElementRename(changeInfo.getNewName());
	}

	if(((CSharpChangeInfo) changeInfo).isParametersChanged())
	{
		PsiElement parent = element.getParent();
		if(parent instanceof CSharpCallArgumentListOwner)
		{
			CSharpCallArgumentList parameterList = ((CSharpCallArgumentListOwner) parent).getParameterList();
			if(parameterList == null)
			{
				return true;
			}

			CSharpParameterInfo[] newParameters = ((CSharpChangeInfo) changeInfo).getNewParameters();

			DotNetExpression[] expressions = parameterList.getExpressions();
			String[] newArguments = new String[newParameters.length];

			for(CSharpParameterInfo newParameter : newParameters)
			{
				if(newParameter.getOldIndex() != -1)
				{
					newArguments[newParameter.getNewIndex()] = expressions[newParameter.getOldIndex()].getText();
				}
				else
				{
					newArguments[newParameter.getNewIndex()] = newParameter.getDefaultValue();
				}
			}

			StringBuilder builder = new StringBuilder("test(");
			builder.append(StringUtil.join(newArguments, ", "));
			builder.append(");");

			CSharpCallArgumentListOwner call = (CSharpCallArgumentListOwner) CSharpFileFactory.createExpression(usageInfo.getProject(), builder.toString());
			parameterList.replace(call.getParameterList());
		}
		return true;
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:64,代码来源:CSharpChangeSignatureUsageProcessor.java

示例13: evaluate

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
public abstract void evaluate(@NotNull DotNetStackFrameProxy frame,
@NotNull DotNetDebugContext debuggerContext,
@NotNull DotNetReferenceExpression element,
@NotNull Set<Object> visitedVariables,
@NotNull Consumer<XNamedValue> callback);
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:6,代码来源:DotNetDebuggerProvider.java

示例14: getReferenceExpression

import consulo.dotnet.psi.DotNetReferenceExpression; //导入依赖的package包/类
@NotNull
@Override
public DotNetReferenceExpression getReferenceExpression()
{
	return findNotNullChildByClass(MsilReferenceExpressionImpl.class);
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:7,代码来源:MsilUserTypeImpl.java


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