Skip to content

Commit 4dd2d93

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ExtractToCss
# Conflicts: # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/LanguageServerConstants.cs # src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Resources/SR.resx
2 parents 6199e76 + 2320a67 commit 4dd2d93

File tree

128 files changed

+2963
-676
lines changed

Some content is hidden

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

128 files changed

+2963
-676
lines changed

eng/Version.Details.xml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
33
<Source Uri="https://github.com/dotnet/dotnet" Mapping="razor" Sha="f5705c8f4c5079bba77bae8698ba1583bde0388c" BarId="269610" />
44
<ProductDependencies>
5-
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="5.0.0-1.25316.1">
5+
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="5.0.0-1.25321.1">
66
<Uri>https://github.com/dotnet/roslyn</Uri>
7-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
7+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
88
</Dependency>
9-
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="5.0.0-1.25316.1">
9+
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="5.0.0-1.25321.1">
1010
<Uri>https://github.com/dotnet/roslyn</Uri>
11-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
11+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
1212
</Dependency>
13-
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="5.0.0-1.25316.1">
13+
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="5.0.0-1.25321.1">
1414
<Uri>https://github.com/dotnet/roslyn</Uri>
15-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
15+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
1616
</Dependency>
17-
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.0.0-1.25316.1">
17+
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.0.0-1.25321.1">
1818
<Uri>https://github.com/dotnet/roslyn</Uri>
19-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
19+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
2020
</Dependency>
21-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="5.0.0-1.25316.1">
21+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="5.0.0-1.25321.1">
2222
<Uri>https://github.com/dotnet/roslyn</Uri>
23-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
23+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
2424
</Dependency>
25-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0-1.25316.1">
25+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0-1.25321.1">
2626
<Uri>https://github.com/dotnet/roslyn</Uri>
27-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
27+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
2828
</Dependency>
29-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0-1.25316.1">
29+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0-1.25321.1">
3030
<Uri>https://github.com/dotnet/roslyn</Uri>
31-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
31+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
3232
</Dependency>
33-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.0.0-1.25316.1">
33+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.0.0-1.25321.1">
3434
<Uri>https://github.com/dotnet/roslyn</Uri>
35-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
35+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
3636
</Dependency>
37-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="5.0.0-1.25316.1">
37+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="5.0.0-1.25321.1">
3838
<Uri>https://github.com/dotnet/roslyn</Uri>
39-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
39+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
4040
</Dependency>
41-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.0.0-1.25316.1">
41+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.0.0-1.25321.1">
4242
<Uri>https://github.com/dotnet/roslyn</Uri>
43-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
43+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
4444
</Dependency>
45-
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="5.0.0-1.25316.1">
45+
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="5.0.0-1.25321.1">
4646
<Uri>https://github.com/dotnet/roslyn</Uri>
47-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
47+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
4848
</Dependency>
49-
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="5.0.0-1.25316.1">
49+
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="5.0.0-1.25321.1">
5050
<Uri>https://github.com/dotnet/roslyn</Uri>
51-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
51+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
5252
</Dependency>
53-
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0-1.25316.1">
53+
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0-1.25321.1">
5454
<Uri>https://github.com/dotnet/roslyn</Uri>
55-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
55+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
5656
</Dependency>
57-
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0-1.25316.1">
57+
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0-1.25321.1">
5858
<Uri>https://github.com/dotnet/roslyn</Uri>
59-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
59+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
6060
</Dependency>
61-
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.0.0-1.25316.1">
61+
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.0.0-1.25321.1">
6262
<Uri>https://github.com/dotnet/roslyn</Uri>
63-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
63+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
6464
</Dependency>
65-
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="5.0.0-1.25316.1">
65+
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="5.0.0-1.25321.1">
6666
<Uri>https://github.com/dotnet/roslyn</Uri>
67-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
67+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
6868
</Dependency>
69-
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" Version="5.0.0-1.25316.1">
69+
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" Version="5.0.0-1.25321.1">
7070
<Uri>https://github.com/dotnet/roslyn</Uri>
71-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
71+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
7272
</Dependency>
73-
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.EditorFeatures" Version="5.0.0-1.25316.1">
73+
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.EditorFeatures" Version="5.0.0-1.25321.1">
7474
<Uri>https://github.com/dotnet/roslyn</Uri>
75-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
75+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
7676
</Dependency>
77-
<Dependency Name="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="5.0.0-1.25316.1">
77+
<Dependency Name="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="5.0.0-1.25321.1">
7878
<Uri>https://github.com/dotnet/roslyn</Uri>
79-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
79+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
8080
</Dependency>
81-
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.0.0-1.25316.1">
81+
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.0.0-1.25321.1">
8282
<Uri>https://github.com/dotnet/roslyn</Uri>
83-
<Sha>e15bc0a7eb664d20e7237daef7ab6b76da6c16cb</Sha>
83+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
8484
</Dependency>
85-
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.12.0-beta1.25230.6">
85+
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="5.0.0-1.25321.1">
8686
<Uri>https://github.com/dotnet/roslyn</Uri>
87-
<Sha>ded867328249b5a9b9e6e29e3f07abc19111f5d1</Sha>
87+
<Sha>ad14335550de1134f0b5a59b6cd040001d0d8c8d</Sha>
8888
</Dependency>
8989
</ProductDependencies>
9090
<ToolsetDependencies>

