Skip to content

Commit 138491f

Browse files
author
Andrew Hall
committed
Merge branch 'main' into remove_razor_ea
2 parents 1f654eb + 443b51a commit 138491f

File tree

55 files changed

+756
-464
lines changed

Some content is hidden

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

55 files changed

+756
-464
lines changed

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<Sha>839cdfb0ecca5e0be3dbccd926e7651ef50fdf10</Sha>
77
</Dependency>
88
<!-- Intermediate is necessary for source build. -->
9-
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.615601">
9+
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.616401">
1010
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
11-
<Sha>232bcf31aad21949f80d6706720540b85e43fff3</Sha>
11+
<Sha>c3d4c372a15c2de79a2f26fe2b6b3644996d8550</Sha>
1212
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
1313
</Dependency>
1414
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.14.0-3.25128.2">

eng/Versions.props

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,27 @@
4949
<PropertyGroup Label="Automated">
5050
<MicrosoftNETCoreBrowserDebugHostTransportPackageVersion>6.0.2-servicing.22064.6</MicrosoftNETCoreBrowserDebugHostTransportPackageVersion>
5151
<MicrosoftNETCorePlatformsPackageVersion>6.0.1</MicrosoftNETCorePlatformsPackageVersion>
52-
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesPackageVersion>10.0.615601</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesPackageVersion>
53-
<MicrosoftSourceBuildIntermediatearcadePackageVersion>9.0.0-beta.25111.5</MicrosoftSourceBuildIntermediatearcadePackageVersion>
54-
<MicrosoftDotNetXliffTasksPackageVersion>1.0.0-beta.23475.1</MicrosoftDotNetXliffTasksPackageVersion>
55-
<MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>1.0.0-beta.23475.1</MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>
56-
<MicrosoftNetCompilersToolsetPackageVersion>4.14.0-dev</MicrosoftNetCompilersToolsetPackageVersion>
57-
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.14.0-dev</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
58-
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
59-
<MicrosoftCodeAnalysisCommonPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisCommonPackageVersion>
60-
<MicrosoftCodeAnalysisCSharpPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisCSharpPackageVersion>
61-
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
62-
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
63-
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
64-
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
65-
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
66-
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
67-
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
68-
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
69-
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
70-
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
71-
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
72-
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.14.0-dev</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
73-
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.14.0-dev</MicrosoftSourceBuildIntermediateroslynPackageVersion>
74-
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.14.0-dev</MicrosoftVisualStudioLanguageServicesPackageVersion>
52+
<MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesPackageVersion>10.0.616401</MicrosoftSourceBuildIntermediatesourcebuildreferencepackagesPackageVersion>
53+
<MicrosoftSourceBuildIntermediatearcadePackageVersion>9.0.0-beta.25161.4</MicrosoftSourceBuildIntermediatearcadePackageVersion>
54+
<MicrosoftNetCompilersToolsetPackageVersion>4.14.0-3.25128.2</MicrosoftNetCompilersToolsetPackageVersion>
55+
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.14.0-3.25128.2</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
56+
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
57+
<MicrosoftCodeAnalysisCommonPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCommonPackageVersion>
58+
<MicrosoftCodeAnalysisCSharpPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpPackageVersion>
59+
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
60+
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
61+
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
62+
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
63+
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
64+
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
65+
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
66+
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
67+
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
68+
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
69+
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
70+
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
71+
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.14.0-3.25128.2</MicrosoftSourceBuildIntermediateroslynPackageVersion>
72+
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.14.0-3.25128.2</MicrosoftVisualStudioLanguageServicesPackageVersion>
7573
<!--
7674
Exception - Microsoft.Extensions.ObjectPool and System.Collections.Immutable packages are not updated by automation,
7775
but are present in Version.Details.xml for source-build PVP flow. See the comment in Version.Details.xml for more information.

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentFormattingEndpoint.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,15 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentFormattingParams
5656

5757
var options = RazorFormattingOptions.From(request.Options, _optionsMonitor.CurrentValue.CodeBlockBraceOnNextLine);
5858

59-
var htmlChanges = await _htmlFormatter.GetDocumentFormattingEditsAsync(documentContext.Snapshot, documentContext.Uri, request.Options, cancellationToken).ConfigureAwait(false);
59+
if (await _htmlFormatter.GetDocumentFormattingEditsAsync(
60+
documentContext.Snapshot,
61+
documentContext.Uri,
62+
request.Options,
63+
cancellationToken).ConfigureAwait(false) is not { } htmlChanges)
64+
{
65+
return null;
66+
}
67+
6068
var changes = await _razorFormattingService.GetDocumentFormattingChangesAsync(documentContext, htmlChanges, span: null, options, cancellationToken).ConfigureAwait(false);
6169

