22 instantiations of SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (22)
Language\CodeGeneration\CodeWriter.cs (1)
152
public SourceLocation Location =>
new
(_absoluteIndex, _currentLineIndex, _currentLineCharacterIndex);
Language\Legacy\CSharpCodeParser.cs (3)
1225
directiveStart = new
SourceLocation
(
1425
directiveLocation = new
SourceLocation
(
1540
directiveStart = 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)
30
return new
SourceLocation
(location.FilePath, absoluteIndex, lineIndex, characterIndex);
Language\SourceLocation.cs (3)
23
new
SourceLocation
(absoluteIndex: -1, lineIndex: -1, characterIndex: -1);
30
new
SourceLocation
(absoluteIndex: 0, lineIndex: 0, characterIndex: 0);
94
new
SourceLocation
(span.Value.FilePath, span.Value.AbsoluteIndex, span.Value.LineIndex, span.Value.CharacterIndex);
Language\Syntax\SyntaxNodeExtensions.cs (8)
55
return new
SourceLocation
(source.FilePath, 0, 0, 0);
63
return new
SourceLocation
(
71
return new
SourceLocation
(
79
return new
SourceLocation
(source.FilePath, node.Position, 0, 0);
90
return new
SourceLocation
(source.FilePath, 0, 0, 0);
98
return new
SourceLocation
(
106
return new
SourceLocation
(
114
return new
SourceLocation
(source.FilePath, token.Position, 0, 0);
92 references to SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (92)
Language\CodeGeneration\CodeRenderingContext.cs (1)
133
var
currentLocation = CodeWriter.Location with
Language\CodeGeneration\CodeWriter.cs (1)
152
public
SourceLocation
Location => new(_absoluteIndex, _currentLineIndex, _currentLineCharacterIndex);
Language\DefaultDirectiveSyntaxTreePass.cs (1)
83
var
directiveStart = node.Transition.GetSourceLocation(_syntaxTree.Source);
Language\Legacy\CSharpCodeParser.cs (18)
808
var
location = CurrentStart;
1221
var
directiveStart = CurrentStart;
1307
Func<string, List<RazorDiagnostic>,
SourceLocation
, ISpanChunkGenerator> chunkGeneratorFactory)
1319
SourceLocation
? valueStartLocation = null;
1322
var
keywordStartLocation = CurrentStart;
1391
SourceLocation
directiveLocation,
1424
var
original = directiveLocation;
1448
internal static ParsedDirective ParseAddOrRemoveDirective(ParsedDirective directive,
SourceLocation
directiveLocation, List<RazorDiagnostic> errors)
1502
SourceLocation
directiveLocation,
1536
var
directiveStart = CurrentStart;
1935
private void ValidateDirectiveUsage(DirectiveDescriptor descriptor,
SourceLocation
directiveStart)
2012
private void ParseDirectiveBlock(in SyntaxListBuilder<RazorSyntaxNode> builder, DirectiveDescriptor descriptor, Action<SyntaxListBuilder<RazorSyntaxNode>,
SourceLocation
> parseChildren)
2033
var
startingBraceLocation = CurrentStart;
2564
var
start = CurrentStart;
2915
var
start = CurrentStart;
2929
private bool Balance(SyntaxListBuilder<RazorSyntaxNode> builder, BalancingModes mode, SyntaxKind left, SyntaxKind right,
SourceLocation
start)
3107
public Block(string name,
SourceLocation
start)
3114
public
SourceLocation
Start { get; set; }
Language\Legacy\DirectiveHtmlTokenizer.cs (3)
14
private
SourceLocation
_firstTokenVisitLocation =
SourceLocation
.Undefined;
18
var
location = CurrentLocation;
Language\Legacy\HtmlMarkupParser.cs (13)
483
var
tagStart = CurrentStart;
510
var
endTagStart = CurrentStart;
544
SourceLocation
endTagStartLocation,
628
SourceLocation
tagStartLocation,
785
var
textLocation = CurrentStart;
955
var
textLocation = CurrentStart;
1361
var
prefixStart = CurrentStart;
1409
var
valueStart = CurrentStart;
1487
var
tagStart = CurrentStart;
1521
var
tagStart = CurrentStart;
2180
var
bookmark = CurrentStart;
2360
SourceLocation
tagLocation,
2375
public
SourceLocation
TagLocation { get; }
Language\Legacy\LanguageCharacteristics.cs (2)
22
return TokenizeString(
SourceLocation
.Zero, content);
25
public virtual IEnumerable<SyntaxToken> TokenizeString(
SourceLocation
start, string input)
Language\Legacy\LocationTagged.cs (2)
21
public LocationTagged(TValue value,
SourceLocation
location)
32
public
SourceLocation
Location { get; }
Language\Legacy\SeekableTextReader.cs (3)
16
private
SourceLocation
_location;
35
public
SourceLocation
Location => _location;
120
_location =
SourceLocation
.Zero;
Language\Legacy\SourceLocationTracker.cs (4)
11
public static
SourceLocation
Advance(
SourceLocation
location, string text) =>
14
public static
SourceLocation
Advance(
SourceLocation
location, ReadOnlySpan<char> text)
Language\Legacy\TagHelperBlockRewriter.cs (2)
77
var
attributeNameLocation =
SourceLocation
.Undefined;
Language\Legacy\TagHelperParseTreeRewriter.cs (7)
511
var
errorStart = GetStartTagDeclarationErrorStart(tag, _source);
528
var
errorStart = GetEndTagDeclarationErrorStart(tag, _source);
581
var
errorStart = SourceLocationTracker.Advance(child.GetSourceLocation(_source), whitespace);
701
var
errorStart = GetStartTagDeclarationErrorStart(tagBlock, source);
719
var
errorStart = GetEndTagDeclarationErrorStart(tagBlock, source);
729
private static
SourceLocation
GetStartTagDeclarationErrorStart(MarkupStartTagSyntax tagBlock, RazorSourceDocument source)
734
private static
SourceLocation
GetEndTagDeclarationErrorStart(MarkupEndTagSyntax tagBlock, RazorSourceDocument source)
Language\Legacy\Tokenizer.cs (2)
62
public
SourceLocation
CurrentLocation => Source.Location;
64
public
SourceLocation
CurrentStart { get; private set; }
Language\Legacy\TokenizerBackedParser.cs (2)
83
protected
SourceLocation
CurrentStart => _tokenizer.Tokenizer.CurrentStart;
372
var
start = CurrentStart;
Language\SourceLocation.cs (19)
17
public struct SourceLocation : IEquatable<
SourceLocation
>
20
/// An undefined <see cref="
SourceLocation
"/>.
22
public static readonly
SourceLocation
Undefined =
26
/// A <see cref="
SourceLocation
"/> with <see cref="AbsoluteIndex"/>, <see cref="LineIndex"/>, and
29
public 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>
90
public static
SourceLocation
FromSpan(SourceSpan? span)
93
SourceLocation
.Undefined :
111
return obj is
SourceLocation
&&
112
Equals((
SourceLocation
)obj);
126
public bool Equals(
SourceLocation
other)
134
public static bool operator ==(
SourceLocation
left,
SourceLocation
right)
139
public static bool operator !=(
SourceLocation
left,
SourceLocation
right)
Language\SourceSpan.cs (2)
14
public static readonly SourceSpan Undefined = new SourceSpan(
SourceLocation
.Undefined, 0);
21
public SourceSpan(
SourceLocation
location, int contentLength)
Language\Syntax\SyntaxNodeExtensions.cs (5)
43
public static
SourceLocation
GetSourceLocation(this SyntaxNodeOrToken nodeOrToken, RazorSourceDocument source)
48
public static
SourceLocation
GetSourceLocation(this SyntaxNode node, RazorSourceDocument source)
83
public static
SourceLocation
GetSourceLocation(this SyntaxToken token, RazorSourceDocument source)
120
var
location = node.GetSourceLocation(source);
128
var
location = token.GetSourceLocation(source);
Mvc\RazorExtensionsDiagnosticFactory.cs (5)
22
new SourceSpan(
SourceLocation
.Undefined, contentLength: 0),
35
new SourceSpan(
SourceLocation
.Undefined, contentLength: 0),
48
new SourceSpan(
SourceLocation
.Undefined, contentLength: 0),
61
new SourceSpan(
SourceLocation
.Undefined, contentLength: 0),
73
new SourceSpan(
SourceLocation
.Undefined, contentLength: 0),