eng/Versions.props

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<!-- Opt-in arcade features -->
33
<PropertyGroup>
44
<UsingToolVSSDK>true</UsingToolVSSDK>
@@ -47,27 +47,27 @@
4747
4848
-->
4949
<PropertyGroup Label="Automated">
50-
<MicrosoftCodeAnalysisAnalyzersPackageVersion>3.12.0-beta1.25230.6</MicrosoftCodeAnalysisAnalyzersPackageVersion>
51-
<MicrosoftNetCompilersToolsetPackageVersion>5.0.0-1.25316.1</MicrosoftNetCompilersToolsetPackageVersion>
52-
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
53-
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>5.0.0-1.25316.1</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
54-
<MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>
55-
<MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>
56-
<MicrosoftCodeAnalysisCommonPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisCommonPackageVersion>
57-
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisCSharpPackageVersion>
58-
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
59-
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
60-
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
61-
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
62-
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
63-
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
64-
<MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>
65-
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
66-
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
67-
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
68-
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
69-
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.0.0-1.25316.1</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
70-
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-1.25316.1</MicrosoftVisualStudioLanguageServicesPackageVersion>
50+
<MicrosoftCodeAnalysisAnalyzersPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisAnalyzersPackageVersion>
51+
<MicrosoftNetCompilersToolsetPackageVersion>5.0.0-1.25321.1</MicrosoftNetCompilersToolsetPackageVersion>
52+
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
53+
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>5.0.0-1.25321.1</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
54+
<MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>
55+
<MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>
56+
<MicrosoftCodeAnalysisCommonPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisCommonPackageVersion>
57+
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisCSharpPackageVersion>
58+
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
59+
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
60+
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
61+
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
62+
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
63+
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
64+
<MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>
65+
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
66+
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
67+
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
68+
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
69+
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.0.0-1.25321.1</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
70+
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-1.25321.1</MicrosoftVisualStudioLanguageServicesPackageVersion>
7171
<!--
7272
Exception - Microsoft.Extensions.ObjectPool and System.Collections.Immutable packages are not updated by automation,
7373
but are present in Version.Details.xml for source-build PVP flow. See the comment in Version.Details.xml for more information.

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/CodeGeneration/CodeWriter.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ public override int Read(char[] buffer, int index, int count)
415415

416416
if (_page is null)
417417
{
418-
return -1;
418+
return 0;
419419
}
420420

421421
var destination = buffer.AsSpan(index, count);
@@ -435,6 +435,12 @@ public override int Read(char[] buffer, int index, int count)
435435

436436
foreach (var chunk in chunks)
437437
{
438+
if (destination.IsEmpty)
439+
{
440+
// If we have no more space in the destination, we're done.
441+
break;
442+
}
443+
438444
var source = chunk.Span;
439445

440446
// Slice if the first chunk is partial. Note that this only occurs for the first chunk.
@@ -461,16 +467,15 @@ public override int Read(char[] buffer, int index, int count)
461467
charIndex = 0;
462468
}
463469

470+
if (source.IsEmpty)
471+
{
472+
continue;
473+
}
474+
464475
source.CopyTo(destination);
465476
destination = destination[source.Length..];
466477

467478
charsWritten += source.Length;
468-
469-
// Break if we are done writing. chunkIndex and charIndex should have their correct values at this point.
470-
if (destination.IsEmpty)
471-
{
472-
break;
473-
}
474479
}
475480

476481
if (destination.IsEmpty)
@@ -497,6 +502,8 @@ public override int Read(char[] buffer, int index, int count)
497502
_charIndex = -1;
498503
}
499504

505+
_remainingLength -= charsWritten;
506+
500507
return charsWritten;
501508
}
502509

@@ -551,6 +558,7 @@ public override string ReadToEnd()
551558
_page = null;
552559
_chunkIndex = -1;
553560
_charIndex = 1;
561+
_remainingLength = 0;
554562

555563
return result;
556564
}

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorCodeDocument.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public sealed partial class RazorCodeDocument
2424
public RazorFileKind FileKind => ParserOptions.FileKind;
2525

2626
private readonly PropertyTable _properties = new();
27+
private readonly object _htmlDocumentLock = new();
2728

2829
private RazorCodeDocument(
2930
RazorSourceDocument source,
@@ -182,8 +183,15 @@ internal RazorHtmlDocument GetHtmlDocument()
182183
return result;
183184
}
184185

185-
result = RazorHtmlWriter.GetHtmlDocument(this);
186-
_properties.HtmlDocument.SetValue(result);
186+
// Perf: Avoid concurrent requests generating the same html document
187+
lock (_htmlDocumentLock)
188+
{
189+
if (!_properties.HtmlDocument.TryGetValue(out result))
190+
{
191+
result = RazorHtmlWriter.GetHtmlDocument(this);
192+
_properties.HtmlDocument.SetValue(result);
193+
}
194+
}
187195

188196
return result;
189197
}

0 commit comments

Comments
 (0)