예제 #1
0
        /// <summary>
        /// Adds a diagnostic indicating that a selector part could not be completely parsed
        /// to the specified collection of diagnostics.
        /// </summary>
        /// <param name="collection">The collection to which to add the diagnostic.</param>
        /// <param name="node">The syntax node which is associated with the diagnostic.</param>
        internal static void ReportInvalidSelectorPart(ref ICollection <DiagnosticInfo> collection,
                                                       UvssInvalidSelectorPartSyntax node)
        {
            Contract.Require(node, nameof(node));

            var span       = new TextSpan(0, node.Width);
            var diagnostic = new DiagnosticInfo(node, DiagnosticID.InvalidSelectorPart,
                                                DiagnosticSeverity.Error, span, $"Invalid selector part");

            Report(ref collection, diagnostic);
        }
예제 #2
0
        /// <inheritdoc/>
        public override SyntaxNode VisitInvalidSelectorPart(UvssInvalidSelectorPartSyntax node)
        {
            var unchanged = true;

            var newComponents = VisitList(node.Components);

            if (newComponents.Node != node.Components.Node)
            {
                unchanged = false;
            }

            return(unchanged ? node : new UvssInvalidSelectorPartSyntax(
                       newComponents));
        }
 /// <summary>
 /// Visits the specified invalid selector part node.
 /// </summary>
 /// <param name="node">The node to visit.</param>
 /// <returns>A node which should replace the visited node, or a reference to the visited node
 /// itself if no changes were made.</returns>
 public virtual SyntaxNode VisitInvalidSelectorPart(UvssInvalidSelectorPartSyntax node)
 {
     return(VisitSyntaxNode(node));
 }