Skip to content

Commit 1546512

Browse files
committed
Rename all the things
1 parent 29d0434 commit 1546512

File tree

49 files changed

+210
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+210
-215
lines changed

src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private IDocumentMappingService BuildRazorDocumentMappingService()
117117

118118
LspRange? hostDocumentRange;
119119
razorDocumentMappingService.Setup(
120-
r => r.TryMapToHostDocumentRange(
120+
r => r.TryMapToRazorDocumentRange(
121121
It.IsAny<RazorCSharpDocument>(),
122122
InRange,
123123
It.IsAny<MappingBehavior>(),
@@ -130,7 +130,7 @@ private IDocumentMappingService BuildRazorDocumentMappingService()
130130

131131
LspRange? hostDocumentRange2;
132132
razorDocumentMappingService.Setup(
133-
r => r.TryMapToHostDocumentRange(
133+
r => r.TryMapToRazorDocumentRange(
134134
It.IsAny<RazorCSharpDocument>(),
135135
It.IsNotIn(InRange),
136136
It.IsAny<MappingBehavior>(),

src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDocumentMappingBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public LinePosition BinarySearch()
115115
LinePosition position = default;
116116
foreach (var index in Indexes)
117117
{
118-
DocumentMappingService.TryMapToHostDocumentPosition(CSharpDocument, index, out position, out _);
118+
DocumentMappingService.TryMapToRazorDocumentPosition(CSharpDocument, index, out position, out _);
119119
}
120120

121121
return position;

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/AbstractRazorDelegatingEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected virtual Task<TResponse> HandleDelegatedResponseAsync(TResponse delegat
133133
// Sometimes Html can actually be mapped to C#, like for example component attributes, which map to
134134
// C# properties, even though they appear entirely in a Html context. Since remapping is pretty cheap
135135
// it's easier to just try mapping, and see what happens, rather than checking for specific syntax nodes.
136-
if (DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetRequiredCSharpDocument(), positionInfo.HostDocumentIndex, out Position? csharpPosition, out _))
136+
if (DocumentMappingService.TryMapToCSharpDocumentPosition(codeDocument.GetRequiredCSharpDocument(), positionInfo.HostDocumentIndex, out Position? csharpPosition, out _))
137137
{
138138
// We're just gonna pretend this mapped perfectly normally onto C#. Moving this logic to the actual position info
139139
// calculating code is possible, but could have untold effects, so opt-in is better (for now?)

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/DataTipRangeHandlerEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V
7171
var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false);
7272
var csharpDocument = codeDocument.GetRequiredCSharpDocument();
7373

74-
if (!DocumentMappingService.TryMapToHostDocumentRange(csharpDocument, delegatedResponse.HoverRange, out var hoverRange))
74+
if (!DocumentMappingService.TryMapToRazorDocumentRange(csharpDocument, delegatedResponse.HoverRange, out var hoverRange))
7575
{
7676
return null;
7777
}
7878

7979
LspRange? expressionRange = null;
80-
if (delegatedResponse.ExpressionRange != null && !DocumentMappingService.TryMapToHostDocumentRange(csharpDocument, delegatedResponse.ExpressionRange, out expressionRange))
80+
if (delegatedResponse.ExpressionRange != null && !DocumentMappingService.TryMapToRazorDocumentRange(csharpDocument, delegatedResponse.ExpressionRange, out expressionRange))
8181
{
8282
return null;
8383
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorBreakpointSpanEndpoint.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ public Uri GetTextDocumentIdentifier(RazorBreakpointSpanParams request)
5151
var languageKind = codeDocument.GetLanguageKind(hostDocumentIndex, rightAssociative: false);
5252
// If we're in C#, then map to the right position in the generated document
5353
if (languageKind == RazorLanguageKind.CSharp &&
54-
!_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
54+
!_documentMappingService.TryMapToCSharpDocumentPosition(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
5555
{
5656
return null;
5757
}
5858
// Otherwise see if there is more C# on the line to map to
5959
else if (languageKind == RazorLanguageKind.Html &&
60-
!_documentMappingService.TryMapToGeneratedDocumentOrNextCSharpPosition(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
60+
!_documentMappingService.TryMapToCSharpPositionOrNext(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
6161
{
6262
return null;
6363
}
@@ -91,7 +91,7 @@ public Uri GetTextDocumentIdentifier(RazorBreakpointSpanParams request)
9191
// This in turn results in a breakpoint span encompassing `|__o = DateTime.Now;|`. Problem is that if we're doing "strict" mapping
9292
// Razor only maps `DateTime.Now` so mapping would fail. Therefore we use inclusive mapping which allows C# mappings that intersect
9393
// to be acceptable mapping locations
94-
if (!_documentMappingService.TryMapToHostDocumentRange(codeDocument.GetRequiredCSharpDocument(), projectedRange, MappingBehavior.Inclusive, out var hostDocumentRange))
94+
if (!_documentMappingService.TryMapToRazorDocumentRange(codeDocument.GetRequiredCSharpDocument(), projectedRange, MappingBehavior.Inclusive, out var hostDocumentRange))
9595
{
9696
return null;
9797
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/RazorProximityExpressionsEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public Uri GetTextDocumentIdentifier(RazorProximityExpressionsParams request)
5252
var languageKind = codeDocument.GetLanguageKind(hostDocumentIndex, rightAssociative: false);
5353
// If we're in C#, then map to the right position in the generated document
5454
if (languageKind == RazorLanguageKind.CSharp &&
55-
!_documentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
55+
!_documentMappingService.TryMapToCSharpDocumentPosition(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
5656
{
5757
return null;
5858
}
5959
// Otherwise see if there is more C# on the line to map to
6060
else if (languageKind == RazorLanguageKind.Html &&
61-
!_documentMappingService.TryMapToGeneratedDocumentOrNextCSharpPosition(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
61+
!_documentMappingService.TryMapToCSharpPositionOrNext(codeDocument.GetRequiredCSharpDocument(), hostDocumentIndex, out _, out projectedIndex))
6262
{
6363
return null;
6464
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Debugging/ValidateBreakpointRangeEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V
6060
var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false);
6161

6262
// We've already mapped the position, but sadly we need a range for breakpoints, so we have to do it again
63-
if (!_documentMappingService.TryMapToGeneratedDocumentRange(codeDocument.GetRequiredCSharpDocument(), request.Range, out var projectedRange))
63+
if (!_documentMappingService.TryMapToCSharpDocumentRange(codeDocument.GetRequiredCSharpDocument(), request.Range, out var projectedRange))
6464
{
6565
return null;
6666
}
@@ -92,7 +92,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V
9292

9393
var codeDocument = await documentContext.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false);
9494

95-
if (_documentMappingService.TryMapToHostDocumentRange(codeDocument.GetRequiredCSharpDocument(), delegatedResponse, MappingBehavior.Inclusive, out var projectedRange))
95+
if (_documentMappingService.TryMapToRazorDocumentRange(codeDocument.GetRequiredCSharpDocument(), delegatedResponse, MappingBehavior.Inclusive, out var projectedRange))
9696
{
9797
return projectedRange;
9898
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentHighlighting/DocumentHighlightEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V
7979
var csharpDocument = codeDocument.GetRequiredCSharpDocument();
8080
foreach (var highlight in response)
8181
{
82-
if (_documentMappingService.TryMapToHostDocumentRange(csharpDocument, highlight.Range, out var mappedRange))
82+
if (_documentMappingService.TryMapToRazorDocumentRange(csharpDocument, highlight.Range, out var mappedRange))
8383
{
8484
highlight.Range = mappedRange;
8585
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DocumentPresentation/AbstractTextDocumentPresentationEndpointBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ internal abstract class AbstractTextDocumentPresentationEndpointBase<TParams>(
9393
// For CSharp we need to map the range to the generated document
9494
if (languageKind == RazorLanguageKind.CSharp)
9595
{
96-
if (!_documentMappingService.TryMapToGeneratedDocumentRange(codeDocument.GetRequiredCSharpDocument(), request.Range, out var projectedRange))
96+
if (!_documentMappingService.TryMapToCSharpDocumentRange(codeDocument.GetRequiredCSharpDocument(), request.Range, out var projectedRange))
9797
{
9898
return null;
9999
}
@@ -189,7 +189,7 @@ private TextEdit[] MapTextEdits(bool mapRanges, RazorCodeDocument codeDocument,
189189
{
190190
foreach (var edit in edits)
191191
{
192-
if (!_documentMappingService.TryMapToHostDocumentRange(codeDocument.GetRequiredCSharpDocument(), ((TextEdit)edit).Range, out var newRange))
192+
if (!_documentMappingService.TryMapToRazorDocumentRange(codeDocument.GetRequiredCSharpDocument(), ((TextEdit)edit).Range, out var newRange))
193193
{
194194
return [];
195195
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/HoverEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V
7878

7979
// Sometimes what looks like a html attribute can actually map to C#, in which case its better to let Roslyn try to handle this.
8080
// We can only do this if we're in single server mode though, otherwise we won't be delegating to Roslyn at all
81-
if (SingleServerSupport && DocumentMappingService.TryMapToGeneratedDocumentPosition(codeDocument.GetRequiredCSharpDocument(), positionInfo.HostDocumentIndex, out _, out _))
81+
if (SingleServerSupport && DocumentMappingService.TryMapToCSharpDocumentPosition(codeDocument.GetRequiredCSharpDocument(), positionInfo.HostDocumentIndex, out _, out _))
8282
{
8383
return null;
8484
}
@@ -118,7 +118,7 @@ public void ApplyCapabilities(VSInternalServerCapabilities serverCapabilities, V
118118
}
119119
else if (positionInfo.LanguageKind == RazorLanguageKind.CSharp)
120120
{
121-
if (DocumentMappingService.TryMapToHostDocumentRange(codeDocument.GetRequiredCSharpDocument(), response.Range, out var projectedRange))
121+
if (DocumentMappingService.TryMapToRazorDocumentRange(codeDocument.GetRequiredCSharpDocument(), response.Range, out var projectedRange))
122122
{
123123
response.Range = projectedRange;
124124
}

0 commit comments

Comments
 (0)