22 instantiations of SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (22)
Language\CodeGeneration\CodeWriter.cs (1)
152public SourceLocation Location => new(_absoluteIndex, _currentLineIndex, _currentLineCharacterIndex);
Language\Legacy\CSharpCodeParser.cs (3)
1241directiveStart = new SourceLocation( 1441directiveLocation = new SourceLocation( 1556directiveStart = new SourceLocation(
Language\Legacy\LocationTagged.cs (1)
17: this(value, new SourceLocation(absoluteIndex, lineIndex, characterIndex))
Language\Legacy\SeekableTextReader.cs (5)
68_location = new SourceLocation(_filePath, _position, _cachedLineInfo.LineIndex, _position - _cachedLineInfo.Span.Start); 85_location = new SourceLocation(_filePath, _position, nextLineIndex, _position - nextLineSpan.Start); 100_location = new SourceLocation(_filePath, _position, prevLineIndex, _position - prevLineSpan.Start); 108_location = new SourceLocation(_filePath, _position, SourceText.Lines.GetLinePosition(_position)); 127_location = new SourceLocation(_filePath, Length, lineNumber, SourceText.Lines[lineNumber].Span.Length);
Language\Legacy\SourceLocationTracker.cs (1)
30return new SourceLocation(location.FilePath, absoluteIndex, lineIndex, characterIndex);
Language\SourceLocation.cs (3)
23new SourceLocation(absoluteIndex: -1, lineIndex: -1, characterIndex: -1); 30new SourceLocation(absoluteIndex: 0, lineIndex: 0, characterIndex: 0); 94new SourceLocation(span.Value.FilePath, span.Value.AbsoluteIndex, span.Value.LineIndex, span.Value.CharacterIndex);
Language\Syntax\SyntaxNodeExtensions.cs (8)
55return new SourceLocation(source.FilePath, 0, 0, 0); 63return new SourceLocation( 71return new SourceLocation( 79return new SourceLocation(source.FilePath, node.Position, 0, 0); 90return new SourceLocation(source.FilePath, 0, 0, 0); 98return new SourceLocation( 106return new SourceLocation( 114return new SourceLocation(source.FilePath, token.Position, 0, 0);
92 references to SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (92)
Language\CodeGeneration\CodeRenderingContext.cs (1)
137var currentLocation = CodeWriter.Location with
Language\CodeGeneration\CodeWriter.cs (1)
152public SourceLocation Location => new(_absoluteIndex, _currentLineIndex, _currentLineCharacterIndex);
Language\DefaultDirectiveSyntaxTreePass.cs (1)
83var directiveStart = node.Transition.GetSourceLocation(_syntaxTree.Source);
Language\Legacy\CSharpCodeParser.cs (18)
808var location = CurrentStart; 1237var directiveStart = CurrentStart; 1323Func<string, List<RazorDiagnostic>, SourceLocation, ISpanChunkGenerator> chunkGeneratorFactory) 1335SourceLocation? valueStartLocation = null; 1338var keywordStartLocation = CurrentStart; 1407SourceLocation directiveLocation, 1440var original = directiveLocation; 1464internal static ParsedDirective ParseAddOrRemoveDirective(ParsedDirective directive, SourceLocation directiveLocation, List<RazorDiagnostic> errors) 1518SourceLocation directiveLocation, 1552var directiveStart = CurrentStart; 1951private void ValidateDirectiveUsage(DirectiveDescriptor descriptor, SourceLocation directiveStart) 2028private void ParseDirectiveBlock(in SyntaxListBuilder<RazorSyntaxNode> builder, DirectiveDescriptor descriptor, Action<SyntaxListBuilder<RazorSyntaxNode>, SourceLocation> parseChildren) 2049var startingBraceLocation = CurrentStart; 2580var start = CurrentStart; 2931var start = CurrentStart; 2945private bool Balance(SyntaxListBuilder<RazorSyntaxNode> builder, BalancingModes mode, SyntaxKind left, SyntaxKind right, SourceLocation start) 3151public Block(string name, SourceLocation start) 3158public SourceLocation Start { get; set; }
Language\Legacy\DirectiveHtmlTokenizer.cs (3)
14private SourceLocation _firstTokenVisitLocation = SourceLocation.Undefined; 18var location = CurrentLocation;
Language\Legacy\HtmlMarkupParser.cs (13)
483var tagStart = CurrentStart; 510var endTagStart = CurrentStart; 544SourceLocation endTagStartLocation, 628SourceLocation tagStartLocation, 796var textLocation = CurrentStart; 966var textLocation = CurrentStart; 1373var prefixStart = CurrentStart; 1421var valueStart = CurrentStart; 1499var tagStart = CurrentStart; 1533var tagStart = CurrentStart; 2197var bookmark = CurrentStart; 2377SourceLocation tagLocation, 2392public SourceLocation TagLocation { get; }
Language\Legacy\LanguageCharacteristics.cs (2)
22return TokenizeString(SourceLocation.Zero, content); 25public virtual IEnumerable<SyntaxToken> TokenizeString(SourceLocation start, string input)
Language\Legacy\LocationTagged.cs (2)
21public LocationTagged(TValue value, SourceLocation location) 32public SourceLocation Location { get; }
Language\Legacy\SeekableTextReader.cs (3)
16private SourceLocation _location; 35public SourceLocation Location => _location; 120_location = SourceLocation.Zero;
Language\Legacy\SourceLocationTracker.cs (4)
11public static SourceLocation Advance(SourceLocation location, string text) => 14public static SourceLocation Advance(SourceLocation location, ReadOnlySpan<char> text)
Language\Legacy\TagHelperBlockRewriter.cs (2)
77var attributeNameLocation = SourceLocation.Undefined;
Language\Legacy\TagHelperParseTreeRewriter.cs (7)
511var errorStart = GetStartTagDeclarationErrorStart(tag, _source); 528var errorStart = GetEndTagDeclarationErrorStart(tag, _source); 581var errorStart = SourceLocationTracker.Advance(child.GetSourceLocation(_source), whitespace); 701var errorStart = GetStartTagDeclarationErrorStart(tagBlock, source); 719var errorStart = GetEndTagDeclarationErrorStart(tagBlock, source); 729private static SourceLocation GetStartTagDeclarationErrorStart(MarkupStartTagSyntax tagBlock, RazorSourceDocument source) 734private static SourceLocation GetEndTagDeclarationErrorStart(MarkupEndTagSyntax tagBlock, RazorSourceDocument source)
Language\Legacy\Tokenizer.cs (2)
62public SourceLocation CurrentLocation => Source.Location; 64public SourceLocation CurrentStart { get; private set; }
Language\Legacy\TokenizerBackedParser.cs (2)
83protected SourceLocation CurrentStart => _tokenizer.Tokenizer.CurrentStart; 372var start = CurrentStart;
Language\SourceLocation.cs (19)
17public struct SourceLocation : IEquatable<SourceLocation> 20/// An undefined <see cref="SourceLocation"/>. 22public static readonly SourceLocation Undefined = 26/// A <see cref="SourceLocation"/> with <see cref="AbsoluteIndex"/>, <see cref="LineIndex"/>, and 29public static readonly SourceLocation Zero = 33/// Initializes a new instance of <see cref="SourceLocation"/>. 49/// Initializes a new instance of <see cref="SourceLocation"/>. 84/// Creates a new instance of <see cref="SourceLocation"/> from the provided span. 87/// The source span. If <c>null</c>, <see cref="SourceLocation.Undefined"/> will be returned. 89/// <remarks>A <see cref="SourceLocation"/> that corresponds to the beginning of the span.</remarks> 90public static SourceLocation FromSpan(SourceSpan? span) 93SourceLocation.Undefined : 111return obj is SourceLocation && 112Equals((SourceLocation)obj); 126public bool Equals(SourceLocation other) 134public static bool operator ==(SourceLocation left, SourceLocation right) 139public static bool operator !=(SourceLocation left, SourceLocation right)
Language\SourceSpan.cs (2)
14public static readonly SourceSpan Undefined = new SourceSpan(SourceLocation.Undefined, 0); 21public SourceSpan(SourceLocation location, int contentLength)
Language\Syntax\SyntaxNodeExtensions.cs (5)
43public static SourceLocation GetSourceLocation(this SyntaxNodeOrToken nodeOrToken, RazorSourceDocument source) 48public static SourceLocation GetSourceLocation(this SyntaxNode node, RazorSourceDocument source) 83public static SourceLocation GetSourceLocation(this SyntaxToken token, RazorSourceDocument source) 120var location = node.GetSourceLocation(source); 128var location = token.GetSourceLocation(source);
Mvc\RazorExtensionsDiagnosticFactory.cs (5)
22new SourceSpan(SourceLocation.Undefined, contentLength: 0), 35new SourceSpan(SourceLocation.Undefined, contentLength: 0), 48new SourceSpan(SourceLocation.Undefined, contentLength: 0), 61new SourceSpan(SourceLocation.Undefined, contentLength: 0), 73new SourceSpan(SourceLocation.Undefined, contentLength: 0),