6270
return [.. changes.Select(codeDocument.Source.Text.GetTextEdit)];

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentOnTypeFormattingEndpoint.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,17 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentOnTypeFormatting
106106
}
107107
else if (triggerCharacterKind == RazorLanguageKind.Html)
108108
{
109-
var htmlChanges = await _htmlFormatter.GetOnTypeFormattingEditsAsync(documentContext.Snapshot, documentContext.Uri, request.Position, request.Character, request.Options, cancellationToken).ConfigureAwait(false);
109+
if (await _htmlFormatter.GetOnTypeFormattingEditsAsync(
110+
documentContext.Snapshot,
111+
documentContext.Uri,
112+
request.Position,
113+
request.Character,
114+
request.Options,
115+
cancellationToken).ConfigureAwait(false) is not { } htmlChanges)
116+
{
117+
return null;
118+
}
119+
110120
formattedChanges = await _razorFormattingService.GetHtmlOnTypeFormattingChangesAsync(documentContext, htmlChanges, options, hostDocumentIndex, request.Character[0], cancellationToken).ConfigureAwait(false);
111121
}
112122
else

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/DocumentRangeFormattingEndpoint.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(DocumentRangeFormattingP
6969

7070
var options = RazorFormattingOptions.From(request.Options, _optionsMonitor.CurrentValue.CodeBlockBraceOnNextLine);
7171

72-
var htmlChanges = await _htmlFormatter.GetDocumentFormattingEditsAsync(documentContext.Snapshot, documentContext.Uri, request.Options, cancellationToken).ConfigureAwait(false);
72+
if (await _htmlFormatter.GetDocumentFormattingEditsAsync(
73+
documentContext.Snapshot,
74+
documentContext.Uri,
75+
request.Options,
76+
cancellationToken).ConfigureAwait(false) is not { } htmlChanges)
77+
{
78+
return null;
79+
}
80+
7381
var changes = await _razorFormattingService.GetDocumentFormattingChangesAsync(documentContext, htmlChanges, request.Range.ToLinePositionSpan(), options, cancellationToken).ConfigureAwait(false);
7482

7583
return [.. changes.Select(codeDocument.Source.Text.GetTextEdit)];

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormatter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal sealed class HtmlFormatter(
2121
{
2222
private readonly IClientConnection _clientConnection = clientConnection;
2323

24-
public async Task<ImmutableArray<TextChange>> GetDocumentFormattingEditsAsync(
24+
public async Task<ImmutableArray<TextChange>?> GetDocumentFormattingEditsAsync(
2525
IDocumentSnapshot documentSnapshot,
2626
Uri uri,
2727
FormattingOptions options,
@@ -44,14 +44,14 @@ public async Task<ImmutableArray<TextChange>> GetDocumentFormattingEditsAsync(
4444

4545
if (result?.Edits is null)
4646
{
47-
return [];
47+
return null;
4848
}
4949

5050
var sourceText = await documentSnapshot.GetTextAsync(cancellationToken).ConfigureAwait(false);
5151
return result.Edits.SelectAsArray(sourceText.GetTextChange);
5252
}
5353

54-
public async Task<ImmutableArray<TextChange>> GetOnTypeFormattingEditsAsync(
54+
public async Task<ImmutableArray<TextChange>?> GetOnTypeFormattingEditsAsync(
5555
IDocumentSnapshot documentSnapshot,
5656
Uri uri,
5757
Position position,
@@ -75,7 +75,7 @@ public async Task<ImmutableArray<TextChange>> GetOnTypeFormattingEditsAsync(
7575

7676
if (result?.Edits is null)
7777
{
78-
return [];
78+
return null;
7979
}
8080

8181
var sourceText = await documentSnapshot.GetTextAsync(cancellationToken).ConfigureAwait(false);

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/IHtmlFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer.Formatting;
1313

1414
internal interface IHtmlFormatter
1515
{
16-
Task<ImmutableArray<TextChange>> GetDocumentFormattingEditsAsync(IDocumentSnapshot documentSnapshot, Uri uri, FormattingOptions options, CancellationToken cancellationToken);
17-
Task<ImmutableArray<TextChange>> GetOnTypeFormattingEditsAsync(IDocumentSnapshot documentSnapshot, Uri uri, Position position, string triggerCharacter, FormattingOptions options, CancellationToken cancellationToken);
16+
Task<ImmutableArray<TextChange>?> GetDocumentFormattingEditsAsync(IDocumentSnapshot documentSnapshot, Uri uri, FormattingOptions options, CancellationToken cancellationToken);
17+
Task<ImmutableArray<TextChange>?> GetOnTypeFormattingEditsAsync(IDocumentSnapshot documentSnapshot, Uri uri, Position position, string triggerCharacter, FormattingOptions options, CancellationToken cancellationToken);
1818
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private void ProjectManager_Changed(object? sender, ProjectChangeEventArgs args)
180180
{
181181
if (_publishedCSharpData.Remove(key))
182182
{
183-
_logger.LogDebug($"Removing previous C# publish data for {key.ProjectKey}/{key.DocumentFilePath}");
183+
_logger.LogDebug($"Removing previous C# publish data for {key.ProjectKey}/{key.FilePath}");
184184
}
185185
}
186186

@@ -208,15 +208,15 @@ private void ProjectManager_Changed(object? sender, ProjectChangeEventArgs args)
208208
{
209209
if (_publishedCSharpData.Remove(documentKey))
210210
{
211-
_logger.LogDebug($"Removing previous C# publish data for {documentKey.ProjectKey}/{documentKey.DocumentFilePath}");
211+
_logger.LogDebug($"Removing previous C# publish data for {documentKey.ProjectKey}/{documentKey.FilePath}");
212212
}
213213
}
214214

215215
lock (_publishedHtmlData)
216216
{
217217
if (_publishedHtmlData.Remove(documentFilePath))
218218
{
219-
_logger.LogDebug($"Removing previous Html publish data for {documentKey.ProjectKey}/{documentKey.DocumentFilePath}");
219+
_logger.LogDebug($"Removing previous Html publish data for {documentKey.ProjectKey}/{documentKey.FilePath}");
220220
}
221221
}
222222
}
@@ -249,7 +249,7 @@ private void ProjectManager_Changed(object? sender, ProjectChangeEventArgs args)
249249
{
250250
if (_publishedCSharpData.Remove(key))
251251
{
252-
_logger.LogDebug($"Removing previous C# publish data for {key.ProjectKey}/{key.DocumentFilePath}");
252+
_logger.LogDebug($"Removing previous C# publish data for {key.ProjectKey}/{key.FilePath}");
253253
}
254254
}
255255
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/OpenDocumentGenerator.Comparer.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)