/// <summary> /// Returns what symbol, if any, the specified ordering syntax bound to. /// </summary> /// <param name="semanticModel"></param> /// <param name="ordering"></param> /// <param name="cancellationToken"></param> public static ISymbol GetSymbol( this SemanticModel semanticModel, OrderingSyntax ordering, CancellationToken cancellationToken = default) { return(Microsoft.CodeAnalysis.CSharp.CSharpExtensions .GetSymbolInfo(semanticModel, ordering, cancellationToken) .Symbol); }
public override void VisitOrdering(OrderingSyntax node) { var paramInfo = m_LinqParamInfoStack.Peek(); var paramNames = paramInfo.ParamNames; CodeBuilder.AppendFormat("orderby((function({0}){{ return(", string.Join(", ", paramNames.ToArray())); var opd = m_Model.GetOperation(node.Expression) as IConversionExpression; OutputExpressionSyntax(node.Expression, opd); CodeBuilder.AppendFormat("); }}), {0})", node.AscendingOrDescendingKeyword.Text != "descending" ? "true" : "false"); }
public override void VisitOrdering(OrderingSyntax node) { if (!PreVisit(node)) { return; } node.Expression?.Accept(this); base.VisitOrdering(node); PostVisit(node); }
private InvocationExpressionSyntax HandleOrderByExpression(OrderingSyntax orderingSyntax, bool firstOrderExpression) { var orderExpression = (ExpressionSyntax)SetFlagAndVisit(orderingSyntax.Expression); var orderByThenBy = firstOrderExpression ? "OrderBy" : "ThenBy"; orderByThenBy += orderingSyntax.AscendingOrDescendingKeyword.ValueText?.ToLower() == "descending" ? "Descending" : ""; InvocationExpressionSyntax orderByInvocationvocation = BuildFluentInvocation( orderByThenBy, BuildSimpleLambdaExpression(orderExpression)); return(orderByInvocationvocation); }
public void VisitOrdering(OrderingSyntax node) { if (node == null) { throw new ArgumentNullException("node"); } node.Validate(); node.Expression.Accept(this); if (node.Kind != AscendingOrDescending.Ascending) { _writer.WriteSpace(); _writer.WriteKeyword(PrinterKeyword.Descending); } }
public override SyntaxNode VisitOrdering(OrderingSyntax node) { node = (OrderingSyntax)base.VisitOrdering(node); var orderingKind = node.AscendingOrDescendingKeyword; if ((transformKind == TransformKind.OrderByAscToOrderByDesc) && (orderingKind.Kind() == SyntaxKind.AscendingKeyword)) { var descToken = SyntaxFactory.Token(orderingKind.LeadingTrivia, SyntaxKind.DescendingKeyword, orderingKind.TrailingTrivia); return(SyntaxFactory.Ordering(SyntaxKind.DescendingOrdering, node.Expression, descToken)); } if ((transformKind == TransformKind.OrderByDescToOrderByAsc) && (orderingKind.Kind() == SyntaxKind.DescendingKeyword)) { var ascToken = SyntaxFactory.Token(orderingKind.LeadingTrivia, SyntaxKind.AscendingKeyword, orderingKind.TrailingTrivia); return(SyntaxFactory.Ordering(SyntaxKind.AscendingOrdering, node.Expression, ascToken)); } return(node); }
public override void VisitOrdering(OrderingSyntax node) { node.Expression?.Accept(this); base.VisitOrdering(node); }
public override void VisitOrdering(OrderingSyntax node) { throw new NotImplementedException(); }
public override void VisitOrdering(OrderingSyntax node) { var saveCurrentScope = currentScope; currentScope = new DeclarationScope(currentScope); Visit(node.Expression); Debug.Assert(currentScope.Parent == saveCurrentScope); currentScope = saveCurrentScope; }
public override void VisitOrdering(OrderingSyntax queryOrdering) { base.VisitOrdering(queryOrdering); _indexData.HasOrder = true; }
public override SyntaxNode VisitOrdering(OrderingSyntax node) { node = (OrderingSyntax)base.VisitOrdering(node); var orderingKind = node.AscendingOrDescendingKeyword; if ((transformKind == TransformKind.OrderByAscToOrderByDesc) && (orderingKind.Kind() == SyntaxKind.AscendingKeyword)) { var descToken = SyntaxFactory.Token(orderingKind.LeadingTrivia, SyntaxKind.DescendingKeyword, orderingKind.TrailingTrivia); return SyntaxFactory.Ordering(SyntaxKind.DescendingOrdering, node.Expression, descToken); } if ((transformKind == TransformKind.OrderByDescToOrderByAsc) && (orderingKind.Kind() == SyntaxKind.DescendingKeyword)) { var ascToken = SyntaxFactory.Token(orderingKind.LeadingTrivia, SyntaxKind.AscendingKeyword, orderingKind.TrailingTrivia); return SyntaxFactory.Ordering(SyntaxKind.AscendingOrdering, node.Expression, ascToken); } return node; }
/// <summary> /// Gets the semantic information for an ordering clause in an orderby query clause. /// </summary> public abstract SymbolInfo GetSymbolInfo(OrderingSyntax node, CancellationToken cancellationToken = default(CancellationToken));
public override SymbolInfo GetSymbolInfo(OrderingSyntax node, CancellationToken cancellationToken = default(CancellationToken)) { using (Logger.LogBlock(FunctionId.CSharp_SemanticModel_GetSymbolInfo, message: this.SyntaxTree.FilePath, cancellationToken: cancellationToken)) { CheckSyntaxNode(node); var model = this.GetMemberModel(node); return (model == null) ? default(SymbolInfo) : model.GetSymbolInfo(node, cancellationToken); } }
public TameOrderingSyntax(OrderingSyntax node) { Node = node; AddChildren(); }
public void VisitOrdering(OrderingSyntax node) { if (node == null) throw new ArgumentNullException("node"); node.Validate(); node.Expression.Accept(this); if (node.Kind != AscendingOrDescending.Ascending) { _writer.WriteSpace(); _writer.WriteKeyword(PrinterKeyword.Descending); } }
public override void VisitOrdering(OrderingSyntax node) { }
public override void VisitOrdering(OrderingSyntax node) { base.VisitOrdering(node); }
/// <summary> /// /// </summary> /// <param name="node"></param> public override sealed void VisitOrdering(OrderingSyntax node) { this.OnNodeVisited(node); if (!this.traverseRootOnly) base.VisitOrdering(node); }
/// <summary> /// /// </summary> /// <param name="node"></param> public override sealed void VisitOrdering(OrderingSyntax node) { this.OnNodeVisited(node, this.type.IsInstanceOfType(node)); base.VisitOrdering(node); }
private LuaExpressionSyntax BuildOrdering(LuaIdentifierNameSyntax methodName, LuaExpressionSyntax collection, OrderingSyntax node, IQueryRangeVariable rangeVariable) { var type = semanticModel_.GetTypeInfo(node.Expression).Type; var typeName = GetTypeName(type); var expression = (LuaExpressionSyntax)node.Expression.Accept(this); var keySelector = new LuaFunctionExpressionSyntax(); keySelector.AddParameter(rangeVariable.Name); keySelector.AddStatement(new LuaReturnStatementSyntax(expression)); return(new LuaInvocationExpressionSyntax(methodName, collection, keySelector, LuaIdentifierNameSyntax.Nil, typeName)); }
public override SymbolInfo GetSymbolInfo(OrderingSyntax node, CancellationToken cancellationToken = default(CancellationToken)) { CheckSyntaxNode(node); var model = this.GetMemberModel(node); return (model == null) ? default(SymbolInfo) : model.GetSymbolInfo(node, cancellationToken); }
public SymbolInfo GetSymbolInfo(OrderingSyntax node, CancellationToken cancellationToken = default(CancellationToken)) { return GetSemanticModel(node).GetSymbolInfo(node, cancellationToken); }
// // Summary: // Called when the visitor visits a OrderingSyntax node. public virtual void VisitOrdering(OrderingSyntax node);
public override SymbolInfo GetSymbolInfo(OrderingSyntax node, CancellationToken cancellationToken = default(CancellationToken)) { var bound = GetBoundQueryClause(node); return GetSymbolInfoForQuery(bound); }
/// <inheritdoc /> public override Expression VisitOrdering(OrderingSyntax node) { throw Unexpected(node, nameof(VisitQueryExpression)); }
public override SyntaxNode VisitOrdering(OrderingSyntax node) { node = (OrderingSyntax)base.VisitOrdering(node); Classes.Add(node); return(node); }
public override void VisitOrdering(OrderingSyntax node) { Log(node, "Unsupported Syntax !"); }
public override Evaluation VisitOrdering(OrderingSyntax node) { node.Expression?.Accept <Evaluation>(this); return(base.VisitOrdering(node)); }
public override void VisitOrdering(OrderingSyntax node) { throw new NotSupportedException(); }