本文整理汇总了C#中ICSharpCode.SharpDevelop.Dom.ExpressionResult类的典型用法代码示例。如果您正苦于以下问题:C# ExpressionResult类的具体用法?C# ExpressionResult怎么用?C# ExpressionResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionResult类属于ICSharpCode.SharpDevelop.Dom命名空间,在下文中一共展示了ExpressionResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MathModuleExpressionShouldNotHaveAnyCompletionItemsSinceMathModuleIsNotImported
public void MathModuleExpressionShouldNotHaveAnyCompletionItemsSinceMathModuleIsNotImported()
{
ExpressionResult result = new ExpressionResult("math", ExpressionContext.Default);
resolveResult = resolver.Resolve(result, parseInfo, GetPythonScript());
Assert.IsNull(resolveResult);
}
示例2: Resolve
public ResolveResult Resolve(ExpressionResult expressionResult, ParseInformation parseInfo, string fileContent)
{
if (parseInfo == null || (string.IsNullOrEmpty(fileContent) && !(expressionResult.Context is XamlContext)))
return null;
this.resolveExpression = expressionResult.Expression;
this.caretLine = expressionResult.Region.BeginLine;
this.caretColumn = expressionResult.Region.BeginColumn;
this.callingClass = parseInfo.CompilationUnit.GetInnermostClass(caretLine, caretColumn);
this.context = expressionResult.Context as XamlContext ?? CompletionDataHelper.ResolveContext(fileContent, parseInfo.CompilationUnit.FileName, Utils.GetOffsetFromFilePos(fileContent, caretLine, caretColumn));
switch (this.context.Description) {
case XamlContextDescription.AtTag:
case XamlContextDescription.None:
return ResolveElementName(resolveExpression);
case XamlContextDescription.InTag:
return ResolveAttribute(resolveExpression) ?? ResolveElementName(resolveExpression);
case XamlContextDescription.InAttributeValue:
MemberResolveResult mrr = ResolveAttribute(context.Attribute.Name);
if (mrr != null) {
var rr = ResolveAttributeValue(mrr.ResolvedMember, resolveExpression) ?? mrr;
return rr;
}
break;
case XamlContextDescription.InMarkupExtension:
return ResolveMarkupExtension(resolveExpression);
}
return null;
}
示例3: Resolve
public ResolveResult Resolve(string expression)
{
ExpressionResult expressionResult = new ExpressionResult(expression);
PythonResolverContext context = new PythonResolverContext(ParseInfo, expressionResult, String.Empty);
ResolveResult = Resolver.Resolve(context);
return ResolveResult;
}
示例4: ResolvePropertyExpression
void ResolvePropertyExpression(string expression)
{
PythonResolverContext context = new PythonResolverContext(parseInfo);
ExpressionResult expressionResult = new ExpressionResult(expression);
PythonResolver resolver = new PythonResolver();
result = resolver.Resolve(context, expressionResult);
}
示例5: Resolve
public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
{
IClass matchingClass = GetClass(resolverContext, expressionResult.Expression);
if (matchingClass != null) {
return CreateTypeResolveResult(matchingClass);
}
return null;
}
示例6: PythonResolverContext
public PythonResolverContext(ParseInformation parseInfo, ExpressionResult expressionResult, string fileContent)
{
this.fileContent = fileContent;
this.expressionResult = expressionResult;
GetCompilationUnit(parseInfo);
GetProjectContent();
GetCallingMember();
}
示例7: Resolve
public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
{
ResolveResult resolveResult = dotNetMethodResolver.Resolve(resolverContext, expressionResult);
if (resolveResult != null) {
return resolveResult;
}
return standardModuleMethodResolver.Resolve(resolverContext, expressionResult);
}
示例8: Resolve
public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
{
IProperty property = FindProperty(resolverContext, expressionResult.Expression);
if (property != null) {
return CreateMemberResolveResult(property);
}
return null;
}
示例9: Resolve
public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
{
PythonStandardModuleType type = GetStandardModuleTypeIfImported(resolverContext, expressionResult.Expression);
if (type != null) {
return new PythonStandardModuleResolveResult(type);
}
return null;
}
示例10: Resolve
public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
{
MemberName memberName = new MemberName(expressionResult.Expression);
IClass matchingClass = classResolver.GetClass(resolverContext, memberName.Type);
if (matchingClass != null) {
return new PythonMethodGroupResolveResult(matchingClass, memberName.Name);
}
return null;
}
示例11: Resolve
public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
{
if (resolverContext.HasCallingClass) {
if (IsSelfExpression(expressionResult)) {
return CreateResolveResult(resolverContext);
}
}
return null;
}
示例12: Resolve
public ResolveResult Resolve(PythonResolverContext resolverContext, ExpressionResult expressionResult)
{
this.resolverContext = resolverContext;
this.expressionResult = expressionResult;
if (resolverContext.HasImport(expressionResult.Expression)) {
return ResolveFullNamespace();
}
return ResolvePartialNamespaceMatch();
}
示例13: RefactoringMenuContext
public RefactoringMenuContext(ITextEditor editor, ExpressionResult expressionResult,
ResolveResult resolveResult, bool isDefinition,
IProjectContent projectContent, ICompilationUnit compilationUnit)
{
this.Editor = editor;
this.ExpressionResult = expressionResult;
this.ResolveResult = resolveResult;
this.IsDefinition = isDefinition;
this.ProjectContent = projectContent;
this.CompilationUnit = compilationUnit;
}
示例14: ProvideInsight
public override IInsightItem[] ProvideInsight(ExpressionResult expressionResult, ResolveResult result)
{
if (result == null)
return null;
IReturnType type = result.ResolvedType;
if (type == null)
return null;
return (from p in type.GetProperties()
where p.IsIndexer
select new MethodInsightItem(p)
).ToArray();
}
示例15: Resolve
/// <summary>
/// Tries to find a resource reference in the specified expression.
/// </summary>
/// <param name="expressionResult">The ExpressionResult for the expression.</param>
/// <param name="expr">The AST representation of the full expression.</param>
/// <param name="resolveResult">SharpDevelop's ResolveResult for the expression.</param>
/// <param name="caretLine">The 0-based line where the expression is located.</param>
/// <param name="caretColumn">The 0-based column where the expression is located.</param>
/// <param name="fileName">The name of the source file where the expression is located.</param>
/// <param name="fileContent">The content of the source file where the expression is located.</param>
/// <param name="expressionFinder">The ExpressionFinder for the file.</param>
/// <param name="charTyped">The character that has been typed at the caret position but is not yet in the buffer (this is used when invoked from code completion), or <c>null</c>.</param>
/// <returns>A ResourceResolveResult describing the referenced resource, or <c>null</c>, if this expression does not reference a resource using the ICSharpCode.Core.ResourceService class.</returns>
public ResourceResolveResult Resolve(ExpressionResult expressionResult, Expression expr, ResolveResult resolveResult, int caretLine, int caretColumn, string fileName, string fileContent, IExpressionFinder expressionFinder, char? charTyped)
{
IMember member = null;
// "ResourceService.GetString(..." may be a MemberResolveResult or
// MethodResolveResult, dependent on how much of the expression
// has already been typed.
MemberResolveResult mrr = resolveResult as MemberResolveResult;
if (mrr != null) {
// If it is a MemberResolveResult, this indicates that
// the complete expression is already in the buffer.
// So we only assign the member if Resolve is not invoked
// from code completion to prevent the code completion window
// from opening when typing something like:
// ResourceService.GetString(...)[
if (charTyped == null) {
member = mrr.ResolvedMember;
}
} else {
MethodGroupResolveResult methrr = resolveResult as MethodGroupResolveResult;
if (methrr != null) {
// If it is a MethodResolveResult, the expression is incomplete.
// Accept only if '(' has been typed.
if (charTyped == '(') {
member = methrr.GetMethodIfSingleOverload();
}
}
}
if (member is IMethod &&
LanguageProperties.CSharp.NameComparer.Equals(member.FullyQualifiedName, "ICSharpCode.Core.ResourceService.GetString")
) {
#if DEBUG
LoggingService.Debug("ResourceToolkit: ICSharpCodeCoreNRefactoryResourceResolver: ResourceService resource access detected");
#endif
string key = GetKeyFromExpression(expr);
// TODO: Add information about return type (of the resource, if present).
return new ResourceResolveResult(resolveResult.CallingClass, resolveResult.CallingMember, null, ICSharpCodeCoreResourceResolver.ResolveICSharpCodeCoreResourceSet(key, fileName), key);
}
return null;
}