public FormattingSpan(TextSpan span, TextSpan blockSpan, FormattingSpanKind spanKind, FormattingBlockKind blockKind, int indentationLevel)
 {
     Span             = span;
     BlockSpan        = blockSpan;
     Kind             = spanKind;
     BlockKind        = blockKind;
     IndentationLevel = indentationLevel;
 }
 public FormattingSpan(TextSpan span, TextSpan blockSpan, FormattingSpanKind spanKind, FormattingBlockKind blockKind, int indentationLevel, bool isInClassBody = false)
 {
     Span             = span;
     BlockSpan        = blockSpan;
     Kind             = spanKind;
     BlockKind        = blockKind;
     IndentationLevel = indentationLevel;
     IsInClassBody    = isInClassBody;
 }
Пример #3
0
        private void WriteSpan(SyntaxNode node, FormattingSpanKind kind)
        {
            if (node.IsMissing)
            {
                return;
            }

            var spanSource  = new TextSpan(node.Position, node.FullWidth);
            var blockSource = new TextSpan(_currentBlock.Position, _currentBlock.FullWidth);

            var span = new FormattingSpan(spanSource, blockSource, kind, _currentBlockKind, _currentIndentationLevel);

            _spans.Add(span);
        }
Пример #4
0
 public FormattingSpan(
     TextSpan span,
     TextSpan blockSpan,
     FormattingSpanKind spanKind,
     FormattingBlockKind blockKind,
     int razorIndentationLevel,
     int htmlIndentationLevel,
     bool isInClassBody = false,
     int componentLambdaNestingLevel = 0)
 {
     Span                        = span;
     BlockSpan                   = blockSpan;
     Kind                        = spanKind;
     BlockKind                   = blockKind;
     RazorIndentationLevel       = razorIndentationLevel;
     HtmlIndentationLevel        = htmlIndentationLevel;
     IsInClassBody               = isInClassBody;
     ComponentLambdaNestingLevel = componentLambdaNestingLevel;
 }
        private void WriteSpan(SyntaxNode node, FormattingSpanKind kind)
        {
            if (node.IsMissing)
            {
                return;
            }

            var spanSource  = new TextSpan(node.Position, node.FullWidth);
            var blockSource = new TextSpan(_currentBlock.Position, _currentBlock.FullWidth);

            var componentLambdaNestingLevel = _componentTracker.Count;

            var span = new FormattingSpan(
                spanSource,
                blockSource,
                kind,
                _currentBlockKind,
                _currentRazorIndentationLevel,
                _currentHtmlIndentationLevel,
                _isInClassBody,
                componentLambdaNestingLevel);

            _spans.Add(span);
        }