2 writes to Span
Microsoft.CodeAnalysis.Razor.Compiler (2)
Language\SourceChange.cs (2)
31Span = new SourceSpan(absoluteIndex, length); 42Span = span;
42 references to Span
Microsoft.AspNetCore.Razor.Language.UnitTests (5)
SourceChangeTest.cs (5)
22Assert.Equal(15, change.Span.AbsoluteIndex); 23Assert.Equal(-1, change.Span.CharacterIndex); 24Assert.Null(change.Span.FilePath); 25Assert.Equal(7, change.Span.Length); 26Assert.Equal(-1, change.Span.LineIndex);
Microsoft.CodeAnalysis.Razor.Compiler (37)
Language\Legacy\CodeBlockEditHandler.cs (2)
82var relativePosition = change.Span.AbsoluteIndex - target.Position; 84if (target.GetContent().IndexOfAny(['{', '}', '@', '<', '*',], relativePosition, change.Span.Length) >= 0)
Language\Legacy\ImplicitExpressionEditHandler.cs (15)
84var changeRelativePosition = change.Span.AbsoluteIndex - target.Position; 134change.Span.AbsoluteIndex > 0 && 138(change.Span.Length == 0 || ParserHelpers.IsIdentifier(change.GetOriginalText(target), requireIdentifierStart: false)); 151change.Span.Length == 0; 178if (tokenEndIndex > change.Span.AbsoluteIndex) 180if (tokenEndIndex >= change.Span.AbsoluteIndex + change.Span.Length && token.Kind == SyntaxKind.Identifier) 185var transformedContent = change.GetEditedContent(token.Content, change.Span.AbsoluteIndex - tokenStartIndex); 233var changeStart = change.Span.AbsoluteIndex; 234var changeLength = change.Span.Length; 270if (IsInsideParenthesis(change.Span.AbsoluteIndex, tokens)) 433return change.Span.AbsoluteIndex > 0 && 439var offset = (change.Span.AbsoluteIndex - target.Position) + change.Span.Length; 487var changeRelativePosition = change.Span.AbsoluteIndex - target.Position;
Language\Legacy\LegacySyntaxNodeExtensions.cs (2)
73if (change.Span.AbsoluteIndex < node.Position) 81if (node.EndPosition < change.Span.AbsoluteIndex)
Language\Legacy\SpanEditHandler.cs (6)
79var changeOldEnd = change.Span.AbsoluteIndex + change.Span.Length; 80return change.Span.AbsoluteIndex >= target.Position && 115return (endOfFirstLine == -1 || (change.Span.AbsoluteIndex - target.Position) <= endOfFirstLine); 136return (change.Span.AbsoluteIndex + change.Span.Length) == target.EndPosition;
Language\SourceChange.cs (12)
46public bool IsDelete => Span.Length > 0 && NewText.Length == 0; 48public bool IsInsert => Span.Length == 0 && NewText.Length > 0; 50public bool IsReplace => Span.Length > 0 && NewText.Length > 0; 74return text.Remove(offset, Span.Length).Insert(offset, NewText); 84var start = Span.AbsoluteIndex; 85var end = Span.AbsoluteIndex + Span.Length; 111return node.GetContent().Substring(offset, Span.Length); 118Span.Equals(other.Span) && 130hash.Add(Span); 137return Span.ToString() + " : " + NewText;