96 instantiations of SourceLocation
Microsoft.AspNetCore.Razor.Language.Legacy.UnitTests (4)
Legacy\ImplicitExpressionEditHandlerTest.cs (4)
300
var token = GetTokens(new
SourceLocation
(4, 1, 2), "hello").Single();
313
var token = GetTokens(new
SourceLocation
(4, 1, 2), "hello").Single();
326
var token = GetTokens(new
SourceLocation
(4, 1, 2), "hello").Single();
341
var token = GetTokens(new
SourceLocation
(4, 1, 2), "hello").Single();
Microsoft.AspNetCore.Razor.Language.UnitTests (68)
CodeGeneration\CSharpCodeWriterTest.cs (18)
41
var expected = new
SourceLocation
(absoluteIndex: 4, lineIndex: 0, characterIndex: 4);
58
var expected = new
SourceLocation
(absoluteIndex: 3 + WriterNewLineLength, lineIndex: 1, characterIndex: 3);
75
var expected = new
SourceLocation
(absoluteIndex: 4 + WriterNewLineLength, lineIndex: 1, characterIndex: 0);
93
var expected = new
SourceLocation
(
114
var expected = new
SourceLocation
(
134
var expected = new
SourceLocation
(
154
var expected = new
SourceLocation
(
176
var expected1 = new
SourceLocation
(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
179
var expected2 = new
SourceLocation
(absoluteIndex: 6, lineIndex: 1, characterIndex: 0);
197
var expected1 = new
SourceLocation
(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
200
var expected2 = new
SourceLocation
(absoluteIndex: 6, lineIndex: 2, characterIndex: 0);
218
var expected1 = new
SourceLocation
(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
221
var expected2 = new
SourceLocation
(absoluteIndex: 6, lineIndex: 2, characterIndex: 0);
239
var expected1 = new
SourceLocation
(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
242
var expected2 = new
SourceLocation
(absoluteIndex: 6, lineIndex: 2, characterIndex: 0);
260
var expected1 = new
SourceLocation
(absoluteIndex: 1, lineIndex: 1, characterIndex: 0);
263
var expected2 = new
SourceLocation
(absoluteIndex: 2, lineIndex: 1, characterIndex: 0);
278
var expected = new
SourceLocation
(absoluteIndex: 12, lineIndex: 1, characterIndex: 5);
DefaultRazorTagHelperBinderPhaseTest.cs (7)
29
new SourceSpan(new
SourceLocation
(14 + Environment.NewLine.Length, 1, 14), contentLength: 1)),
31
new SourceSpan(new
SourceLocation
(14 + Environment.NewLine.Length, 1, 14), contentLength: 1), "\"")
58
new SourceSpan(new
SourceLocation
(17 + Environment.NewLine.Length, 1, 17), contentLength: 1)),
60
new SourceSpan(new
SourceLocation
(17 + Environment.NewLine.Length, 1, 17), contentLength: 1), "\"")
87
new SourceSpan(new
SourceLocation
(17 + Environment.NewLine.Length, 1, 17), contentLength: 1)),
89
new SourceSpan(new
SourceLocation
(17 + Environment.NewLine.Length, 1, 17), contentLength: 1), "tagHelperPrefix", '\"', "\""),
480
new SourceSpan(new
SourceLocation
((Environment.NewLine.Length * 2) + 30, 2, 1), contentLength: 4), "form");
IntegrationTests\CodeGenerationIntegrationTest.cs (1)
174
{
new
(base.GetTestFileName() + ".cshtml", 328, 11, 8), "s" }
Legacy\CSharpCodeParserTest.cs (3)
19
var directiveLocation = new
SourceLocation
(1, 2, 3);
170
new SourceSpan(new
SourceLocation
(1, 2, 3), errorLength), directiveText);
173
var result = CSharpCodeParser.ParseAddOrRemoveDirective(directive, new
SourceLocation
(1, 2, 3), diagnostics);
Legacy\SourceLocationTrackerTest.cs (3)
12
private static readonly SourceLocation TestStartLocation = new
SourceLocation
(10, 42, 45);
20
var sourceLocation = new
SourceLocation
(path, 15, 2, 8);
200
return new
SourceLocation
(location.FilePath, absoluteIndex, lineIndex, characterIndex);
SourceLocationTest.cs (12)
16
var loc = new
SourceLocation
(0, 42, 24);
35
var sourceLocation = new
SourceLocation
(filePath, absoluteIndex, lineIndex, characterIndex);
50
var sourceLocationA = new
SourceLocation
(path, 10, 3, 4);
51
var sourceLocationB = new
SourceLocation
(path, 10, 3, 4);
52
var sourceLocationC = new
SourceLocation
(path, 10, 45, 8754);
68
var sourceLocationA = new
SourceLocation
(10, 3, 4);
69
var sourceLocationB = new
SourceLocation
(10, 45, 8754);
82
var sourceLocationA = new
SourceLocation
(10, 3, 4);
83
var sourceLocationB = new
SourceLocation
("different-file", 10, 3, 4);
98
var sourceLocationA = new
SourceLocation
(path, 10, 3, 4);
99
var sourceLocationB = new
SourceLocation
(path, 10, 3, 4);
100
var sourceLocationC = new
SourceLocation
("different-path", 10, 3, 4);
SourceSpanTest.cs (24)
18
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
19
new SourceSpan(new
SourceLocation
(5, 6, 7), 8));
22
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
23
new SourceSpan(new
SourceLocation
(5, 6, 7), 8));
36
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
37
new SourceSpan(new
SourceLocation
(5, 6, 7), 8));
40
new SourceSpan(new
SourceLocation
(1, 2, 3), 5),
41
new SourceSpan(new
SourceLocation
(5, 6, 7), 9));
52
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
53
new SourceSpan(new
SourceLocation
(5, 6, 7), 8));
56
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
57
new SourceSpan(new
SourceLocation
(5, 6, 8), 8));
68
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
69
new SourceSpan(new
SourceLocation
(5, 6, 8), 8));
72
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
73
new SourceSpan(new
SourceLocation
(5, 6, 7), 8));
84
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
85
new SourceSpan(new
SourceLocation
(5, 5, 7), 8));
88
new SourceSpan(new
SourceLocation
(1, 1, 3), 4),
89
new SourceSpan(new
SourceLocation
(5, 6, 7), 8));
100
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
101
new SourceSpan(new
SourceLocation
(4, 6, 7), 8));
104
new SourceSpan(new
SourceLocation
(1, 2, 3), 4),
105
new SourceSpan(new
SourceLocation
(5, 6, 7), 9));
Microsoft.AspNetCore.Razor.Test.Common (1)
Language\SyntaxTreeVerifier.cs (1)
123
_currentLocation = new
SourceLocation
(source.FilePath, 0, 0, 0);
Microsoft.CodeAnalysis.Razor.Compiler (22)
Language\CodeGeneration\CodeWriter.cs (1)
152
public SourceLocation Location =>
new
(_absoluteIndex, _currentLineIndex, _currentLineCharacterIndex);
Language\Legacy\CSharpCodeParser.cs (3)
1230
directiveStart = new
SourceLocation
(
1430
directiveLocation = new
SourceLocation
(
1545
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);
Microsoft.CodeAnalysis.Razor.Workspaces (1)
Extensions\SourceTextExtensions.cs (1)
292
location = new
SourceLocation
(absoluteIndex, line, character);
215 references to SourceLocation
Microsoft.AspNetCore.Razor.Language.Legacy.UnitTests (13)
Legacy\ImplicitExpressionEditHandlerTest.cs (13)
19
var span = GetSyntaxNode(
SourceLocation
.Zero, "(Hell)(o)");
33
var span = GetSyntaxNode(
SourceLocation
.Zero, "(Hell)(o)");
47
var span = GetSyntaxNode(
SourceLocation
.Zero, "(Hell)(o)");
61
var span = GetSyntaxNode(
SourceLocation
.Zero, "(H(ell)o)");
354
var tokens = GetTokens(
SourceLocation
.Zero, "(hello)point(world)");
367
var tokens = GetTokens(
SourceLocation
.Zero, "(hello))point)");
380
var tokens = GetTokens(
SourceLocation
.Zero, "Hello World");
393
var tokens = GetTokens(
SourceLocation
.Zero, "Foo(GetValue(), DoSomething(point))");
408
var span = GetSyntaxNode(
SourceLocation
.Zero, "(Hello World)");
422
var span = GetSyntaxNode(
SourceLocation
.Zero, "(Hello");
436
var span = GetSyntaxNode(
SourceLocation
.Zero, "(Hello)");
446
private static Syntax.MarkupTextLiteralSyntax GetSyntaxNode(
SourceLocation
start, string content)
460
private static Syntax.SyntaxTokenList GetTokens(
SourceLocation
start, string content)
Microsoft.AspNetCore.Razor.Language.UnitTests (96)
CodeGeneration\CSharpCodeWriterTest.cs (36)
40
var
location = writer.Location;
41
var
expected = new SourceLocation(absoluteIndex: 4, lineIndex: 0, characterIndex: 4);
57
var
location = writer.Location;
58
var
expected = new SourceLocation(absoluteIndex: 3 + WriterNewLineLength, lineIndex: 1, characterIndex: 3);
73
var
location = writer.Location;
75
var
expected = new SourceLocation(absoluteIndex: 4 + WriterNewLineLength, lineIndex: 1, characterIndex: 0);
91
var
location = writer.Location;
93
var
expected = new SourceLocation(
112
var
location = writer.Location;
114
var
expected = new SourceLocation(
132
var
location = writer.Location;
134
var
expected = new SourceLocation(
152
var
location = writer.Location;
154
var
expected = new SourceLocation(
170
var
location1 = writer.Location;
173
var
location2 = writer.Location;
176
var
expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
179
var
expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 1, characterIndex: 0);
191
var
location1 = writer.Location;
194
var
location2 = writer.Location;
197
var
expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
200
var
expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 2, characterIndex: 0);
212
var
location1 = writer.Location;
215
var
location2 = writer.Location;
218
var
expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
221
var
expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 2, characterIndex: 0);
233
var
location1 = writer.Location;
236
var
location2 = writer.Location;
239
var
expected1 = new SourceLocation(absoluteIndex: 5, lineIndex: 1, characterIndex: 0);
242
var
expected2 = new SourceLocation(absoluteIndex: 6, lineIndex: 2, characterIndex: 0);
254
var
location1 = writer.Location;
257
var
location2 = writer.Location;
260
var
expected1 = new SourceLocation(absoluteIndex: 1, lineIndex: 1, characterIndex: 0);
263
var
expected2 = new SourceLocation(absoluteIndex: 2, lineIndex: 1, characterIndex: 0);
275
var
location = writer.Location;
278
var
expected = new SourceLocation(absoluteIndex: 12, lineIndex: 1, characterIndex: 5);
DefaultRazorTagHelperBinderPhaseTest.cs (1)
478
new SourceSpan(
SourceLocation
.Zero, contentLength: 1));
Legacy\CodeBlockEditHandlerTest.cs (13)
20
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
34
var span = GetSpan(
SourceLocation
.Zero, "Hello <div>@world</div>.");
48
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
62
var span = GetSpan(
SourceLocation
.Zero, "Hello <div></div>.");
76
var span = GetSpan(
SourceLocation
.Zero, "Hello @");
90
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
104
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
118
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
132
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
146
var span = GetSpan(
SourceLocation
.Zero, "world");
160
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
174
var span = GetSpan(
SourceLocation
.Zero, "Hello {world}.");
283
private static SyntaxNode GetSpan(
SourceLocation
start, string content)
Legacy\CSharpCodeParserTest.cs (5)
15
public static TheoryData<string,
SourceLocation
, IEnumerable<RazorDiagnostic>> InvalidTagHelperPrefixData
19
var
directiveLocation = new SourceLocation(1, 2, 3);
27
return new TheoryData<string,
SourceLocation
, IEnumerable<RazorDiagnostic>>
107
SourceLocation
directiveLocation,
139
var result = CSharpCodeParser.ParseAddOrRemoveDirective(directive,
SourceLocation
.Zero, diagnostics);
Legacy\SourceLocationTrackerTest.cs (29)
12
private static readonly
SourceLocation
TestStartLocation = new SourceLocation(10, 42, 45);
20
var
sourceLocation = new SourceLocation(path, 15, 2, 8);
23
var
result = SourceLocationTracker.Advance(sourceLocation, "Hello world");
36
var
location = TestStartLocation;
39
var
currentLocation = SourceLocationTracker.Advance(location, "foo\nbar\rbaz\r\nbox");
52
var
location = TestStartLocation;
55
var
currentLocation = UpdateLocation(location, 'f', 'o');
66
var
location = TestStartLocation;
69
var
currentLocation = UpdateLocation(location, 'f', 'o');
79
var
location = TestStartLocation;
82
var
currentLocation = UpdateLocation(location, '\n', 'o');
92
var
location = TestStartLocation;
95
var
currentLocation = UpdateLocation(location, '\n', 'o');
105
var
location = TestStartLocation;
108
var
currentLocation = UpdateLocation(location, '\n', 'o');
118
var
location = TestStartLocation;
121
var
currentLocation = UpdateLocation(location, '\r', 'o');
131
var
location = TestStartLocation;
134
var
currentLocation = UpdateLocation(location, '\r', 'o');
144
var
location = TestStartLocation;
147
var
currentLocation = UpdateLocation(location, '\r', 'o');
157
var
location = TestStartLocation;
160
var
currentLocation = UpdateLocation(location, '\r', '\n');
170
var
location = TestStartLocation;
173
var
currentLocation = UpdateLocation(location, '\r', '\n');
183
var
location = TestStartLocation;
186
var
currentLocation = UpdateLocation(location, '\r', '\n');
192
private static
SourceLocation
UpdateLocation(
SourceLocation
location, char v1, char v2)
SourceLocationTest.cs (12)
16
var
loc = new SourceLocation(0, 42, 24);
35
var
sourceLocation = new SourceLocation(filePath, absoluteIndex, lineIndex, characterIndex);
50
var
sourceLocationA = new SourceLocation(path, 10, 3, 4);
51
var
sourceLocationB = new SourceLocation(path, 10, 3, 4);
52
var
sourceLocationC = new SourceLocation(path, 10, 45, 8754);
68
var
sourceLocationA = new SourceLocation(10, 3, 4);
69
var
sourceLocationB = new SourceLocation(10, 45, 8754);
82
var
sourceLocationA = new SourceLocation(10, 3, 4);
83
var
sourceLocationB = new SourceLocation("different-file", 10, 3, 4);
98
var
sourceLocationA = new SourceLocation(path, 10, 3, 4);
99
var
sourceLocationB = new SourceLocation(path, 10, 3, 4);
100
var
sourceLocationC = new SourceLocation("different-path", 10, 3, 4);
Microsoft.AspNetCore.Razor.Test.Common (5)
Language\IntegrationTests\IntegrationTestBase.cs (3)
103
protected Dictionary<
SourceLocation
, string>? ExpectedMissingSourceMappings { get; set; }
551
if (ExpectedMissingSourceMappings?.TryGetValue(
SourceLocation
.FromSpan(sourceSpan), out var expectedMissingSpan) == true)
563
ExpectedMissingSourceMappings.Remove(
SourceLocation
.FromSpan(sourceSpan));
Language\SyntaxTreeVerifier.cs (2)
116
private
SourceLocation
_currentLocation;
134
var
start = token.GetSourceLocation(_source);
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;
1226
var
directiveStart = CurrentStart;
1312
Func<string, List<RazorDiagnostic>,
SourceLocation
, ISpanChunkGenerator> chunkGeneratorFactory)
1324
SourceLocation
? valueStartLocation = null;
1327
var
keywordStartLocation = CurrentStart;
1396
SourceLocation
directiveLocation,
1429
var
original = directiveLocation;
1453
internal static ParsedDirective ParseAddOrRemoveDirective(ParsedDirective directive,
SourceLocation
directiveLocation, List<RazorDiagnostic> errors)
1507
SourceLocation
directiveLocation,
1541
var
directiveStart = CurrentStart;
1940
private void ValidateDirectiveUsage(DirectiveDescriptor descriptor,
SourceLocation
directiveStart)
2017
private void ParseDirectiveBlock(in SyntaxListBuilder<RazorSyntaxNode> builder, DirectiveDescriptor descriptor, Action<SyntaxListBuilder<RazorSyntaxNode>,
SourceLocation
> parseChildren)
2038
var
startingBraceLocation = CurrentStart;
2569
var
start = CurrentStart;
2924
var
start = CurrentStart;
2938
private bool Balance(SyntaxListBuilder<RazorSyntaxNode> builder, BalancingModes mode, SyntaxKind left, SyntaxKind right,
SourceLocation
start)
3116
public Block(string name,
SourceLocation
start)
3123
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)
489
var
tagStart = CurrentStart;
516
var
endTagStart = CurrentStart;
550
SourceLocation
endTagStartLocation,
634
SourceLocation
tagStartLocation,
791
var
textLocation = CurrentStart;
961
var
textLocation = CurrentStart;
1367
var
prefixStart = CurrentStart;
1415
var
valueStart = CurrentStart;
1493
var
tagStart = CurrentStart;
1527
var
tagStart = CurrentStart;
2186
var
bookmark = CurrentStart;
2366
SourceLocation
tagLocation,
2381
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),
Microsoft.CodeAnalysis.Razor.Workspaces (9)
DocumentMapping\RazorEditService_Methods.cs (1)
47
var
closeBraceLocation = closeBrace.GetSourceLocation(source);
Extensions\LspExtensions_SourceText.cs (1)
42
public static bool TryGetSourceLocation(this SourceText text, Position position, out
SourceLocation
location)
Extensions\RazorSyntaxNodeExtensions.cs (1)
213
var
location = node.GetSourceLocation(sourceDocument);
Extensions\RazorSyntaxTokenExtensions.cs (1)
68
var
location = token.GetSourceLocation(source);
Extensions\SourceLocationExtensions.cs (1)
11
public static LinePosition ToLinePosition(this
SourceLocation
location)
Extensions\SourceTextExtensions.cs (2)
285
public static bool TryGetSourceLocation(this SourceText text, LinePosition position, out
SourceLocation
location)
288
public static bool TryGetSourceLocation(this SourceText text, int line, int character, out
SourceLocation
location)
LinkedEditingRange\LinkedEditingRangeHelper.cs (2)
22
if (!codeDocument.Source.Text.TryGetSourceLocation(linePosition, out
var
validLocation))
45
SourceLocation
location,