25 instantiations of SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (24)
Language\CodeGeneration\CodeWriter.cs (1)
152
public SourceLocation Location =>
new
(_absoluteIndex, _currentLineIndex, _currentLineCharacterIndex);
Language\Legacy\CSharpCodeParser.cs (5)
1252
directiveStart = new
SourceLocation
(
1452
directiveLocation = new
SourceLocation
(
1567
directiveStart = new
SourceLocation
(
2062
new
SourceLocation
(Context.SourceDocument.GetFilePathForDisplay(), absoluteIndex, position.Line, position.Character),
2075
new
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)
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);
Microsoft.CodeAnalysis.Razor.DotNetFormat (1)
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces.Shared\Extensions\SourceTextExtensions.cs (1)
322
location = new
SourceLocation
(absoluteIndex, line, character);
92 references to SourceLocation
Microsoft.CodeAnalysis.Razor.Compiler (85)
Language\CodeGeneration\CodeRenderingContext.cs (1)
137
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)
810
var
location = CurrentStart;
1248
var
directiveStart = CurrentStart;
1334
Func<string, List<RazorDiagnostic>,
SourceLocation
, ISpanChunkGenerator> chunkGeneratorFactory)
1346
SourceLocation
? valueStartLocation = null;
1349
var
keywordStartLocation = CurrentStart;
1418
SourceLocation
directiveLocation,
1451
var
original = directiveLocation;
1475
internal static ParsedDirective ParseAddOrRemoveDirective(ParsedDirective directive,
SourceLocation
directiveLocation, List<RazorDiagnostic> errors)
1529
SourceLocation
directiveLocation,
1563
var
directiveStart = CurrentStart;
1970
private void ValidateDirectiveUsage(DirectiveDescriptor descriptor,
SourceLocation
directiveStart)
2183
private void ParseDirectiveBlock(in SyntaxListBuilder<RazorSyntaxNode> builder, DirectiveDescriptor descriptor, Action<SyntaxListBuilder<RazorSyntaxNode>,
SourceLocation
> parseChildren)
2204
var
startingBraceLocation = CurrentStart;
2735
var
start = CurrentStart;
3086
var
start = CurrentStart;
3100
private bool Balance(SyntaxListBuilder<RazorSyntaxNode> builder, BalancingModes mode, SyntaxKind left, SyntaxKind right,
SourceLocation
start)
3306
public Block(string name,
SourceLocation
start)
3313
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)
501
var
tagStart = CurrentStart;
528
var
endTagStart = CurrentStart;
562
SourceLocation
endTagStartLocation,
647
SourceLocation
tagStartLocation,
815
var
textLocation = CurrentStart;
983
var
textLocation = CurrentStart;
1389
var
prefixStart = CurrentStart;
1437
var
valueStart = CurrentStart;
1515
var
tagStart = CurrentStart;
1549
var
tagStart = CurrentStart;
2232
var
bookmark = CurrentStart;
2413
SourceLocation
tagLocation,
2428
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 (12)
17
public struct SourceLocation : IEquatable<
SourceLocation
>
22
public static readonly
SourceLocation
Undefined =
29
public static readonly
SourceLocation
Zero =
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),
Microsoft.CodeAnalysis.Razor.DotNetFormat (7)
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces.Shared\Extensions\RazorSyntaxNodeExtensions.cs (1)
212
var
location = node.GetSourceLocation(sourceDocument);
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces.Shared\Extensions\RazorSyntaxTokenExtensions.cs (1)
68
var
location = token.GetSourceLocation(source);
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces.Shared\Extensions\SourceLocationExtensions.cs (2)
8
using SourceLocation = Microsoft.AspNetCore.Razor.Language.
SourceLocation
;
12
public static LinePosition ToLinePosition(this
SourceLocation
location)
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces.Shared\Extensions\SourceTextExtensions.cs (3)
16
using SourceLocation = Microsoft.AspNetCore.Razor.Language.
SourceLocation
;
315
public static bool TryGetSourceLocation(this SourceText text, LinePosition position, out
SourceLocation
location)
318
public static bool TryGetSourceLocation(this SourceText text, int line, int character, out
SourceLocation
location)