Наследование: DepthFirstAstVisitor
Пример #1
0
        /// <summary>
        /// Analyzes the formatting of a given document and syntax tree.
        /// </summary>
        /// <param name="document">Document.</param>
        /// <param name="syntaxTree">Syntax tree.</param>
        /// <param name="token">The cancellation token.</param>
        public FormattingChanges AnalyzeFormatting(IDocument document, SyntaxTree syntaxTree, CancellationToken token = default(CancellationToken))
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            if (syntaxTree == null)
            {
                throw new ArgumentNullException("syntaxTree");
            }
            var result  = new FormattingChanges(document);
            var visitor = new FormattingVisitor(this, document, result, token);

            syntaxTree.AcceptVisitor(visitor);
            return(result);
        }
Пример #2
0
		/// <summary>
		/// Analyzes the formatting of a given document and syntax tree.
		/// </summary>
		/// <param name="document">Document.</param>
		/// <param name="syntaxTree">Syntax tree.</param>
		/// <param name="token">The cancellation token.</param>
		public FormattingChanges AnalyzeFormatting(IDocument document, SyntaxTree syntaxTree, CancellationToken token = default (CancellationToken))
		{
			if (document == null)
				throw new ArgumentNullException("document");
			if (syntaxTree == null)
				throw new ArgumentNullException("syntaxTree");
			var result = new FormattingChanges(document);
			var visitor = new FormattingVisitor(this, document, result, token);
			syntaxTree.AcceptVisitor(visitor);
			return result;
		}