24 instantiations of SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (24)
Language\CodeGeneration\CodeWriter.cs (1)
152public SourceLocation Location => new(_absoluteIndex, _currentLineIndex, _currentLineCharacterIndex);
Language\Legacy\CSharpCodeParser.cs (5)
1252directiveStart = new SourceLocation( 1452directiveLocation = new SourceLocation( 1567directiveStart = new SourceLocation( 2062new SourceLocation(Context.SourceDocument.GetFilePathForDisplay(), absoluteIndex, position.Line, position.Character), 2075new SourceLocation(Context.SourceDocument.GetFilePathForDisplay(), absoluteIndex, position.Line, position.Character),
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);
85 references to SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (85)
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)
810var location = CurrentStart; 1248var directiveStart = CurrentStart; 1334Func<string, List<RazorDiagnostic>, SourceLocation, ISpanChunkGenerator> chunkGeneratorFactory) 1346SourceLocation? valueStartLocation = null; 1349var keywordStartLocation = CurrentStart; 1418SourceLocation directiveLocation, 1451var original = directiveLocation; 1475internal static ParsedDirective ParseAddOrRemoveDirective(ParsedDirective directive, SourceLocation directiveLocation, List<RazorDiagnostic> errors) 1529SourceLocation directiveLocation, 1563var directiveStart = CurrentStart; 1970private void ValidateDirectiveUsage(DirectiveDescriptor descriptor, SourceLocation directiveStart) 2183private void ParseDirectiveBlock(in SyntaxListBuilder<RazorSyntaxNode> builder, DirectiveDescriptor descriptor, Action<SyntaxListBuilder<RazorSyntaxNode>, SourceLocation> parseChildren) 2204var startingBraceLocation = CurrentStart; 2735var start = CurrentStart; 3086var start = CurrentStart; 3100private bool Balance(SyntaxListBuilder<RazorSyntaxNode> builder, BalancingModes mode, SyntaxKind left, SyntaxKind right, SourceLocation start) 3306public Block(string name, SourceLocation start) 3313public SourceLocation Start { get; set; }
Language\Legacy\DirectiveHtmlTokenizer.cs (3)
14private SourceLocation _firstTokenVisitLocation = SourceLocation.Undefined; 18var location = CurrentLocation;
Language\Legacy\HtmlMarkupParser.cs (13)
501var tagStart = CurrentStart; 528var endTagStart = CurrentStart; 562SourceLocation endTagStartLocation, 647SourceLocation tagStartLocation, 815var textLocation = CurrentStart; 983var textLocation = CurrentStart; 1389var prefixStart = CurrentStart; 1437var valueStart = CurrentStart; 1515var tagStart = CurrentStart; 1549var tagStart = CurrentStart; 2232var bookmark = CurrentStart; 2413SourceLocation tagLocation, 2428public 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 (12)
17public struct SourceLocation : IEquatable<SourceLocation> 22public static readonly SourceLocation Undefined = 29public static readonly SourceLocation Zero = 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),