diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index d5e45cc903032..92ccd213d591e 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -45,4 +45,5 @@ src/Features/**/PublicAPI.Unshipped.txt @dotnet/roslyn-api-owners
src/EditorFeatures/**/PublicAPI.Unshipped.txt @dotnet/roslyn-api-owners
src/Tools/ExternalAccess/OmniSharp*/ @333fred @dibarbet
+src/Tools/ExternalAccess/RazorCompiler*/ @dotnet/roslyn-compiler
src/Tools/ExternalAccess/CompilerDeveloperSDK/ @333fred
diff --git a/Compilers.slnf b/Compilers.slnf
index c810adbc006d7..e73b1562e7b0b 100644
--- a/Compilers.slnf
+++ b/Compilers.slnf
@@ -67,6 +67,8 @@
"src\\Tools\\BuildBoss\\BuildBoss.csproj",
"src\\Tools\\Replay\\Replay.csproj",
"src\\Tools\\BuildValidator\\BuildValidator.csproj",
+ "src\\Tools\\ExternalAccess\\RazorCompilerTest\\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests.csproj",
+ "src\\Tools\\ExternalAccess\\RazorCompiler\\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.csproj",
"src\\Tools\\PrepareTests\\PrepareTests.csproj",
"src\\Tools\\Source\\CompilerGeneratorTools\\Source\\BoundTreeGenerator\\CompilersBoundTreeGenerator.csproj",
"src\\Tools\\Source\\CompilerGeneratorTools\\Source\\CSharpErrorFactsGenerator\\CSharpErrorFactsGenerator.csproj",
diff --git a/Roslyn.sln b/Roslyn.sln
index 894a41eefa9df..fed1dc4a4685d 100644
--- a/Roslyn.sln
+++ b/Roslyn.sln
@@ -501,6 +501,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDiscoveryWorker", "src\Tools\TestDiscoveryWorker\TestDiscoveryWorker.csproj", "{8BC50AFF-1EBF-4E9A-AEBB-04F387AA800F}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler", "src\Tools\ExternalAccess\RazorCompiler\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.csproj", "{E5E0BF73-95F7-4BC3-8443-2336C4FF4297}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests", "src\Tools\ExternalAccess\RazorCompilerTest\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests.csproj", "{828FD0DB-9927-42AC-B6C2-D1514965D6C3}"
+EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.LanguageServer", "src\Features\LanguageServer\Microsoft.CodeAnalysis.LanguageServer\Microsoft.CodeAnalysis.LanguageServer.csproj", "{2A3C94F7-5B5E-4CDC-B645-672815E61DEB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.LanguageServer.UnitTests", "src\Features\LanguageServer\Microsoft.CodeAnalysis.LanguageServer.UnitTests\Microsoft.CodeAnalysis.LanguageServer.UnitTests.csproj", "{9A90AA02-4275-40ED-B1F1-731AF17E675C}"
@@ -1279,6 +1283,14 @@ Global
{8BC50AFF-1EBF-4E9A-AEBB-04F387AA800F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BC50AFF-1EBF-4E9A-AEBB-04F387AA800F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BC50AFF-1EBF-4E9A-AEBB-04F387AA800F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E5E0BF73-95F7-4BC3-8443-2336C4FF4297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E5E0BF73-95F7-4BC3-8443-2336C4FF4297}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E5E0BF73-95F7-4BC3-8443-2336C4FF4297}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E5E0BF73-95F7-4BC3-8443-2336C4FF4297}.Release|Any CPU.Build.0 = Release|Any CPU
+ {828FD0DB-9927-42AC-B6C2-D1514965D6C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {828FD0DB-9927-42AC-B6C2-D1514965D6C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {828FD0DB-9927-42AC-B6C2-D1514965D6C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {828FD0DB-9927-42AC-B6C2-D1514965D6C3}.Release|Any CPU.Build.0 = Release|Any CPU
{2A3C94F7-5B5E-4CDC-B645-672815E61DEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A3C94F7-5B5E-4CDC-B645-672815E61DEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A3C94F7-5B5E-4CDC-B645-672815E61DEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1608,6 +1620,8 @@ Global
{58AD1B2C-6FFC-47CB-838A-54D0CA2BF0C8} = {D449D505-CC6A-4E0B-AF1B-976E2D0AE67A}
{8A29449D-411E-49E4-B99E-E8428076BB21} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
{8BC50AFF-1EBF-4E9A-AEBB-04F387AA800F} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
+ {E5E0BF73-95F7-4BC3-8443-2336C4FF4297} = {8977A560-45C2-4EC2-A849-97335B382C74}
+ {828FD0DB-9927-42AC-B6C2-D1514965D6C3} = {8977A560-45C2-4EC2-A849-97335B382C74}
{2A3C94F7-5B5E-4CDC-B645-672815E61DEB} = {D449D505-CC6A-4E0B-AF1B-976E2D0AE67A}
{9A90AA02-4275-40ED-B1F1-731AF17E675C} = {D449D505-CC6A-4E0B-AF1B-976E2D0AE67A}
{521ADC3E-CC15-414B-9356-D87C5BCF3A24} = {C52D8057-43AF-40E6-A01B-6CDBB7301985}
diff --git a/eng/Directory.Packages.props b/eng/Directory.Packages.props
index 8e79bade88c9e..e9838f4c3ec9c 100644
--- a/eng/Directory.Packages.props
+++ b/eng/Directory.Packages.props
@@ -8,7 +8,7 @@
<_BasicReferenceAssembliesVersion>1.7.2
4.8.0-3.final
- 17.10.72-preview
+ 17.10.191
6.0.0-rtm.21518.12
6.0.0-rtm.21518.12
7.0.0-alpha.1.22060.1
@@ -22,8 +22,7 @@
8.0.0
2.4.1
2.1.0
- 17.10.22-preview-1
- 17.10.72-preview
+ 17.10.2083
-
-
-
+
+
+
@@ -45,9 +44,9 @@
-
-
-
+
+
+
@@ -90,31 +89,31 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml
index 8451ebe80c273..5bc0a92818062 100644
--- a/eng/SourceBuildPrebuiltBaseline.xml
+++ b/eng/SourceBuildPrebuiltBaseline.xml
@@ -24,21 +24,27 @@
+
+
-
+
+
+
+
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 5edbe6326345e..c2212b9353d2a 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -84,6 +84,10 @@
https://github.com/dotnet/runtime
5535e31a712343a63f5d7d796cd874e563e5ac14
+
+ https://github.com/dotnet/runtime
+ 5535e31a712343a63f5d7d796cd874e563e5ac14
+
https://github.com/dotnet/runtime
5535e31a712343a63f5d7d796cd874e563e5ac14
@@ -110,6 +114,7 @@
+<<<<<<< HEAD
https://github.com/dotnet/arcade
1cf3eaa1f6ada43ab988145a3f3efddb1ffa3b10
@@ -118,6 +123,16 @@
https://github.com/dotnet/arcade
1cf3eaa1f6ada43ab988145a3f3efddb1ffa3b10
+=======
+
+ https://github.com/dotnet/arcade
+ e6f70c7dd528f05cd28cec2a179d58c22e91d9ac
+
+
+
+ https://github.com/dotnet/arcade
+ e6f70c7dd528f05cd28cec2a179d58c22e91d9ac
+>>>>>>> upstream/release/dev17.10
@@ -125,7 +140,7 @@
73f0850939d96131c28cf6ea6ee5aacb4da0083a
-
+
https://github.com/dotnet/xliff-tasks
73f0850939d96131c28cf6ea6ee5aacb4da0083a
@@ -144,9 +159,15 @@
https://github.com/dotnet/roslyn
5d10d428050c0d6afef30a072c4ae68776621877
+<<<<<<< HEAD
https://github.com/dotnet/arcade
1cf3eaa1f6ada43ab988145a3f3efddb1ffa3b10
+=======
+
+ https://github.com/dotnet/arcade
+ e6f70c7dd528f05cd28cec2a179d58c22e91d9ac
+>>>>>>> upstream/release/dev17.10
https://github.com/dotnet/roslyn-analyzers
diff --git a/eng/Versions.props b/eng/Versions.props
index e9fc305f8814b..0747f42dc1ded 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -34,6 +34,7 @@
8.0.0
8.0.0
+ 8.0.0
8.0.0
8.0.0
3.3.4
diff --git a/eng/targets/VisualStudio.targets b/eng/targets/VisualStudio.targets
index 51c682bc117de..9d5b9b3fc2818 100644
--- a/eng/targets/VisualStudio.targets
+++ b/eng/targets/VisualStudio.targets
@@ -143,16 +143,4 @@
-
-
-
-
-
-
-
diff --git a/src/Compilers/CSharp/Portable/PublicAPI.Shipped.txt b/src/Compilers/CSharp/Portable/PublicAPI.Shipped.txt
index 998774f92cfde..ed7ab64420625 100644
--- a/src/Compilers/CSharp/Portable/PublicAPI.Shipped.txt
+++ b/src/Compilers/CSharp/Portable/PublicAPI.Shipped.txt
@@ -1,4 +1,6 @@
#nullable enable
+[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSemanticModel(Microsoft.CodeAnalysis.SyntaxTree! syntaxTree, Microsoft.CodeAnalysis.SemanticModelOptions options) -> Microsoft.CodeAnalysis.SemanticModel!
+[RSEXPERIMENTAL002]static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetInterceptorMethod(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax! node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IMethodSymbol?
~Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousMethodExpressionSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken asyncKeyword, Microsoft.CodeAnalysis.SyntaxToken delegateKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode body) -> Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousMethodExpressionSyntax
~Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousMethodExpressionSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken asyncKeyword, Microsoft.CodeAnalysis.SyntaxToken delegateKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax block, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax expressionBody) -> Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousMethodExpressionSyntax
~Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousMethodExpressionSyntax.WithAsyncKeyword(Microsoft.CodeAnalysis.SyntaxToken asyncKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousMethodExpressionSyntax
@@ -93,6 +95,7 @@ Microsoft.CodeAnalysis.CSharp.Conversion.Equals(Microsoft.CodeAnalysis.CSharp.Co
Microsoft.CodeAnalysis.CSharp.Conversion.Exists.get -> bool
Microsoft.CodeAnalysis.CSharp.Conversion.IsAnonymousFunction.get -> bool
Microsoft.CodeAnalysis.CSharp.Conversion.IsBoxing.get -> bool
+Microsoft.CodeAnalysis.CSharp.Conversion.IsCollectionExpression.get -> bool
Microsoft.CodeAnalysis.CSharp.Conversion.IsConditionalExpression.get -> bool
Microsoft.CodeAnalysis.CSharp.Conversion.IsConstantExpression.get -> bool
Microsoft.CodeAnalysis.CSharp.Conversion.IsDefaultLiteral.get -> bool
@@ -260,6 +263,7 @@ Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp1 = 1 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp10 = 1000 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp11 = 1100 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
+Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp12 = 1200 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp2 = 2 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp3 = 3 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp4 = 4 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
@@ -885,10 +889,13 @@ Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterListSyntax.WithCloseParenToken
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterListSyntax.WithOpenParenToken(Microsoft.CodeAnalysis.SyntaxToken openParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterListSyntax!
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterListSyntax.WithParameters(Microsoft.CodeAnalysis.SeparatedSyntaxList parameters) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterListSyntax!
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax
+Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.ReadOnlyKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.RefKindKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.RefOrOutKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.Type.get -> Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax!
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
+Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
+Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.WithReadOnlyKeyword(Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.WithRefKindKeyword(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.WithRefOrOutKeyword(Microsoft.CodeAnalysis.SyntaxToken refOrOutKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.WithType(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
@@ -4541,6 +4548,7 @@ static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Mic
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.IndexerDeclarationSyntax! declarationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IPropertySymbol?
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.JoinIntoClauseSyntax! node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IRangeVariableSymbol?
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.LabeledStatementSyntax! declarationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.ILabelSymbol?
+static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax! node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IMethodSymbol?
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax! declarationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.ISymbol?
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax! declarationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.INamespaceSymbol?
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax! declarationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IParameterSymbol?
@@ -4556,6 +4564,7 @@ static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Mic
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclaratorSyntax! declarationSyntax, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.ISymbol?
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeconstructionInfo(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.AssignmentExpressionSyntax! assignment) -> Microsoft.CodeAnalysis.CSharp.DeconstructionInfo
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeconstructionInfo(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ForEachVariableStatementSyntax! foreach) -> Microsoft.CodeAnalysis.CSharp.DeconstructionInfo
+static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetElementConversion(this Microsoft.CodeAnalysis.Operations.ISpreadOperation! spread) -> Microsoft.CodeAnalysis.CSharp.Conversion
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetFirstDirective(this Microsoft.CodeAnalysis.SyntaxNode! node, System.Func? predicate = null) -> Microsoft.CodeAnalysis.CSharp.Syntax.DirectiveTriviaSyntax?
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetForEachStatementInfo(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax! forEachStatement) -> Microsoft.CodeAnalysis.CSharp.ForEachStatementInfo
static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetForEachStatementInfo(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax! forEachStatement) -> Microsoft.CodeAnalysis.CSharp.ForEachStatementInfo
@@ -4810,6 +4819,7 @@ static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefBracketedParameterList(Mi
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefBracketedParameterList(Microsoft.CodeAnalysis.SyntaxToken openBracketToken, Microsoft.CodeAnalysis.SeparatedSyntaxList parameters, Microsoft.CodeAnalysis.SyntaxToken closeBracketToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefBracketedParameterListSyntax!
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefParameter(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefParameter(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
+static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefParameter(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefParameterList(Microsoft.CodeAnalysis.SeparatedSyntaxList parameters = default(Microsoft.CodeAnalysis.SeparatedSyntaxList)) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterListSyntax!
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefParameterList(Microsoft.CodeAnalysis.SyntaxToken openParenToken, Microsoft.CodeAnalysis.SeparatedSyntaxList parameters, Microsoft.CodeAnalysis.SyntaxToken closeParenToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterListSyntax!
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.DeclarationExpression(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDesignationSyntax! designation) -> Microsoft.CodeAnalysis.CSharp.Syntax.DeclarationExpressionSyntax!
diff --git a/src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt b/src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
index 6f01326afcc99..36369d5e17d44 100644
--- a/src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
+++ b/src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
@@ -1,20 +1,10 @@
-Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp12 = 1200 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
-Microsoft.CodeAnalysis.CSharp.Conversion.IsCollectionExpression.get -> bool
[RSEXPERIMENTAL002]Microsoft.CodeAnalysis.CSharp.InterceptableLocation
[RSEXPERIMENTAL002]abstract Microsoft.CodeAnalysis.CSharp.InterceptableLocation.Data.get -> string!
[RSEXPERIMENTAL002]abstract Microsoft.CodeAnalysis.CSharp.InterceptableLocation.GetDisplayLocation() -> string!
[RSEXPERIMENTAL002]abstract Microsoft.CodeAnalysis.CSharp.InterceptableLocation.Version.get -> int
-Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.ReadOnlyKeyword.get -> Microsoft.CodeAnalysis.SyntaxToken
-Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
-Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax.WithReadOnlyKeyword(Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
Microsoft.CodeAnalysis.CSharp.SyntaxKind.RazorContentToken = 8523 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
-static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetDeclaredSymbol(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax! node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IMethodSymbol?
-static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetElementConversion(this Microsoft.CodeAnalysis.Operations.ISpreadOperation! spread) -> Microsoft.CodeAnalysis.CSharp.Conversion
-static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.CrefParameter(Microsoft.CodeAnalysis.SyntaxToken refKindKeyword, Microsoft.CodeAnalysis.SyntaxToken readOnlyKeyword, Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax! type) -> Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax!
-[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSemanticModel(Microsoft.CodeAnalysis.SyntaxTree! syntaxTree, Microsoft.CodeAnalysis.SemanticModelOptions options) -> Microsoft.CodeAnalysis.SemanticModel!
[RSEXPERIMENTAL002]override abstract Microsoft.CodeAnalysis.CSharp.InterceptableLocation.Equals(object? obj) -> bool
[RSEXPERIMENTAL002]override abstract Microsoft.CodeAnalysis.CSharp.InterceptableLocation.GetHashCode() -> int
-[RSEXPERIMENTAL002]static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetInterceptorMethod(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax! node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.IMethodSymbol?
[RSEXPERIMENTAL002]static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetInterceptableLocation(this Microsoft.CodeAnalysis.SemanticModel? semanticModel, Microsoft.CodeAnalysis.CSharp.Syntax.InvocationExpressionSyntax! node, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.CSharp.InterceptableLocation?
[RSEXPERIMENTAL002]static Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetInterceptsLocationAttributeSyntax(this Microsoft.CodeAnalysis.CSharp.InterceptableLocation! location) -> string!
[RSEXPERIMENTAL003]Microsoft.CodeAnalysis.CSharp.SyntaxTokenParser
@@ -59,4 +49,4 @@ static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.RefStructConstraint(Microsoft
virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitAllowsConstraintClause(Microsoft.CodeAnalysis.CSharp.Syntax.AllowsConstraintClauseSyntax! node) -> void
virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitRefStructConstraint(Microsoft.CodeAnalysis.CSharp.Syntax.RefStructConstraintSyntax! node) -> void
virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitAllowsConstraintClause(Microsoft.CodeAnalysis.CSharp.Syntax.AllowsConstraintClauseSyntax! node) -> TResult?
-virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitRefStructConstraint(Microsoft.CodeAnalysis.CSharp.Syntax.RefStructConstraintSyntax! node) -> TResult?
\ No newline at end of file
+virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitRefStructConstraint(Microsoft.CodeAnalysis.CSharp.Syntax.RefStructConstraintSyntax! node) -> TResult?
diff --git a/src/Compilers/CSharp/csc/CscCommandLine.projitems b/src/Compilers/CSharp/csc/CscCommandLine.projitems
index eb07fde346dce..b25a580868321 100644
--- a/src/Compilers/CSharp/csc/CscCommandLine.projitems
+++ b/src/Compilers/CSharp/csc/CscCommandLine.projitems
@@ -36,6 +36,7 @@
+
diff --git a/src/Compilers/Core/CodeAnalysisTest/AnalyzerAssemblyLoaderTests.cs b/src/Compilers/Core/CodeAnalysisTest/AnalyzerAssemblyLoaderTests.cs
index 4f8554738f2b2..10889bc36940b 100644
--- a/src/Compilers/Core/CodeAnalysisTest/AnalyzerAssemblyLoaderTests.cs
+++ b/src/Compilers/Core/CodeAnalysisTest/AnalyzerAssemblyLoaderTests.cs
@@ -522,6 +522,80 @@ public void AssemblyLoading_DependencyInDifferentDirectory(AnalyzerTestKind kind
});
}
+#if NET472
+ ///
+ /// Verify that MS.CA.EA.RazorCompiler will be loaded from the compiler directory not the
+ /// analyzer directory.
+ ///
+ [Theory]
+ [CombinatorialData]
+ public void AssemblyLoading_RazorCompiler1(AnalyzerTestKind kind)
+ {
+ Run(kind, static (AnalyzerAssemblyLoader loader, AssemblyLoadTestFixture testFixture) =>
+ {
+ using var temp = new TempRoot();
+ var tempDir = temp.CreateDirectory();
+
+ var externalAccessRazorPath = typeof(Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.GeneratorExtensions).Assembly.Location;
+ var alternatePath = tempDir.CreateDirectory("a").CreateFile("Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll").CopyContentFrom(externalAccessRazorPath).Path;
+
+ loader.AddDependencyLocation(alternatePath);
+ Assembly assembly = loader.LoadFromPath(alternatePath);
+
+ Assert.Equal(externalAccessRazorPath, assembly.Location);
+
+ // Even though EA.RazorCompiler is loaded from the compiler directory the shadow copy loader
+ // still does a defensive copy.
+ var copyCount = loader is ShadowCopyAnalyzerAssemblyLoader
+ ? 1
+ : (int?)null;
+
+ VerifyDependencyAssemblies(
+ loader,
+ copyCount: copyCount,
+ []);
+ });
+ }
+
+ ///
+ /// Verify that MS.CA.EA.RazorCompiler will be loaded from the compiler directory not the
+ /// analyzer directory.
+ ///
+ [Theory]
+ [CombinatorialData]
+ public void AssemblyLoading_RazorCompiler2(AnalyzerTestKind kind)
+ {
+ Run(kind, static (AnalyzerAssemblyLoader loader, AssemblyLoadTestFixture testFixture) =>
+ {
+ using var temp = new TempRoot();
+ var tempDir = temp.CreateDirectory();
+
+ var externalAccessRazorPath = typeof(Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.GeneratorExtensions).Assembly.Location;
+ var dir = tempDir.CreateDirectory("a");
+ var alternatePath = dir.CreateFile("Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll").CopyContentFrom(externalAccessRazorPath).Path;
+ var deltaFile = dir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path;
+
+ loader.AddDependencyLocation(alternatePath);
+ loader.AddDependencyLocation(deltaFile);
+ Assembly razorAssembly = loader.LoadFromPath(alternatePath);
+ _ = loader.LoadFromPath(deltaFile);
+
+ Assert.Equal(externalAccessRazorPath, razorAssembly.Location);
+
+ // Even though EA.RazorCompiler is loaded from the compiler directory the shadow copy loader
+ // still does a defensive copy.
+ var copyCount = loader is ShadowCopyAnalyzerAssemblyLoader
+ ? 2
+ : (int?)null;
+ VerifyDependencyAssemblies(
+ loader,
+ copyCount: copyCount,
+ deltaFile);
+ });
+ }
+
+#endif
+
///
/// Similar to except want to validate
/// a dependency in the same directory is preferred over one in a different directory.
diff --git a/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj b/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj
index f3d038eafe202..eebaf662dbb12 100644
--- a/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj
+++ b/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj
@@ -23,6 +23,7 @@
+
diff --git a/src/Compilers/Core/Portable/PublicAPI.Shipped.txt b/src/Compilers/Core/Portable/PublicAPI.Shipped.txt
index 496cc20f14b21..45ef4235bb695 100644
--- a/src/Compilers/Core/Portable/PublicAPI.Shipped.txt
+++ b/src/Compilers/Core/Portable/PublicAPI.Shipped.txt
@@ -1,4 +1,9 @@
#nullable enable
+[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.Compilation.GetSemanticModel(Microsoft.CodeAnalysis.SyntaxTree! syntaxTree, Microsoft.CodeAnalysis.SemanticModelOptions options) -> Microsoft.CodeAnalysis.SemanticModel!
+[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions
+[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions.DisableNullableAnalysis = 2 -> Microsoft.CodeAnalysis.SemanticModelOptions
+[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions.IgnoreAccessibility = 1 -> Microsoft.CodeAnalysis.SemanticModelOptions
+[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions.None = 0 -> Microsoft.CodeAnalysis.SemanticModelOptions
~Microsoft.CodeAnalysis.IAnalyzerAssemblyLoader.AddDependencyLocation(string fullPath) -> void
~Microsoft.CodeAnalysis.IAnalyzerAssemblyLoader.LoadFromPath(string fullPath) -> System.Reflection.Assembly
~Microsoft.CodeAnalysis.ISymbol.ContainingAssembly.get -> Microsoft.CodeAnalysis.IAssemblySymbol
@@ -150,6 +155,7 @@ abstract Microsoft.CodeAnalysis.SemanticModel.LookupLabelsCore(int position, str
abstract Microsoft.CodeAnalysis.SemanticModel.LookupNamespacesAndTypesCore(int position, Microsoft.CodeAnalysis.INamespaceOrTypeSymbol? container, string? name) -> System.Collections.Immutable.ImmutableArray
abstract Microsoft.CodeAnalysis.SemanticModel.LookupStaticMembersCore(int position, Microsoft.CodeAnalysis.INamespaceOrTypeSymbol? container, string? name) -> System.Collections.Immutable.ImmutableArray
abstract Microsoft.CodeAnalysis.SemanticModel.LookupSymbolsCore(int position, Microsoft.CodeAnalysis.INamespaceOrTypeSymbol? container, string? name, bool includeReducedExtensionMethods) -> System.Collections.Immutable.ImmutableArray
+abstract Microsoft.CodeAnalysis.SemanticModel.NullableAnalysisIsDisabled.get -> bool
abstract Microsoft.CodeAnalysis.SemanticModel.OriginalPositionForSpeculation.get -> int
abstract Microsoft.CodeAnalysis.SemanticModel.ParentModelCore.get -> Microsoft.CodeAnalysis.SemanticModel?
abstract Microsoft.CodeAnalysis.SemanticModel.RootCore.get -> Microsoft.CodeAnalysis.SyntaxNode!
@@ -211,6 +217,7 @@ const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.Build = "Build" -> string!
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.CompilationEnd = "CompilationEnd" -> string!
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.Compiler = "Compiler" -> string!
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.CustomObsolete = "CustomObsolete" -> string!
+const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.CustomSeverityConfigurable = "CustomSeverityConfigurable" -> string!
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.EditAndContinue = "EditAndContinue" -> string!
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.NotConfigurable = "NotConfigurable" -> string!
const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.Telemetry = "Telemetry" -> string!
@@ -750,9 +757,10 @@ Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.Analyzers.get -> Sys
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.CancellationToken.get -> System.Threading.CancellationToken
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.Compilation.get -> Microsoft.CodeAnalysis.Compilation!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.CompilationWithAnalyzers(Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options, System.Threading.CancellationToken cancellationToken) -> void
+Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.CompilationWithAnalyzers(Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options) -> void
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.CompilationWithAnalyzers(Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzersOptions! analysisOptions) -> void
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAllDiagnosticsAsync() -> System.Threading.Tasks.Task>!
-Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAllDiagnosticsAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
+Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAllDiagnosticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task>!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultAsync(Microsoft.CodeAnalysis.AdditionalText! file, Microsoft.CodeAnalysis.Text.TextSpan? filterSpan, System.Collections.Immutable.ImmutableArray analyzers, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultAsync(Microsoft.CodeAnalysis.AdditionalText! file, Microsoft.CodeAnalysis.Text.TextSpan? filterSpan, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalysisResultAsync(Microsoft.CodeAnalysis.AdditionalText! file, System.Collections.Immutable.ImmutableArray analyzers, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task!
@@ -769,7 +777,7 @@ Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerCompilati
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerCompilationDiagnosticsAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync() -> System.Threading.Tasks.Task>!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync(System.Collections.Immutable.ImmutableArray analyzers, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
-Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
+Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task>!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(Microsoft.CodeAnalysis.SemanticModel! model, Microsoft.CodeAnalysis.Text.TextSpan? filterSpan, System.Collections.Immutable.ImmutableArray analyzers, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerSemanticDiagnosticsAsync(Microsoft.CodeAnalysis.SemanticModel! model, Microsoft.CodeAnalysis.Text.TextSpan? filterSpan, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerSyntaxDiagnosticsAsync(Microsoft.CodeAnalysis.SyntaxTree! tree, Microsoft.CodeAnalysis.Text.TextSpan? filterSpan, System.Collections.Immutable.ImmutableArray analyzers, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
@@ -865,6 +873,7 @@ Microsoft.CodeAnalysis.Diagnostics.SuppressionAnalysisContext.SuppressionAnalysi
Microsoft.CodeAnalysis.Diagnostics.SuppressionInfo
Microsoft.CodeAnalysis.Diagnostics.SuppressionInfo.Attribute.get -> Microsoft.CodeAnalysis.AttributeData?
Microsoft.CodeAnalysis.Diagnostics.SuppressionInfo.Id.get -> string!
+Microsoft.CodeAnalysis.Diagnostics.SuppressionInfo.ProgrammaticSuppressions.get -> System.Collections.Immutable.ImmutableArray
Microsoft.CodeAnalysis.Diagnostics.SymbolAnalysisContext
Microsoft.CodeAnalysis.Diagnostics.SymbolAnalysisContext.CancellationToken.get -> System.Threading.CancellationToken
Microsoft.CodeAnalysis.Diagnostics.SymbolAnalysisContext.Compilation.get -> Microsoft.CodeAnalysis.Compilation!
@@ -1033,12 +1042,18 @@ Microsoft.CodeAnalysis.Emit.EmitResult
Microsoft.CodeAnalysis.Emit.EmitResult.Diagnostics.get -> System.Collections.Immutable.ImmutableArray
Microsoft.CodeAnalysis.Emit.EmitResult.Success.get -> bool
Microsoft.CodeAnalysis.Emit.InstrumentationKind
+Microsoft.CodeAnalysis.Emit.InstrumentationKind.ModuleCancellation = 3 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind
Microsoft.CodeAnalysis.Emit.InstrumentationKind.None = 0 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind
+Microsoft.CodeAnalysis.Emit.InstrumentationKind.StackOverflowProbing = 2 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind
Microsoft.CodeAnalysis.Emit.InstrumentationKind.TestCoverage = 1 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind
Microsoft.CodeAnalysis.Emit.MethodInstrumentation
Microsoft.CodeAnalysis.Emit.MethodInstrumentation.Kinds.get -> System.Collections.Immutable.ImmutableArray
Microsoft.CodeAnalysis.Emit.MethodInstrumentation.Kinds.init -> void
Microsoft.CodeAnalysis.Emit.MethodInstrumentation.MethodInstrumentation() -> void
+Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit
+Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit.Message.get -> string!
+Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit.RuntimeRudeEdit() -> void
+Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit.RuntimeRudeEdit(string! message) -> void
Microsoft.CodeAnalysis.Emit.SemanticEdit
Microsoft.CodeAnalysis.Emit.SemanticEdit.Equals(Microsoft.CodeAnalysis.Emit.SemanticEdit other) -> bool
Microsoft.CodeAnalysis.Emit.SemanticEdit.Instrumentation.get -> Microsoft.CodeAnalysis.Emit.MethodInstrumentation
@@ -1046,8 +1061,10 @@ Microsoft.CodeAnalysis.Emit.SemanticEdit.Kind.get -> Microsoft.CodeAnalysis.Emit
Microsoft.CodeAnalysis.Emit.SemanticEdit.NewSymbol.get -> Microsoft.CodeAnalysis.ISymbol?
Microsoft.CodeAnalysis.Emit.SemanticEdit.OldSymbol.get -> Microsoft.CodeAnalysis.ISymbol?
Microsoft.CodeAnalysis.Emit.SemanticEdit.PreserveLocalVariables.get -> bool
+Microsoft.CodeAnalysis.Emit.SemanticEdit.RuntimeRudeEdit.get -> System.Func?
Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit() -> void
-Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit(Microsoft.CodeAnalysis.Emit.SemanticEditKind kind, Microsoft.CodeAnalysis.ISymbol? oldSymbol, Microsoft.CodeAnalysis.ISymbol? newSymbol, System.Func? syntaxMap = null, bool preserveLocalVariables = false, Microsoft.CodeAnalysis.Emit.MethodInstrumentation instrumentation = default(Microsoft.CodeAnalysis.Emit.MethodInstrumentation)) -> void
+Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit(Microsoft.CodeAnalysis.Emit.SemanticEditKind kind, Microsoft.CodeAnalysis.ISymbol? oldSymbol, Microsoft.CodeAnalysis.ISymbol? newSymbol, System.Func? syntaxMap, bool preserveLocalVariables, Microsoft.CodeAnalysis.Emit.MethodInstrumentation instrumentation) -> void
+Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit(Microsoft.CodeAnalysis.Emit.SemanticEditKind kind, Microsoft.CodeAnalysis.ISymbol? oldSymbol, Microsoft.CodeAnalysis.ISymbol? newSymbol, System.Func? syntaxMap = null, System.Func? runtimeRudeEdit = null, Microsoft.CodeAnalysis.Emit.MethodInstrumentation instrumentation = default(Microsoft.CodeAnalysis.Emit.MethodInstrumentation)) -> void
Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit(Microsoft.CodeAnalysis.Emit.SemanticEditKind kind, Microsoft.CodeAnalysis.ISymbol? oldSymbol, Microsoft.CodeAnalysis.ISymbol? newSymbol, System.Func? syntaxMap, bool preserveLocalVariables) -> void
Microsoft.CodeAnalysis.Emit.SemanticEdit.SyntaxMap.get -> System.Func?
Microsoft.CodeAnalysis.Emit.SemanticEditKind
@@ -1513,6 +1530,8 @@ Microsoft.CodeAnalysis.IParameterSymbol.HasExplicitDefaultValue.get -> bool
Microsoft.CodeAnalysis.IParameterSymbol.IsDiscard.get -> bool
Microsoft.CodeAnalysis.IParameterSymbol.IsOptional.get -> bool
Microsoft.CodeAnalysis.IParameterSymbol.IsParams.get -> bool
+Microsoft.CodeAnalysis.IParameterSymbol.IsParamsArray.get -> bool
+Microsoft.CodeAnalysis.IParameterSymbol.IsParamsCollection.get -> bool
Microsoft.CodeAnalysis.IParameterSymbol.IsThis.get -> bool
Microsoft.CodeAnalysis.IParameterSymbol.NullableAnnotation.get -> Microsoft.CodeAnalysis.NullableAnnotation
Microsoft.CodeAnalysis.IParameterSymbol.Ordinal.get -> int
@@ -1773,6 +1792,7 @@ Microsoft.CodeAnalysis.OperationKind.CaughtException = 94 -> Microsoft.CodeAnaly
Microsoft.CodeAnalysis.OperationKind.Coalesce = 34 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.CoalesceAssignment = 97 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.CollectionElementInitializer = 52 -> Microsoft.CodeAnalysis.OperationKind
+Microsoft.CodeAnalysis.OperationKind.CollectionExpression = 127 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.CompoundAssignment = 43 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.Conditional = 33 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.ConditionalAccess = 46 -> Microsoft.CodeAnalysis.OperationKind
@@ -1855,6 +1875,7 @@ Microsoft.CodeAnalysis.OperationKind.Return = 9 -> Microsoft.CodeAnalysis.Operat
Microsoft.CodeAnalysis.OperationKind.SimpleAssignment = 42 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.SizeOf = 63 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.SlicePattern = 122 -> Microsoft.CodeAnalysis.OperationKind
+Microsoft.CodeAnalysis.OperationKind.Spread = 128 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.StaticLocalInitializationSemaphore = 95 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.Stop = 17 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.Switch = 4 -> Microsoft.CodeAnalysis.OperationKind
@@ -1887,6 +1908,7 @@ Microsoft.CodeAnalysis.Operations.ArgumentKind.DefaultValue = 3 -> Microsoft.Cod
Microsoft.CodeAnalysis.Operations.ArgumentKind.Explicit = 1 -> Microsoft.CodeAnalysis.Operations.ArgumentKind
Microsoft.CodeAnalysis.Operations.ArgumentKind.None = 0 -> Microsoft.CodeAnalysis.Operations.ArgumentKind
Microsoft.CodeAnalysis.Operations.ArgumentKind.ParamArray = 2 -> Microsoft.CodeAnalysis.Operations.ArgumentKind
+Microsoft.CodeAnalysis.Operations.ArgumentKind.ParamCollection = 4 -> Microsoft.CodeAnalysis.Operations.ArgumentKind
Microsoft.CodeAnalysis.Operations.BinaryOperatorKind
Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.Add = 1 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind
Microsoft.CodeAnalysis.Operations.BinaryOperatorKind.And = 10 -> Microsoft.CodeAnalysis.Operations.BinaryOperatorKind
@@ -2002,6 +2024,9 @@ Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation
Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation.AddMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol!
Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray
Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation.IsDynamic.get -> bool
+Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation
+Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation.ConstructMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol?
+Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation.Elements.get -> System.Collections.Immutable.ImmutableArray
Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation
Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.ConstrainedToType.get -> Microsoft.CodeAnalysis.ITypeSymbol?
Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation.InConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion
@@ -2267,6 +2292,10 @@ Microsoft.CodeAnalysis.Operations.ISizeOfOperation.TypeOperand.get -> Microsoft.
Microsoft.CodeAnalysis.Operations.ISlicePatternOperation
Microsoft.CodeAnalysis.Operations.ISlicePatternOperation.Pattern.get -> Microsoft.CodeAnalysis.Operations.IPatternOperation?
Microsoft.CodeAnalysis.Operations.ISlicePatternOperation.SliceSymbol.get -> Microsoft.CodeAnalysis.ISymbol?
+Microsoft.CodeAnalysis.Operations.ISpreadOperation
+Microsoft.CodeAnalysis.Operations.ISpreadOperation.ElementConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion
+Microsoft.CodeAnalysis.Operations.ISpreadOperation.ElementType.get -> Microsoft.CodeAnalysis.ITypeSymbol?
+Microsoft.CodeAnalysis.Operations.ISpreadOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation!
Microsoft.CodeAnalysis.Operations.IStopOperation
Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation
Microsoft.CodeAnalysis.Operations.ISwitchCaseOperation.Body.get -> System.Collections.Immutable.ImmutableArray
@@ -2423,6 +2452,7 @@ Microsoft.CodeAnalysis.RefKind.None = 0 -> Microsoft.CodeAnalysis.RefKind
Microsoft.CodeAnalysis.RefKind.Out = 2 -> Microsoft.CodeAnalysis.RefKind
Microsoft.CodeAnalysis.RefKind.Ref = 1 -> Microsoft.CodeAnalysis.RefKind
Microsoft.CodeAnalysis.RefKind.RefReadOnly = 3 -> Microsoft.CodeAnalysis.RefKind
+Microsoft.CodeAnalysis.RefKind.RefReadOnlyParameter = 4 -> Microsoft.CodeAnalysis.RefKind
Microsoft.CodeAnalysis.ReportDiagnostic
Microsoft.CodeAnalysis.ReportDiagnostic.Default = 0 -> Microsoft.CodeAnalysis.ReportDiagnostic
Microsoft.CodeAnalysis.ReportDiagnostic.Error = 1 -> Microsoft.CodeAnalysis.ReportDiagnostic
@@ -2485,6 +2515,7 @@ Microsoft.CodeAnalysis.SemanticModel.LookupSymbols(int position, Microsoft.CodeA
Microsoft.CodeAnalysis.SemanticModel.ParentModel.get -> Microsoft.CodeAnalysis.SemanticModel?
Microsoft.CodeAnalysis.SemanticModel.SemanticModel() -> void
Microsoft.CodeAnalysis.SemanticModel.SyntaxTree.get -> Microsoft.CodeAnalysis.SyntaxTree!
+Microsoft.CodeAnalysis.SeparatedSyntaxList
Microsoft.CodeAnalysis.SeparatedSyntaxList
Microsoft.CodeAnalysis.SeparatedSyntaxList.Add(TNode! node) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
Microsoft.CodeAnalysis.SeparatedSyntaxList.AddRange(System.Collections.Generic.IEnumerable! nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
@@ -2799,6 +2830,7 @@ Microsoft.CodeAnalysis.SyntaxAnnotation.SyntaxAnnotation() -> void
Microsoft.CodeAnalysis.SyntaxAnnotation.SyntaxAnnotation(string? kind) -> void
Microsoft.CodeAnalysis.SyntaxAnnotation.SyntaxAnnotation(string? kind, string? data) -> void
Microsoft.CodeAnalysis.SyntaxContextReceiverCreator
+Microsoft.CodeAnalysis.SyntaxList
Microsoft.CodeAnalysis.SyntaxList
Microsoft.CodeAnalysis.SyntaxList.Add(TNode! node) -> Microsoft.CodeAnalysis.SyntaxList
Microsoft.CodeAnalysis.SyntaxList.AddRange(System.Collections.Generic.IEnumerable! nodes) -> Microsoft.CodeAnalysis.SyntaxList
@@ -3188,6 +3220,7 @@ Microsoft.CodeAnalysis.Text.SourceText.CanBeEmbedded.get -> bool
Microsoft.CodeAnalysis.Text.SourceText.ChecksumAlgorithm.get -> Microsoft.CodeAnalysis.Text.SourceHashAlgorithm
Microsoft.CodeAnalysis.Text.SourceText.ContentEquals(Microsoft.CodeAnalysis.Text.SourceText! other) -> bool
Microsoft.CodeAnalysis.Text.SourceText.GetChecksum() -> System.Collections.Immutable.ImmutableArray
+Microsoft.CodeAnalysis.Text.SourceText.GetContentHash() -> System.Collections.Immutable.ImmutableArray
Microsoft.CodeAnalysis.Text.SourceText.GetSubText(int start) -> Microsoft.CodeAnalysis.Text.SourceText!
Microsoft.CodeAnalysis.Text.SourceText.Lines.get -> Microsoft.CodeAnalysis.Text.TextLineCollection!
Microsoft.CodeAnalysis.Text.SourceText.Replace(int start, int length, string! newText) -> Microsoft.CodeAnalysis.Text.SourceText!
@@ -3549,12 +3582,13 @@ static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.ClearAnalyzer
static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetEffectiveDiagnostics(System.Collections.Generic.IEnumerable! diagnostics, Microsoft.CodeAnalysis.Compilation! compilation) -> System.Collections.Generic.IEnumerable!
static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetEffectiveDiagnostics(System.Collections.Immutable.ImmutableArray diagnostics, Microsoft.CodeAnalysis.Compilation! compilation) -> System.Collections.Generic.IEnumerable!
static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.IsDiagnosticAnalyzerSuppressed(Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer! analyzer, Microsoft.CodeAnalysis.CompilationOptions! options, System.Action? onAnalyzerException = null) -> bool
-static Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerExtensions.WithAnalyzers(this Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers!
+static Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerExtensions.WithAnalyzers(this Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options = null) -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers!
+static Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerExtensions.WithAnalyzers(this Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers!
static Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerExtensions.WithAnalyzers(this Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzersOptions! analysisOptions) -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers!
static Microsoft.CodeAnalysis.Diagnostics.Suppression.Create(Microsoft.CodeAnalysis.SuppressionDescriptor! descriptor, Microsoft.CodeAnalysis.Diagnostic! suppressedDiagnostic) -> Microsoft.CodeAnalysis.Diagnostics.Suppression
static Microsoft.CodeAnalysis.Diagnostics.Suppression.operator !=(Microsoft.CodeAnalysis.Diagnostics.Suppression left, Microsoft.CodeAnalysis.Diagnostics.Suppression right) -> bool
static Microsoft.CodeAnalysis.Diagnostics.Suppression.operator ==(Microsoft.CodeAnalysis.Diagnostics.Suppression left, Microsoft.CodeAnalysis.Diagnostics.Suppression right) -> bool
-static Microsoft.CodeAnalysis.DocumentationCommentId.CreateDeclarationId(Microsoft.CodeAnalysis.ISymbol! symbol) -> string!
+static Microsoft.CodeAnalysis.DocumentationCommentId.CreateDeclarationId(Microsoft.CodeAnalysis.ISymbol! symbol) -> string?
static Microsoft.CodeAnalysis.DocumentationCommentId.CreateReferenceId(Microsoft.CodeAnalysis.ISymbol! symbol) -> string!
static Microsoft.CodeAnalysis.DocumentationCommentId.GetFirstSymbolForDeclarationId(string! id, Microsoft.CodeAnalysis.Compilation! compilation) -> Microsoft.CodeAnalysis.ISymbol?
static Microsoft.CodeAnalysis.DocumentationCommentId.GetFirstSymbolForReferenceId(string! id, Microsoft.CodeAnalysis.Compilation! compilation) -> Microsoft.CodeAnalysis.ISymbol?
@@ -3567,6 +3601,7 @@ static Microsoft.CodeAnalysis.EmbeddedText.FromStream(string! filePath, System.I
static Microsoft.CodeAnalysis.Emit.EditAndContinueMethodDebugInformation.Create(System.Collections.Immutable.ImmutableArray compressedSlotMap, System.Collections.Immutable.ImmutableArray compressedLambdaMap) -> Microsoft.CodeAnalysis.Emit.EditAndContinueMethodDebugInformation
static Microsoft.CodeAnalysis.Emit.EditAndContinueMethodDebugInformation.Create(System.Collections.Immutable.ImmutableArray compressedSlotMap, System.Collections.Immutable.ImmutableArray compressedLambdaMap, System.Collections.Immutable.ImmutableArray compressedStateMachineStateMap) -> Microsoft.CodeAnalysis.Emit.EditAndContinueMethodDebugInformation
static Microsoft.CodeAnalysis.Emit.EmitBaseline.CreateInitialBaseline(Microsoft.CodeAnalysis.ModuleMetadata! module, System.Func! debugInformationProvider) -> Microsoft.CodeAnalysis.Emit.EmitBaseline!
+static Microsoft.CodeAnalysis.Emit.EmitBaseline.CreateInitialBaseline(Microsoft.CodeAnalysis.Compilation! compilation, Microsoft.CodeAnalysis.ModuleMetadata! module, System.Func! debugInformationProvider, System.Func! localSignatureProvider, bool hasPortableDebugInformation) -> Microsoft.CodeAnalysis.Emit.EmitBaseline!
static Microsoft.CodeAnalysis.Emit.EmitBaseline.CreateInitialBaseline(Microsoft.CodeAnalysis.ModuleMetadata! module, System.Func! debugInformationProvider, System.Func! localSignatureProvider, bool hasPortableDebugInformation) -> Microsoft.CodeAnalysis.Emit.EmitBaseline!
static Microsoft.CodeAnalysis.Emit.EmitOptions.operator !=(Microsoft.CodeAnalysis.Emit.EmitOptions? left, Microsoft.CodeAnalysis.Emit.EmitOptions? right) -> bool
static Microsoft.CodeAnalysis.Emit.EmitOptions.operator ==(Microsoft.CodeAnalysis.Emit.EmitOptions? left, Microsoft.CodeAnalysis.Emit.EmitOptions? right) -> bool
@@ -3639,8 +3674,8 @@ static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromFile(string! path) -> Mic
static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromImage(nint peImage, int size) -> Microsoft.CodeAnalysis.ModuleMetadata!
static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromImage(System.Collections.Generic.IEnumerable! peImage) -> Microsoft.CodeAnalysis.ModuleMetadata!
static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromImage(System.Collections.Immutable.ImmutableArray peImage) -> Microsoft.CodeAnalysis.ModuleMetadata!
-static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromMetadata(nint metadata, int size) -> Microsoft.CodeAnalysis.ModuleMetadata!
static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromMetadata(nint metadata, int size, System.Action! onDispose) -> Microsoft.CodeAnalysis.ModuleMetadata!
+static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromMetadata(nint metadata, int size) -> Microsoft.CodeAnalysis.ModuleMetadata!
static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(System.IO.Stream! peStream, bool leaveOpen = false) -> Microsoft.CodeAnalysis.ModuleMetadata!
static Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(System.IO.Stream! peStream, System.Reflection.PortableExecutable.PEStreamOptions options) -> Microsoft.CodeAnalysis.ModuleMetadata!
static Microsoft.CodeAnalysis.NullableContextExtensions.AnnotationsEnabled(this Microsoft.CodeAnalysis.NullableContext context) -> bool
@@ -3669,6 +3704,7 @@ static Microsoft.CodeAnalysis.RuleSet.GetDiagnosticOptionsFromRulesetFile(string
static Microsoft.CodeAnalysis.RuleSet.GetEffectiveIncludesFromFile(string! filePath) -> System.Collections.Immutable.ImmutableArray
static Microsoft.CodeAnalysis.RuleSet.LoadEffectiveRuleSetFromFile(string! filePath) -> Microsoft.CodeAnalysis.RuleSet!
static Microsoft.CodeAnalysis.SarifVersionFacts.TryParse(string! version, out Microsoft.CodeAnalysis.SarifVersion result) -> bool
+static Microsoft.CodeAnalysis.SeparatedSyntaxList.Create(System.ReadOnlySpan nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
static Microsoft.CodeAnalysis.SeparatedSyntaxList.explicit operator Microsoft.CodeAnalysis.SeparatedSyntaxList(Microsoft.CodeAnalysis.SeparatedSyntaxList nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
static Microsoft.CodeAnalysis.SeparatedSyntaxList.implicit operator Microsoft.CodeAnalysis.SeparatedSyntaxList(Microsoft.CodeAnalysis.SeparatedSyntaxList nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
static Microsoft.CodeAnalysis.SeparatedSyntaxList.op_Implicit(Microsoft.CodeAnalysis.SeparatedSyntaxList nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
@@ -3693,6 +3729,7 @@ static Microsoft.CodeAnalysis.SymbolDisplayFormat.VisualBasicShortErrorMessageFo
static Microsoft.CodeAnalysis.SyntaxAnnotation.ElasticAnnotation.get -> Microsoft.CodeAnalysis.SyntaxAnnotation!
static Microsoft.CodeAnalysis.SyntaxAnnotation.operator !=(Microsoft.CodeAnalysis.SyntaxAnnotation? left, Microsoft.CodeAnalysis.SyntaxAnnotation? right) -> bool
static Microsoft.CodeAnalysis.SyntaxAnnotation.operator ==(Microsoft.CodeAnalysis.SyntaxAnnotation? left, Microsoft.CodeAnalysis.SyntaxAnnotation? right) -> bool
+static Microsoft.CodeAnalysis.SyntaxList.Create(System.ReadOnlySpan nodes) -> Microsoft.CodeAnalysis.SyntaxList
static Microsoft.CodeAnalysis.SyntaxList.explicit operator Microsoft.CodeAnalysis.SyntaxList(Microsoft.CodeAnalysis.SyntaxList nodes) -> Microsoft.CodeAnalysis.SyntaxList
static Microsoft.CodeAnalysis.SyntaxList.implicit operator Microsoft.CodeAnalysis.SyntaxList(Microsoft.CodeAnalysis.SyntaxList nodes) -> Microsoft.CodeAnalysis.SyntaxList
static Microsoft.CodeAnalysis.SyntaxList.op_Implicit(Microsoft.CodeAnalysis.SyntaxList nodes) -> Microsoft.CodeAnalysis.SyntaxList
@@ -3741,16 +3778,19 @@ static Microsoft.CodeAnalysis.SyntaxNodeOrToken.implicit operator Microsoft.Code
static Microsoft.CodeAnalysis.SyntaxNodeOrToken.implicit operator Microsoft.CodeAnalysis.SyntaxNodeOrToken(Microsoft.CodeAnalysis.SyntaxToken token) -> Microsoft.CodeAnalysis.SyntaxNodeOrToken
static Microsoft.CodeAnalysis.SyntaxNodeOrToken.operator !=(Microsoft.CodeAnalysis.SyntaxNodeOrToken left, Microsoft.CodeAnalysis.SyntaxNodeOrToken right) -> bool
static Microsoft.CodeAnalysis.SyntaxNodeOrToken.operator ==(Microsoft.CodeAnalysis.SyntaxNodeOrToken left, Microsoft.CodeAnalysis.SyntaxNodeOrToken right) -> bool
+static Microsoft.CodeAnalysis.SyntaxNodeOrTokenList.Create(System.ReadOnlySpan nodesAndTokens) -> Microsoft.CodeAnalysis.SyntaxNodeOrTokenList
static Microsoft.CodeAnalysis.SyntaxNodeOrTokenList.operator !=(Microsoft.CodeAnalysis.SyntaxNodeOrTokenList left, Microsoft.CodeAnalysis.SyntaxNodeOrTokenList right) -> bool
static Microsoft.CodeAnalysis.SyntaxNodeOrTokenList.operator ==(Microsoft.CodeAnalysis.SyntaxNodeOrTokenList left, Microsoft.CodeAnalysis.SyntaxNodeOrTokenList right) -> bool
static Microsoft.CodeAnalysis.SyntaxToken.operator !=(Microsoft.CodeAnalysis.SyntaxToken left, Microsoft.CodeAnalysis.SyntaxToken right) -> bool
static Microsoft.CodeAnalysis.SyntaxToken.operator ==(Microsoft.CodeAnalysis.SyntaxToken left, Microsoft.CodeAnalysis.SyntaxToken right) -> bool
static Microsoft.CodeAnalysis.SyntaxTokenList.Create(Microsoft.CodeAnalysis.SyntaxToken token) -> Microsoft.CodeAnalysis.SyntaxTokenList
+static Microsoft.CodeAnalysis.SyntaxTokenList.Create(System.ReadOnlySpan tokens) -> Microsoft.CodeAnalysis.SyntaxTokenList
static Microsoft.CodeAnalysis.SyntaxTokenList.operator !=(Microsoft.CodeAnalysis.SyntaxTokenList left, Microsoft.CodeAnalysis.SyntaxTokenList right) -> bool
static Microsoft.CodeAnalysis.SyntaxTokenList.operator ==(Microsoft.CodeAnalysis.SyntaxTokenList left, Microsoft.CodeAnalysis.SyntaxTokenList right) -> bool
static Microsoft.CodeAnalysis.SyntaxTrivia.operator !=(Microsoft.CodeAnalysis.SyntaxTrivia left, Microsoft.CodeAnalysis.SyntaxTrivia right) -> bool
static Microsoft.CodeAnalysis.SyntaxTrivia.operator ==(Microsoft.CodeAnalysis.SyntaxTrivia left, Microsoft.CodeAnalysis.SyntaxTrivia right) -> bool
static Microsoft.CodeAnalysis.SyntaxTriviaList.Create(Microsoft.CodeAnalysis.SyntaxTrivia trivia) -> Microsoft.CodeAnalysis.SyntaxTriviaList
+static Microsoft.CodeAnalysis.SyntaxTriviaList.Create(System.ReadOnlySpan trivias) -> Microsoft.CodeAnalysis.SyntaxTriviaList
static Microsoft.CodeAnalysis.SyntaxTriviaList.Empty.get -> Microsoft.CodeAnalysis.SyntaxTriviaList
static Microsoft.CodeAnalysis.SyntaxTriviaList.operator !=(Microsoft.CodeAnalysis.SyntaxTriviaList left, Microsoft.CodeAnalysis.SyntaxTriviaList right) -> bool
static Microsoft.CodeAnalysis.SyntaxTriviaList.operator ==(Microsoft.CodeAnalysis.SyntaxTriviaList left, Microsoft.CodeAnalysis.SyntaxTriviaList right) -> bool
@@ -3792,6 +3832,7 @@ virtual Microsoft.CodeAnalysis.Diagnostic.Properties.get -> System.Collections.I
virtual Microsoft.CodeAnalysis.DiagnosticFormatter.Format(Microsoft.CodeAnalysis.Diagnostic! diagnostic, System.IFormatProvider? formatter = null) -> string!
virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.ConfigureGeneratedCodeAnalysis(Microsoft.CodeAnalysis.Diagnostics.GeneratedCodeAnalysisFlags analysisMode) -> void
virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.EnableConcurrentExecution() -> void
+virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.MinimumReportedSeverity.get -> Microsoft.CodeAnalysis.DiagnosticSeverity
virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterAdditionalFileAction(System.Action! action) -> void
virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterOperationAction(System.Action! action, System.Collections.Immutable.ImmutableArray operationKinds) -> void
virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.RegisterOperationBlockAction(System.Action! action) -> void
@@ -3834,6 +3875,7 @@ virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCaughtException(
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCoalesce(Microsoft.CodeAnalysis.Operations.ICoalesceOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCoalesceAssignment(Microsoft.CodeAnalysis.Operations.ICoalesceAssignmentOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCollectionElementInitializer(Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation! operation) -> void
+virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCollectionExpression(Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCompoundAssignment(Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConditional(Microsoft.CodeAnalysis.Operations.IConditionalOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConditionalAccess(Microsoft.CodeAnalysis.Operations.IConditionalAccessOperation! operation) -> void
@@ -3917,6 +3959,7 @@ virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSimpleAssignment
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Operations.ISingleValueCaseClauseOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSizeOf(Microsoft.CodeAnalysis.Operations.ISizeOfOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSlicePattern(Microsoft.CodeAnalysis.Operations.ISlicePatternOperation! operation) -> void
+virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSpread(Microsoft.CodeAnalysis.Operations.ISpreadOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitStaticLocalInitializationSemaphore(Microsoft.CodeAnalysis.FlowAnalysis.IStaticLocalInitializationSemaphoreOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitStop(Microsoft.CodeAnalysis.Operations.IStopOperation! operation) -> void
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSwitch(Microsoft.CodeAnalysis.Operations.ISwitchOperation! operation) -> void
@@ -3961,6 +4004,7 @@ virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.V
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCoalesce(Microsoft.CodeAnalysis.Operations.ICoalesceOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCoalesceAssignment(Microsoft.CodeAnalysis.Operations.ICoalesceAssignmentOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCollectionElementInitializer(Microsoft.CodeAnalysis.Operations.ICollectionElementInitializerOperation! operation, TArgument argument) -> TResult?
+virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCollectionExpression(Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCompoundAssignment(Microsoft.CodeAnalysis.Operations.ICompoundAssignmentOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConditional(Microsoft.CodeAnalysis.Operations.IConditionalOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitConditionalAccess(Microsoft.CodeAnalysis.Operations.IConditionalAccessOperation! operation, TArgument argument) -> TResult?
@@ -4044,6 +4088,7 @@ virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.V
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSingleValueCaseClause(Microsoft.CodeAnalysis.Operations.ISingleValueCaseClauseOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSizeOf(Microsoft.CodeAnalysis.Operations.ISizeOfOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSlicePattern(Microsoft.CodeAnalysis.Operations.ISlicePatternOperation! operation, TArgument argument) -> TResult?
+virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSpread(Microsoft.CodeAnalysis.Operations.ISpreadOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitStaticLocalInitializationSemaphore(Microsoft.CodeAnalysis.FlowAnalysis.IStaticLocalInitializationSemaphoreOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitStop(Microsoft.CodeAnalysis.Operations.IStopOperation! operation, TArgument argument) -> TResult?
virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSwitch(Microsoft.CodeAnalysis.Operations.ISwitchOperation! operation, TArgument argument) -> TResult?
@@ -4135,11 +4180,13 @@ virtual Microsoft.CodeAnalysis.SymbolVisitor.VisitPointerType(Microsoft
virtual Microsoft.CodeAnalysis.SymbolVisitor.VisitProperty(Microsoft.CodeAnalysis.IPropertySymbol! symbol) -> TResult?
virtual Microsoft.CodeAnalysis.SymbolVisitor.VisitRangeVariable(Microsoft.CodeAnalysis.IRangeVariableSymbol! symbol) -> TResult?
virtual Microsoft.CodeAnalysis.SymbolVisitor.VisitTypeParameter(Microsoft.CodeAnalysis.ITypeParameterSymbol! symbol) -> TResult?
+virtual Microsoft.CodeAnalysis.SyntaxContextReceiverCreator.Invoke() -> Microsoft.CodeAnalysis.ISyntaxContextReceiver?
virtual Microsoft.CodeAnalysis.SyntaxNode.ChildThatContainsPosition(int position) -> Microsoft.CodeAnalysis.SyntaxNodeOrToken
virtual Microsoft.CodeAnalysis.SyntaxNode.ParentTrivia.get -> Microsoft.CodeAnalysis.SyntaxTrivia
virtual Microsoft.CodeAnalysis.SyntaxNode.SerializeTo(System.IO.Stream! stream, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void
virtual Microsoft.CodeAnalysis.SyntaxNode.ToFullString() -> string!
virtual Microsoft.CodeAnalysis.SyntaxNode.WriteTo(System.IO.TextWriter! writer) -> void
+virtual Microsoft.CodeAnalysis.SyntaxReceiverCreator.Invoke() -> Microsoft.CodeAnalysis.ISyntaxReceiver!
virtual Microsoft.CodeAnalysis.SyntaxReference.GetSyntaxAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task!
virtual Microsoft.CodeAnalysis.SyntaxTree.DiagnosticOptions.get -> System.Collections.Immutable.ImmutableDictionary!
virtual Microsoft.CodeAnalysis.SyntaxTree.GetLineVisibility(int position, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.LineVisibility
diff --git a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
index 2168ea24ba522..28504097080f8 100644
--- a/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
+++ b/src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
@@ -1,61 +1,2 @@
-Microsoft.CodeAnalysis.IParameterSymbol.IsParamsCollection.get -> bool
-Microsoft.CodeAnalysis.IParameterSymbol.IsParamsArray.get -> bool
-Microsoft.CodeAnalysis.Operations.ArgumentKind.ParamCollection = 4 -> Microsoft.CodeAnalysis.Operations.ArgumentKind
-Microsoft.CodeAnalysis.Diagnostics.SuppressionInfo.ProgrammaticSuppressions.get -> System.Collections.Immutable.ImmutableArray
-Microsoft.CodeAnalysis.Emit.InstrumentationKind.ModuleCancellation = 3 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind
-Microsoft.CodeAnalysis.Emit.InstrumentationKind.StackOverflowProbing = 2 -> Microsoft.CodeAnalysis.Emit.InstrumentationKind
-Microsoft.CodeAnalysis.OperationKind.CollectionExpression = 127 -> Microsoft.CodeAnalysis.OperationKind
-Microsoft.CodeAnalysis.OperationKind.Spread = 128 -> Microsoft.CodeAnalysis.OperationKind
-Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation.ConstructMethod.get -> Microsoft.CodeAnalysis.IMethodSymbol?
-Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation
-Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation.Elements.get -> System.Collections.Immutable.ImmutableArray
-Microsoft.CodeAnalysis.Operations.ISpreadOperation
-Microsoft.CodeAnalysis.Operations.ISpreadOperation.ElementConversion.get -> Microsoft.CodeAnalysis.Operations.CommonConversion
-Microsoft.CodeAnalysis.Operations.ISpreadOperation.ElementType.get -> Microsoft.CodeAnalysis.ITypeSymbol?
-Microsoft.CodeAnalysis.Operations.ISpreadOperation.Operand.get -> Microsoft.CodeAnalysis.IOperation!
-Microsoft.CodeAnalysis.SeparatedSyntaxList
-Microsoft.CodeAnalysis.SyntaxList
-static Microsoft.CodeAnalysis.SeparatedSyntaxList.Create(System.ReadOnlySpan nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
-static Microsoft.CodeAnalysis.SyntaxList.Create(System.ReadOnlySpan nodes) -> Microsoft.CodeAnalysis.SyntaxList
-static Microsoft.CodeAnalysis.SyntaxNodeOrTokenList.Create(System.ReadOnlySpan nodesAndTokens) -> Microsoft.CodeAnalysis.SyntaxNodeOrTokenList
-static Microsoft.CodeAnalysis.SyntaxTokenList.Create(System.ReadOnlySpan tokens) -> Microsoft.CodeAnalysis.SyntaxTokenList
-static Microsoft.CodeAnalysis.SyntaxTriviaList.Create(System.ReadOnlySpan trivias) -> Microsoft.CodeAnalysis.SyntaxTriviaList
-virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCollectionExpression(Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation! operation) -> void
-virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSpread(Microsoft.CodeAnalysis.Operations.ISpreadOperation! operation) -> void
-virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitCollectionExpression(Microsoft.CodeAnalysis.Operations.ICollectionExpressionOperation! operation, TArgument argument) -> TResult?
-virtual Microsoft.CodeAnalysis.Operations.OperationVisitor.VisitSpread(Microsoft.CodeAnalysis.Operations.ISpreadOperation! operation, TArgument argument) -> TResult?
-*REMOVED*static Microsoft.CodeAnalysis.SeparatedSyntaxList.implicit operator Microsoft.CodeAnalysis.SeparatedSyntaxList(Microsoft.CodeAnalysis.SeparatedSyntaxList nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList
-*REMOVED*static Microsoft.CodeAnalysis.SyntaxList.implicit operator Microsoft.CodeAnalysis.SyntaxList(Microsoft.CodeAnalysis.SyntaxList nodes) -> Microsoft.CodeAnalysis.SyntaxList
-*REMOVED*Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAllDiagnosticsAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
-*REMOVED*Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>!
-*REMOVED*static Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerExtensions.WithAnalyzers(this Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers!
-const Microsoft.CodeAnalysis.WellKnownDiagnosticTags.CustomSeverityConfigurable = "CustomSeverityConfigurable" -> string!
-Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.CompilationWithAnalyzers(Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options) -> void
-Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAllDiagnosticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task>!
-Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task>!
-*REMOVED*Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit(Microsoft.CodeAnalysis.Emit.SemanticEditKind kind, Microsoft.CodeAnalysis.ISymbol? oldSymbol, Microsoft.CodeAnalysis.ISymbol? newSymbol, System.Func? syntaxMap = null, bool preserveLocalVariables = false, Microsoft.CodeAnalysis.Emit.MethodInstrumentation instrumentation = default(Microsoft.CodeAnalysis.Emit.MethodInstrumentation)) -> void
-Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit
-Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit.Message.get -> string!
-Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit.RuntimeRudeEdit() -> void
-Microsoft.CodeAnalysis.Emit.RuntimeRudeEdit.RuntimeRudeEdit(string! message) -> void
-Microsoft.CodeAnalysis.Emit.SemanticEdit.RuntimeRudeEdit.get -> System.Func?
-Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit(Microsoft.CodeAnalysis.Emit.SemanticEditKind kind, Microsoft.CodeAnalysis.ISymbol? oldSymbol, Microsoft.CodeAnalysis.ISymbol? newSymbol, System.Func? syntaxMap = null, System.Func? runtimeRudeEdit = null, Microsoft.CodeAnalysis.Emit.MethodInstrumentation instrumentation = default(Microsoft.CodeAnalysis.Emit.MethodInstrumentation)) -> void
-Microsoft.CodeAnalysis.Emit.SemanticEdit.SemanticEdit(Microsoft.CodeAnalysis.Emit.SemanticEditKind kind, Microsoft.CodeAnalysis.ISymbol? oldSymbol, Microsoft.CodeAnalysis.ISymbol? newSymbol, System.Func? syntaxMap, bool preserveLocalVariables, Microsoft.CodeAnalysis.Emit.MethodInstrumentation instrumentation) -> void
-Microsoft.CodeAnalysis.Text.SourceText.GetContentHash() -> System.Collections.Immutable.ImmutableArray
-static Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerExtensions.WithAnalyzers(this Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options = null) -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers!
-static Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzerExtensions.WithAnalyzers(this Microsoft.CodeAnalysis.Compilation! compilation, System.Collections.Immutable.ImmutableArray analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers!
-Microsoft.CodeAnalysis.RefKind.RefReadOnlyParameter = 4 -> Microsoft.CodeAnalysis.RefKind
-virtual Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.MinimumReportedSeverity.get -> Microsoft.CodeAnalysis.DiagnosticSeverity
-static Microsoft.CodeAnalysis.Emit.EmitBaseline.CreateInitialBaseline(Microsoft.CodeAnalysis.Compilation! compilation, Microsoft.CodeAnalysis.ModuleMetadata! module, System.Func! debugInformationProvider, System.Func! localSignatureProvider, bool hasPortableDebugInformation) -> Microsoft.CodeAnalysis.Emit.EmitBaseline!
-virtual Microsoft.CodeAnalysis.SyntaxContextReceiverCreator.Invoke() -> Microsoft.CodeAnalysis.ISyntaxContextReceiver?
-virtual Microsoft.CodeAnalysis.SyntaxReceiverCreator.Invoke() -> Microsoft.CodeAnalysis.ISyntaxReceiver!
-static Microsoft.CodeAnalysis.DocumentationCommentId.CreateDeclarationId(Microsoft.CodeAnalysis.ISymbol! symbol) -> string?
-*REMOVED*static Microsoft.CodeAnalysis.DocumentationCommentId.CreateDeclarationId(Microsoft.CodeAnalysis.ISymbol! symbol) -> string!
-[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions
-[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions.None = 0 -> Microsoft.CodeAnalysis.SemanticModelOptions
-[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions.IgnoreAccessibility = 1 -> Microsoft.CodeAnalysis.SemanticModelOptions
-[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.SemanticModelOptions.DisableNullableAnalysis = 2 -> Microsoft.CodeAnalysis.SemanticModelOptions
-[RSEXPERIMENTAL001]Microsoft.CodeAnalysis.Compilation.GetSemanticModel(Microsoft.CodeAnalysis.SyntaxTree! syntaxTree, Microsoft.CodeAnalysis.SemanticModelOptions options) -> Microsoft.CodeAnalysis.SemanticModel!
-abstract Microsoft.CodeAnalysis.SemanticModel.NullableAnalysisIsDisabled.get -> bool
Microsoft.CodeAnalysis.ITypeParameterSymbol.AllowsRefLikeType.get -> bool
Microsoft.CodeAnalysis.RuntimeCapability.ByRefLikeGenerics = 8 -> Microsoft.CodeAnalysis.RuntimeCapability
diff --git a/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems b/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems
index 851b618b90dba..25e47648faab4 100644
--- a/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems
+++ b/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems
@@ -56,6 +56,7 @@
+
diff --git a/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj b/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj
index 76c9aeab86bb0..f957098915da2 100644
--- a/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj
+++ b/src/Compilers/Test/Core/Microsoft.CodeAnalysis.Test.Utilities.csproj
@@ -66,6 +66,7 @@
+
diff --git a/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj b/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj
index c332e5d4851d8..6e56556faaccf 100644
--- a/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj
+++ b/src/Compilers/Test/Utilities/CSharp/Microsoft.CodeAnalysis.CSharp.Test.Utilities.csproj
@@ -32,6 +32,7 @@
+
diff --git a/src/Compilers/VisualBasic/Test/Semantic/HasValidFonts.vb b/src/Compilers/VisualBasic/Test/Semantic/HasValidFonts.vb
index d784b33b2c560..62b3620a935a1 100644
--- a/src/Compilers/VisualBasic/Test/Semantic/HasValidFonts.vb
+++ b/src/Compilers/VisualBasic/Test/Semantic/HasValidFonts.vb
@@ -13,7 +13,9 @@ Friend Class HasValidFonts
Get
Try
If RuntimeInformation.IsOSPlatform(OSPlatform.Windows) Then
+#Disable Warning CA1416 ' Validate platform compatibility, we don't run tests on Windows < 6.1
Dim result = SystemFonts.DefaultFont
+#Enable Warning CA1416 ' Validate platform compatibility
Return result Is Nothing
Else
' The only tests using fonts are Windows-only.
diff --git a/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems b/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems
index d1729cd816e1c..a85e09f46fdde 100644
--- a/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems
+++ b/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems
@@ -36,6 +36,7 @@
+
diff --git a/src/Features/Core/Portable/Diagnostics/BuildOnlyDiagnosticsService.cs b/src/Features/Core/Portable/Diagnostics/BuildOnlyDiagnosticsService.cs
deleted file mode 100644
index 29c6b0831be2c..0000000000000
--- a/src/Features/Core/Portable/Diagnostics/BuildOnlyDiagnosticsService.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.Immutable;
-using System.Composition;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.Collections;
-using Microsoft.CodeAnalysis.Host;
-using Microsoft.CodeAnalysis.Host.Mef;
-using Microsoft.CodeAnalysis.Shared.TestHooks;
-using Roslyn.Utilities;
-
-namespace Microsoft.CodeAnalysis.Diagnostics;
-
-[ExportWorkspaceServiceFactory(typeof(IBuildOnlyDiagnosticsService), ServiceLayer.Default), Shared]
-[method: ImportingConstructor]
-[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
-internal sealed class BuildOnlyDiagnosticsServiceFactory(
- IAsynchronousOperationListenerProvider asynchronousOperationProvider) : IWorkspaceServiceFactory
-{
- public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
- => new BuildOnlyDiagnosticsService(workspaceServices.Workspace, asynchronousOperationProvider.GetListener(FeatureAttribute.Workspace));
-
- private sealed class BuildOnlyDiagnosticsService : IBuildOnlyDiagnosticsService, IDisposable
- {
- private readonly CancellationTokenSource _disposalTokenSource = new();
- private readonly AsyncBatchingWorkQueue _workQueue;
-
- private readonly SemaphoreSlim _gate = new(initialCount: 1);
- private readonly Dictionary> _documentDiagnostics = [];
-
- public BuildOnlyDiagnosticsService(
- Workspace workspace,
- IAsynchronousOperationListener asyncListener)
- {
- _workQueue = new AsyncBatchingWorkQueue(
- TimeSpan.Zero,
- ProcessWorkQueueAsync,
- asyncListener,
- _disposalTokenSource.Token);
- workspace.WorkspaceChanged += OnWorkspaceChanged;
- }
-
- public void Dispose()
- => _disposalTokenSource.Dispose();
-
- private void OnWorkspaceChanged(object? sender, WorkspaceChangeEventArgs e)
- {
- // Keep this switch in sync with the switch in ProcessWorkQueueAsync
- switch (e.Kind)
- {
- case WorkspaceChangeKind.SolutionAdded:
- case WorkspaceChangeKind.SolutionCleared:
- case WorkspaceChangeKind.SolutionReloaded:
- case WorkspaceChangeKind.SolutionRemoved:
- // Cancel existing work as we're going to clear out everything anyways, so no point processing any
- // document or project work.
- _workQueue.AddWork(e, cancelExistingWork: true);
- break;
- case WorkspaceChangeKind.ProjectReloaded:
- case WorkspaceChangeKind.ProjectRemoved:
- case WorkspaceChangeKind.DocumentRemoved:
- case WorkspaceChangeKind.DocumentReloaded:
- case WorkspaceChangeKind.AdditionalDocumentRemoved:
- case WorkspaceChangeKind.AdditionalDocumentReloaded:
- case WorkspaceChangeKind.AnalyzerConfigDocumentRemoved:
- case WorkspaceChangeKind.AnalyzerConfigDocumentReloaded:
- _workQueue.AddWork(e);
- break;
- }
- }
-
- private async ValueTask ProcessWorkQueueAsync(ImmutableSegmentedList list, CancellationToken cancellationToken)
- {
- foreach (var e in list)
- {
- // Keep this switch in sync with the switch in OnWorkspaceChanged
- switch (e.Kind)
- {
- case WorkspaceChangeKind.SolutionAdded:
- case WorkspaceChangeKind.SolutionCleared:
- case WorkspaceChangeKind.SolutionReloaded:
- case WorkspaceChangeKind.SolutionRemoved:
- await ClearAllDiagnosticsAsync(cancellationToken).ConfigureAwait(false);
- break;
-
- case WorkspaceChangeKind.ProjectReloaded:
- case WorkspaceChangeKind.ProjectRemoved:
- await ClearDiagnosticsAsync(e.OldSolution.GetProject(e.ProjectId), cancellationToken).ConfigureAwait(false);
- break;
-
- case WorkspaceChangeKind.DocumentRemoved:
- case WorkspaceChangeKind.DocumentReloaded:
- case WorkspaceChangeKind.AdditionalDocumentRemoved:
- case WorkspaceChangeKind.AdditionalDocumentReloaded:
- case WorkspaceChangeKind.AnalyzerConfigDocumentRemoved:
- case WorkspaceChangeKind.AnalyzerConfigDocumentReloaded:
- await ClearDiagnosticsAsync(e.DocumentId, cancellationToken).ConfigureAwait(false);
- break;
- }
- }
- }
-
- public async Task AddBuildOnlyDiagnosticsAsync(DocumentId documentId, ImmutableArray diagnostics, CancellationToken cancellationToken)
- {
- using (await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false))
- {
- if (documentId != null)
- _documentDiagnostics[documentId] = diagnostics;
- }
- }
-
- private async Task ClearAllDiagnosticsAsync(CancellationToken cancellationToken)
- {
- using (await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false))
- {
- _documentDiagnostics.Clear();
- }
- }
-
- private async Task ClearDiagnosticsAsync(DocumentId? documentId, CancellationToken cancellationToken)
- {
- if (documentId == null)
- return;
-
- using (await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false))
- {
- _documentDiagnostics.Remove(documentId);
- }
- }
-
- private async Task ClearDiagnosticsAsync(Project? project, CancellationToken cancellationToken)
- {
- if (project == null)
- return;
-
- using (await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false))
- {
- foreach (var documentId in project.DocumentIds)
- _documentDiagnostics.Remove(documentId);
- }
- }
-
- public Task ClearBuildOnlyDiagnosticsAsync(Project project, DocumentId? documentId, CancellationToken cancellationToken)
- {
- if (documentId != null)
- return ClearDiagnosticsAsync(documentId, cancellationToken);
- else
- return ClearDiagnosticsAsync(project, cancellationToken);
- }
-
- public async ValueTask> GetBuildOnlyDiagnosticsAsync(DocumentId documentId, CancellationToken cancellationToken)
- {
- using (await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false))
- {
- return _documentDiagnostics.TryGetValue(documentId, out var diagnostics) ? diagnostics : [];
- }
- }
- }
-}
diff --git a/src/Features/Core/Portable/Diagnostics/IBuildOnlyDiagnosticsService.cs b/src/Features/Core/Portable/Diagnostics/IBuildOnlyDiagnosticsService.cs
deleted file mode 100644
index 59ef009410c78..0000000000000
--- a/src/Features/Core/Portable/Diagnostics/IBuildOnlyDiagnosticsService.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Collections.Immutable;
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.Host;
-
-namespace Microsoft.CodeAnalysis.Diagnostics;
-
-///
-/// Service to keep track of build-only diagnostics reported from explicit Build/Rebuild commands.
-/// Note that this service only keeps track of those diagnostics that can never be reported from live analysis.
-///
-internal interface IBuildOnlyDiagnosticsService : IWorkspaceService
-{
- Task AddBuildOnlyDiagnosticsAsync(DocumentId documentId, ImmutableArray diagnostics, CancellationToken cancellationToken);
-
- Task ClearBuildOnlyDiagnosticsAsync(Project project, DocumentId? documentId, CancellationToken cancellationToken);
-
- ValueTask> GetBuildOnlyDiagnosticsAsync(DocumentId documentId, CancellationToken cancellationToken);
-}
diff --git a/src/Features/Core/Portable/PublicAPI.Shipped.txt b/src/Features/Core/Portable/PublicAPI.Shipped.txt
index c1a4928fee832..f1443c698b655 100644
--- a/src/Features/Core/Portable/PublicAPI.Shipped.txt
+++ b/src/Features/Core/Portable/PublicAPI.Shipped.txt
@@ -230,6 +230,7 @@ Microsoft.CodeAnalysis.QuickInfo.QuickInfoSectionKinds
Microsoft.CodeAnalysis.QuickInfo.QuickInfoService
Microsoft.CodeAnalysis.QuickInfo.QuickInfoService.GetQuickInfoAsync(Microsoft.CodeAnalysis.Document document, int position, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task
Microsoft.CodeAnalysis.TaggedText
+Microsoft.CodeAnalysis.TaggedText.Equals(Microsoft.CodeAnalysis.TaggedText other) -> bool
Microsoft.CodeAnalysis.TaggedText.Tag.get -> string
Microsoft.CodeAnalysis.TaggedText.TaggedText() -> void
Microsoft.CodeAnalysis.TaggedText.TaggedText(string tag, string text) -> void
@@ -237,6 +238,8 @@ Microsoft.CodeAnalysis.TaggedText.Text.get -> string
Microsoft.CodeAnalysis.TextTags
override Microsoft.CodeAnalysis.CodeActions.DocumentNavigationOperation.Apply(Microsoft.CodeAnalysis.Workspace workspace, System.Threading.CancellationToken cancellationToken) -> void
override Microsoft.CodeAnalysis.Completion.CompletionItem.ToString() -> string
+override Microsoft.CodeAnalysis.TaggedText.Equals(object obj) -> bool
+override Microsoft.CodeAnalysis.TaggedText.GetHashCode() -> int
override Microsoft.CodeAnalysis.TaggedText.ToString() -> string
static Microsoft.CodeAnalysis.Completion.CharacterSetModificationRule.Create(Microsoft.CodeAnalysis.Completion.CharacterSetModificationKind kind, params char[] characters) -> Microsoft.CodeAnalysis.Completion.CharacterSetModificationRule
static Microsoft.CodeAnalysis.Completion.CharacterSetModificationRule.Create(Microsoft.CodeAnalysis.Completion.CharacterSetModificationKind kind, System.Collections.Immutable.ImmutableArray characters) -> Microsoft.CodeAnalysis.Completion.CharacterSetModificationRule
@@ -262,6 +265,8 @@ static Microsoft.CodeAnalysis.Completion.CompletionTrigger.CreateInsertionTrigge
static Microsoft.CodeAnalysis.QuickInfo.QuickInfoItem.Create(Microsoft.CodeAnalysis.Text.TextSpan span, System.Collections.Immutable.ImmutableArray tags = default(System.Collections.Immutable.ImmutableArray), System.Collections.Immutable.ImmutableArray sections = default(System.Collections.Immutable.ImmutableArray), System.Collections.Immutable.ImmutableArray relatedSpans = default(System.Collections.Immutable.ImmutableArray)) -> Microsoft.CodeAnalysis.QuickInfo.QuickInfoItem
static Microsoft.CodeAnalysis.QuickInfo.QuickInfoSection.Create(string kind, System.Collections.Immutable.ImmutableArray taggedParts) -> Microsoft.CodeAnalysis.QuickInfo.QuickInfoSection
static Microsoft.CodeAnalysis.QuickInfo.QuickInfoService.GetService(Microsoft.CodeAnalysis.Document document) -> Microsoft.CodeAnalysis.QuickInfo.QuickInfoService
+static Microsoft.CodeAnalysis.TaggedText.operator !=(Microsoft.CodeAnalysis.TaggedText left, Microsoft.CodeAnalysis.TaggedText right) -> bool
+static Microsoft.CodeAnalysis.TaggedText.operator ==(Microsoft.CodeAnalysis.TaggedText left, Microsoft.CodeAnalysis.TaggedText right) -> bool
static readonly Microsoft.CodeAnalysis.Completion.CompletionDescription.Empty -> Microsoft.CodeAnalysis.Completion.CompletionDescription
static readonly Microsoft.CodeAnalysis.Completion.CompletionList.Empty -> Microsoft.CodeAnalysis.Completion.CompletionList
static readonly Microsoft.CodeAnalysis.Completion.CompletionRules.Default -> Microsoft.CodeAnalysis.Completion.CompletionRules
diff --git a/src/Features/Core/Portable/PublicAPI.Unshipped.txt b/src/Features/Core/Portable/PublicAPI.Unshipped.txt
index 5177098e215f3..8b137891791fe 100644
--- a/src/Features/Core/Portable/PublicAPI.Unshipped.txt
+++ b/src/Features/Core/Portable/PublicAPI.Unshipped.txt
@@ -1,5 +1 @@
-Microsoft.CodeAnalysis.TaggedText.Equals(Microsoft.CodeAnalysis.TaggedText other) -> bool
-override Microsoft.CodeAnalysis.TaggedText.Equals(object obj) -> bool
-override Microsoft.CodeAnalysis.TaggedText.GetHashCode() -> int
-static Microsoft.CodeAnalysis.TaggedText.operator !=(Microsoft.CodeAnalysis.TaggedText left, Microsoft.CodeAnalysis.TaggedText right) -> bool
-static Microsoft.CodeAnalysis.TaggedText.operator ==(Microsoft.CodeAnalysis.TaggedText left, Microsoft.CodeAnalysis.TaggedText right) -> bool
+
diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Microsoft.CodeAnalysis.LanguageServer.csproj b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Microsoft.CodeAnalysis.LanguageServer.csproj
index e5e9d44e5c2c9..ee6f6c01ca3c1 100644
--- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Microsoft.CodeAnalysis.LanguageServer.csproj
+++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Microsoft.CodeAnalysis.LanguageServer.csproj
@@ -71,6 +71,9 @@
+
+
+
diff --git a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs
index 9f17a3c8e096e..f2f65827afd44 100644
--- a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs
+++ b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs
@@ -116,10 +116,6 @@ public async Task GetMostSevereFixAsync(
var copilotDiagnostics = await GetCopilotDiagnosticsAsync(document, range, priorityProvider.Priority, cancellationToken).ConfigureAwait(false);
allDiagnostics = allDiagnostics.AddRange(copilotDiagnostics);
- var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService();
- allDiagnostics = allDiagnostics.AddRange(
- await buildOnlyDiagnosticsService.GetBuildOnlyDiagnosticsAsync(document.Id, cancellationToken).ConfigureAwait(false));
-
var text = await document.GetValueTextAsync(cancellationToken).ConfigureAwait(false);
var spanToDiagnostics = ConvertToMap(text, allDiagnostics);
@@ -207,10 +203,7 @@ public async IAsyncEnumerable StreamFixesAsync(
var copilotDiagnostics = await GetCopilotDiagnosticsAsync(document, range, priorityProvider.Priority, cancellationToken).ConfigureAwait(false);
diagnostics = diagnostics.AddRange(copilotDiagnostics);
- var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService();
- var buildOnlyDiagnostics = await buildOnlyDiagnosticsService.GetBuildOnlyDiagnosticsAsync(document.Id, cancellationToken).ConfigureAwait(false);
-
- if (diagnostics.IsEmpty && buildOnlyDiagnostics.IsEmpty)
+ if (diagnostics.IsEmpty)
yield break;
if (!diagnostics.IsEmpty)
@@ -234,7 +227,6 @@ public async IAsyncEnumerable StreamFixesAsync(
if (document.Project.Solution.WorkspaceKind != WorkspaceKind.Interactive && includeSuppressionFixes)
{
// For build-only diagnostics, we support configuration/suppression fixes.
- diagnostics = diagnostics.AddRange(buildOnlyDiagnostics);
var text = await document.GetValueTextAsync(cancellationToken).ConfigureAwait(false);
var spanToDiagnostics = ConvertToMap(text, diagnostics);
diff --git a/src/Features/Lsif/Generator/Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.csproj b/src/Features/Lsif/Generator/Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.csproj
index 6aefd270a5757..c4df7745d52cb 100644
--- a/src/Features/Lsif/Generator/Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.csproj
+++ b/src/Features/Lsif/Generator/Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.csproj
@@ -84,6 +84,11 @@
+
+
+
diff --git a/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets b/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets
index aa85224f576fa..7008b7b87c2f6 100644
--- a/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets
+++ b/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets
@@ -33,6 +33,7 @@
+
diff --git a/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj b/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj
index a2cd0a4560532..5a7283350c3c1 100644
--- a/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj
+++ b/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj
@@ -26,6 +26,7 @@
+
diff --git a/src/Scripting/Core/PublicAPI.Shipped.txt b/src/Scripting/Core/PublicAPI.Shipped.txt
index 8668ebd32463a..a4d40dec208b3 100644
--- a/src/Scripting/Core/PublicAPI.Shipped.txt
+++ b/src/Scripting/Core/PublicAPI.Shipped.txt
@@ -160,3 +160,4 @@ static Microsoft.CodeAnalysis.Scripting.ScriptMetadataResolver.Default.get -> Mi
static Microsoft.CodeAnalysis.Scripting.ScriptOptions.Default.get -> Microsoft.CodeAnalysis.Scripting.ScriptOptions
static Microsoft.CodeAnalysis.Scripting.ScriptSourceResolver.Default.get -> Microsoft.CodeAnalysis.Scripting.ScriptSourceResolver
virtual Microsoft.CodeAnalysis.Scripting.Hosting.PrintOptions.IsValidRadix(int radix) -> bool
+virtual Microsoft.CodeAnalysis.Scripting.ScriptRunner.Invoke(object globals = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task
diff --git a/src/Scripting/Core/PublicAPI.Unshipped.txt b/src/Scripting/Core/PublicAPI.Unshipped.txt
index f79fe5ad87c59..8b137891791fe 100644
--- a/src/Scripting/Core/PublicAPI.Unshipped.txt
+++ b/src/Scripting/Core/PublicAPI.Unshipped.txt
@@ -1 +1 @@
-virtual Microsoft.CodeAnalysis.Scripting.ScriptRunner.Invoke(object globals = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task
+
diff --git a/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs b/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs
index 95268daf87b17..23717503f643f 100644
--- a/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs
+++ b/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs
@@ -178,7 +178,9 @@ private bool CheckPackages(TextWriter textWriter)
allGood &= VerifyPackageCore(
textWriter,
FindNuGetPackage(Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"), "Microsoft.Net.Compilers.Toolset"),
- excludeFunc: relativeFileName => relativeFileName.StartsWith(@"tasks\netcore\bincore\Microsoft.DiaSymReader.Native", PathComparison),
+ excludeFunc: relativeFileName =>
+ relativeFileName.StartsWith(@"tasks\netcore\bincore\Microsoft.DiaSymReader.Native", PathComparison) ||
+ relativeFileName.StartsWith(@"tasks\netcore\bincore\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.dll", PathComparison),
(@"tasks\net472", GetProjectOutputDirectory("csc", "net472")),
(@"tasks\net472", GetProjectOutputDirectory("vbc", "net472")),
(@"tasks\net472", GetProjectOutputDirectory("csi", "net472")),
diff --git a/src/Tools/ExternalAccess/FSharp/Internal/VisualStudio/FSharpProjectExternalErrorReporterFactory.cs b/src/Tools/ExternalAccess/FSharp/Internal/VisualStudio/FSharpProjectExternalErrorReporterFactory.cs
deleted file mode 100644
index eb836e0a42472..0000000000000
--- a/src/Tools/ExternalAccess/FSharp/Internal/VisualStudio/FSharpProjectExternalErrorReporterFactory.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-#nullable disable
-
-using System;
-using Microsoft.VisualStudio.Shell.Interop;
-using Microsoft.VisualStudio.LanguageServices;
-using Microsoft.VisualStudio.LanguageServices.Implementation.TaskList;
-using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem;
-using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.Extensions;
-using Microsoft.VisualStudio.Shell;
-
-namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal.VisualStudio
-{
- internal static class FSharpProjectExternalErrorReporterFactory
- {
- public static IVsLanguageServiceBuildErrorReporter2 Create(ProjectId projectId, string errorCodePrefix, IServiceProvider serviceProvider)
- {
- var workspace = (VisualStudioWorkspaceImpl)serviceProvider.GetMefService();
- return new ProjectExternalErrorReporter(projectId, errorCodePrefix, LanguageNames.FSharp, workspace);
- }
- }
-}
diff --git a/src/Tools/ExternalAccess/RazorCompiler/GeneratorExtensions.cs b/src/Tools/ExternalAccess/RazorCompiler/GeneratorExtensions.cs
new file mode 100644
index 0000000000000..bc7d9f43af7be
--- /dev/null
+++ b/src/Tools/ExternalAccess/RazorCompiler/GeneratorExtensions.cs
@@ -0,0 +1,34 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Immutable;
+using System.Threading;
+using Microsoft.CodeAnalysis.PooledObjects;
+
+namespace Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler
+{
+ internal static partial class GeneratorExtensions
+ {
+ public static void RegisterHostOutput(ref this IncrementalGeneratorInitializationContext @this, IncrementalValuesProvider source, Action action)
+ {
+ _ = @this;
+ source.Node.RegisterOutput(new HostOutputNode(source.Node, action));
+ }
+
+ public static ImmutableArray<(string Key, string Value)> GetHostOutputs(this GeneratorRunResult runResult) => runResult.HostOutputs;
+ }
+
+ internal readonly struct HostProductionContext
+ {
+ internal readonly ArrayBuilder<(string, string)> Outputs;
+
+ internal HostProductionContext(ArrayBuilder<(string, string)> outputs)
+ {
+ Outputs = outputs;
+ }
+
+ public void AddOutput(string name, string value) => Outputs.Add((name, value));
+ }
+}
diff --git a/src/Tools/ExternalAccess/RazorCompiler/HostOutputNode.cs b/src/Tools/ExternalAccess/RazorCompiler/HostOutputNode.cs
new file mode 100644
index 0000000000000..3ae1b7dcd296e
--- /dev/null
+++ b/src/Tools/ExternalAccess/RazorCompiler/HostOutputNode.cs
@@ -0,0 +1,92 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.Text;
+using System.Threading;
+using Microsoft.CodeAnalysis.PooledObjects;
+using Roslyn.Utilities;
+using TOutput = System.Collections.Immutable.ImmutableArray<(string, string)>;
+
+namespace Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler
+{
+ internal sealed class HostOutputNode : IIncrementalGeneratorOutputNode, IIncrementalGeneratorNode
+ {
+ private readonly IIncrementalGeneratorNode _source;
+
+ private readonly Action _action;
+
+ public HostOutputNode(IIncrementalGeneratorNode source, Action action)
+ {
+ _source = source;
+ _action = action;
+ }
+
+ public IncrementalGeneratorOutputKind Kind => GeneratorDriver.HostKind;
+
+ public NodeStateTable UpdateStateTable(DriverStateTable.Builder graphState, NodeStateTable? previousTable, CancellationToken cancellationToken)
+ {
+ string stepName = "HostOutput";
+ var sourceTable = graphState.GetLatestStateTableForNode(_source);
+ if (sourceTable.IsCached && previousTable is not null)
+ {
+ if (graphState.DriverState.TrackIncrementalSteps)
+ {
+ return previousTable.CreateCachedTableWithUpdatedSteps(sourceTable, stepName, EqualityComparer.Default);
+ }
+ return previousTable;
+ }
+
+ var nodeTable = graphState.CreateTableBuilder(previousTable, stepName, EqualityComparer.Default);
+ foreach (var entry in sourceTable)
+ {
+ var inputs = nodeTable.TrackIncrementalSteps ? ImmutableArray.Create((entry.Step!, entry.OutputIndex)) : default;
+ if (entry.State == EntryState.Removed)
+ {
+ nodeTable.TryRemoveEntries(TimeSpan.Zero, inputs);
+ }
+ else if (entry.State != EntryState.Cached || !nodeTable.TryUseCachedEntries(TimeSpan.Zero, inputs))
+ {
+ ArrayBuilder<(string, string)> output = ArrayBuilder<(string, string)>.GetInstance();
+ HostProductionContext context = new HostProductionContext(output);
+ var stopwatch = SharedStopwatch.StartNew();
+ _action(context, entry.Item, cancellationToken);
+ nodeTable.AddEntry(output.ToImmutableAndFree(), EntryState.Added, stopwatch.Elapsed, inputs, EntryState.Added);
+ }
+ }
+
+ return nodeTable.ToImmutableAndFree();
+ }
+
+ public void AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken)
+ {
+ // get our own state table
+ Debug.Assert(context.TableBuilder is not null);
+ var table = context.TableBuilder!.GetLatestStateTableForNode(this);
+
+ // add each non-removed entry to the context
+ foreach (var (list, state, _, _) in table)
+ {
+ if (state != EntryState.Removed)
+ {
+ context.HostOutputBuilder.AddRange(list);
+ }
+ }
+
+ if (context.GeneratorRunStateBuilder.RecordingExecutedSteps)
+ {
+ context.GeneratorRunStateBuilder.RecordStepsFromOutputNodeUpdate(table);
+ }
+ }
+
+ IIncrementalGeneratorNode IIncrementalGeneratorNode.WithComparer(IEqualityComparer comparer) => throw ExceptionUtilities.Unreachable();
+
+ public IIncrementalGeneratorNode WithTrackingName(string name) => throw ExceptionUtilities.Unreachable();
+
+ void IIncrementalGeneratorNode.RegisterOutput(IIncrementalGeneratorOutputNode output) => throw ExceptionUtilities.Unreachable();
+ }
+}
diff --git a/src/Tools/ExternalAccess/RazorCompiler/InternalAPI.Shipped.txt b/src/Tools/ExternalAccess/RazorCompiler/InternalAPI.Shipped.txt
new file mode 100644
index 0000000000000..7dc5c58110bfa
--- /dev/null
+++ b/src/Tools/ExternalAccess/RazorCompiler/InternalAPI.Shipped.txt
@@ -0,0 +1 @@
+#nullable enable
diff --git a/src/Tools/ExternalAccess/RazorCompiler/InternalAPI.Unshipped.txt b/src/Tools/ExternalAccess/RazorCompiler/InternalAPI.Unshipped.txt
new file mode 100644
index 0000000000000..7c99629a815f4
--- /dev/null
+++ b/src/Tools/ExternalAccess/RazorCompiler/InternalAPI.Unshipped.txt
@@ -0,0 +1,15 @@
+#nullable enable
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.GeneratorExtensions
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostOutputNode
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostOutputNode.AppendOutputs(Microsoft.CodeAnalysis.IncrementalExecutionContext context, System.Threading.CancellationToken cancellationToken) -> void
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostOutputNode.HostOutputNode(Microsoft.CodeAnalysis.IIncrementalGeneratorNode! source, System.Action! action) -> void
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostOutputNode.Kind.get -> Microsoft.CodeAnalysis.IncrementalGeneratorOutputKind
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostOutputNode.UpdateStateTable(Microsoft.CodeAnalysis.DriverStateTable.Builder! graphState, Microsoft.CodeAnalysis.NodeStateTable>? previousTable, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.NodeStateTable>!
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostOutputNode.WithTrackingName(string! name) -> Microsoft.CodeAnalysis.IIncrementalGeneratorNode>!
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostProductionContext
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostProductionContext.AddOutput(string! name, string! value) -> void
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostProductionContext.HostProductionContext() -> void
+Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostProductionContext.HostProductionContext(Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder<(string!, string!)>! outputs) -> void
+readonly Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.HostProductionContext.Outputs -> Microsoft.CodeAnalysis.PooledObjects.ArrayBuilder<(string!, string!)>!
+static Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.GeneratorExtensions.GetHostOutputs(this Microsoft.CodeAnalysis.GeneratorRunResult runResult) -> System.Collections.Immutable.ImmutableArray<(string! Key, string! Value)>
+static Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.GeneratorExtensions.RegisterHostOutput(this ref Microsoft.CodeAnalysis.IncrementalGeneratorInitializationContext this, Microsoft.CodeAnalysis.IncrementalValuesProvider source, System.Action! action) -> void
diff --git a/src/Tools/ExternalAccess/RazorCompiler/Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.csproj b/src/Tools/ExternalAccess/RazorCompiler/Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.csproj
new file mode 100644
index 0000000000000..f41f08081f772
--- /dev/null
+++ b/src/Tools/ExternalAccess/RazorCompiler/Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.csproj
@@ -0,0 +1,46 @@
+
+
+
+
+ Library
+ Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler
+ $(NetRoslynSourceBuild);netstandard2.0
+
+
+ false
+
+
+ true
+ Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler
+
+ A supporting package for Razor source generator:
+ https://github.com/dotnet/razor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Tools/ExternalAccess/RazorCompiler/PublicAPI.Shipped.txt b/src/Tools/ExternalAccess/RazorCompiler/PublicAPI.Shipped.txt
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/src/Tools/ExternalAccess/RazorCompiler/PublicAPI.Unshipped.txt b/src/Tools/ExternalAccess/RazorCompiler/PublicAPI.Unshipped.txt
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/src/Tools/ExternalAccess/RazorCompilerTest/HostOutputsTests.cs b/src/Tools/ExternalAccess/RazorCompilerTest/HostOutputsTests.cs
new file mode 100644
index 0000000000000..ac6da1b1b9d6a
--- /dev/null
+++ b/src/Tools/ExternalAccess/RazorCompilerTest/HostOutputsTests.cs
@@ -0,0 +1,51 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
+using Microsoft.CodeAnalysis.CSharp.UnitTests;
+using Microsoft.CodeAnalysis.Test.Utilities;
+using Roslyn.Test.Utilities.TestGenerators;
+using Xunit;
+
+namespace Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests
+{
+ public class HostOutputsTests : CSharpTestBase
+ {
+ [Fact]
+ public void Added()
+ {
+ var source = """
+ class C { }
+ """;
+ var parseOptions = TestOptions.Regular;
+ var compilation = CreateCompilation(source, options: TestOptions.DebugDllThrowing, parseOptions: parseOptions);
+ compilation.VerifyDiagnostics();
+
+ Assert.Single(compilation.SyntaxTrees);
+
+ var generator = new PipelineCallbackGenerator(ctx =>
+ {
+ var syntaxProvider = ctx.SyntaxProvider.CreateSyntaxProvider((n, _) => n.IsKind(SyntaxKind.ClassDeclaration), (c, _) => c.Node);
+
+ ctx.RegisterHostOutput(syntaxProvider, static (hpc, node, _) =>
+ {
+ hpc.AddOutput("test", node.ToFullString());
+ });
+ });
+
+ GeneratorDriver driver = CSharpGeneratorDriver.Create(new[] { generator.AsSourceGenerator() }, parseOptions: parseOptions);
+ driver = driver.RunGenerators(compilation);
+
+ var result = driver.GetRunResult().Results.Single();
+ Assert.Empty(result.Diagnostics);
+
+ var hostOutputs = result.GetHostOutputs();
+ Assert.Equal(1, hostOutputs.Length);
+ Assert.Equal("test", hostOutputs[0].Key);
+ Assert.Equal(source, hostOutputs[0].Value);
+ }
+ }
+}
diff --git a/src/Tools/ExternalAccess/RazorCompilerTest/Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests.csproj b/src/Tools/ExternalAccess/RazorCompilerTest/Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests.csproj
new file mode 100644
index 0000000000000..caa37487800e7
--- /dev/null
+++ b/src/Tools/ExternalAccess/RazorCompilerTest/Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests.csproj
@@ -0,0 +1,14 @@
+
+
+
+
+ Library
+ Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.UnitTests
+ $(NetRoslyn);net472
+
+
+
+
+
+
+
diff --git a/src/VisualStudio/Core/Def/Progression/GraphBuilder.cs b/src/VisualStudio/Core/Def/Progression/GraphBuilder.cs
index 6c89df41dd905..8844c23386857 100644
--- a/src/VisualStudio/Core/Def/Progression/GraphBuilder.cs
+++ b/src/VisualStudio/Core/Def/Progression/GraphBuilder.cs
@@ -26,7 +26,10 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.Progression;
internal sealed partial class GraphBuilder
{
private readonly Graph _graph = new();
+ // Our usage of SemaphoreSlim is fine. We don't perform blocking waits for it on the UI thread.
+#pragma warning disable RS0030 // Do not use banned APIs
private readonly SemaphoreSlim _gate = new(initialCount: 1);
+#pragma warning restore RS0030 // Do not use banned APIs
private readonly ISet _createdNodes = new HashSet();
private readonly IList> _deferredPropertySets = new List>();
diff --git a/src/VisualStudio/Core/Def/ProjectSystem/Legacy/AbstractLegacyProject.cs b/src/VisualStudio/Core/Def/ProjectSystem/Legacy/AbstractLegacyProject.cs
index fab4757f37e23..8e9aeb5717d2b 100644
--- a/src/VisualStudio/Core/Def/ProjectSystem/Legacy/AbstractLegacyProject.cs
+++ b/src/VisualStudio/Core/Def/ProjectSystem/Legacy/AbstractLegacyProject.cs
@@ -149,7 +149,9 @@ public AbstractLegacyProject(
ConnectHierarchyEvents();
RefreshBinOutputPath();
- _externalErrorReporter = new ProjectExternalErrorReporter(ProjectSystemProject.Id, externalErrorReportingPrefix, language, workspaceImpl);
+ var projectHierarchyGuid = GetProjectIDGuid(hierarchy);
+
+ _externalErrorReporter = new ProjectExternalErrorReporter(ProjectSystemProject.Id, projectHierarchyGuid, externalErrorReportingPrefix, language, workspaceImpl);
_batchScopeCreator = componentModel.GetService();
_batchScopeCreator.StartTrackingProject(ProjectSystemProject, Hierarchy);
}
diff --git a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs
index f6c0795f1e344..92444d1e48237 100644
--- a/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs
+++ b/src/VisualStudio/Core/Def/ProjectSystem/VisualStudioWorkspaceImpl.cs
@@ -31,6 +31,7 @@
using Microsoft.CodeAnalysis.Telemetry;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.Workspaces.ProjectSystem;
+using Microsoft.ServiceHub.Framework;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.Composition;
using Microsoft.VisualStudio.Editor;
@@ -42,6 +43,7 @@
using Microsoft.VisualStudio.LanguageServices.Utilities;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
+using Microsoft.VisualStudio.Shell.ServiceBroker;
using Microsoft.VisualStudio.Telemetry;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Projection;
@@ -74,7 +76,10 @@ internal abstract partial class VisualStudioWorkspaceImpl : VisualStudioWorkspac
///
/// Guards any updates to the maps here that aren't updated via interlocked updates.
///
+ // Our usage of SemaphoreSlim is fine. We don't perform blocking waits for it on the UI thread.
+#pragma warning disable RS0030 // Do not use banned APIs
private readonly SemaphoreSlim _gate = new SemaphoreSlim(initialCount: 1);
+#pragma warning restore RS0030 // Do not use banned APIs
private ImmutableDictionary _projectToHierarchyMap = ImmutableDictionary.Empty;
private ImmutableDictionary _projectToGuidMap = ImmutableDictionary.Empty;
@@ -127,12 +132,7 @@ public VisualStudioWorkspaceImpl(ExportProvider exportProvider, IAsyncServicePro
InitializeUIAffinitizedServicesAsync(asyncServiceProvider).Forget();
_lazyExternalErrorDiagnosticUpdateSource = new Lazy(() =>
- new ExternalErrorDiagnosticUpdateSource(
- this,
- exportProvider.GetExportedValue(),
- exportProvider.GetExportedValue(),
- exportProvider.GetExportedValue(),
- _threadingContext),
+ exportProvider.GetExportedValue(),
isThreadSafe: true);
_workspaceListener = Services.GetRequiredService().GetListener();
diff --git a/src/VisualStudio/Core/Def/SymbolSearch/VisualStudioSymbolSearchService.cs b/src/VisualStudio/Core/Def/SymbolSearch/VisualStudioSymbolSearchService.cs
index b29accb7d3325..2e5295479ee3a 100644
--- a/src/VisualStudio/Core/Def/SymbolSearch/VisualStudioSymbolSearchService.cs
+++ b/src/VisualStudio/Core/Def/SymbolSearch/VisualStudioSymbolSearchService.cs
@@ -39,7 +39,10 @@ namespace Microsoft.VisualStudio.LanguageServices.SymbolSearch;
[ExportWorkspaceService(typeof(ISymbolSearchService), ServiceLayer.Host), Shared]
internal partial class VisualStudioSymbolSearchService : AbstractDelayStartedService, ISymbolSearchService, IDisposable
{
+ // Our usage of SemaphoreSlim is fine. We don't perform blocking waits for it on the UI thread.
+#pragma warning disable RS0030 // Do not use banned APIs
private readonly SemaphoreSlim _gate = new(initialCount: 1);
+#pragma warning restore RS0030 // Do not use banned APIs
// Note: A remote engine is disposable as it maintains a connection with ServiceHub,
// but we want to keep it alive until the VS is closed, so we don't dispose it.
diff --git a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs
index 37aaa36f7e0a3..b376dc5c68319 100644
--- a/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs
+++ b/src/VisualStudio/Core/Def/TableDataSource/Suppression/VisualStudioSuppressionFixService.cs
@@ -105,7 +105,7 @@ public bool AddSuppressions(IVsHierarchy? projectHierarchy)
// Apply suppressions fix in global suppressions file for non-compiler diagnostics and
// in source only for compiler diagnostics.
- var diagnosticsToFix = GetDiagnosticsToFix(shouldFixInProject, selectedEntriesOnly: false, isAddSuppression: true);
+ var diagnosticsToFix = GetDiagnosticsToFix(selectedEntriesOnly: false, isAddSuppression: true);
if (!ApplySuppressionFix(diagnosticsToFix, shouldFixInProject, filterStaleDiagnostics: false, isAddSuppression: true, isSuppressionInSource: false, onlyCompilerDiagnostics: false, showPreviewChangesDialog: false))
{
return false;
@@ -151,63 +151,13 @@ private static Func GetShouldFixInProjectDelegate(IVsHierarchyIte
return p => projectHierarchy == null || p.Id == projectIdToMatch;
}
- private async Task> GetAllBuildDiagnosticsAsync(Func shouldFixInProject, CancellationToken cancellationToken)
- {
- using var _ = CodeAnalysis.PooledObjects.ArrayBuilder.GetInstance(out var builder);
-
- var buildDiagnostics = _buildErrorDiagnosticService.GetBuildErrors().Where(d => d.ProjectId != null && d.Severity != DiagnosticSeverity.Hidden);
- var solution = _workspace.CurrentSolution;
- foreach (var diagnosticsByProject in buildDiagnostics.GroupBy(d => d.ProjectId))
- {
- cancellationToken.ThrowIfCancellationRequested();
-
- if (diagnosticsByProject.Key == null)
- {
- // Diagnostics with no projectId cannot be suppressed.
- continue;
- }
-
- var project = solution.GetProject(diagnosticsByProject.Key);
- if (project != null && shouldFixInProject(project))
- {
- var diagnosticsByDocument = diagnosticsByProject.GroupBy(d => d.DocumentId);
- foreach (var group in diagnosticsByDocument)
- {
- var documentId = group.Key;
- if (documentId == null)
- {
- // Project diagnostics, just add all of them.
- builder.AddRange(group);
- continue;
- }
-
- // For document diagnostics ensure that whatever was reported is placed at a valid location for
- // the state the document is currently in.
- var document = project.GetDocument(documentId);
- if (document != null)
- {
- var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
- var text = await tree.GetTextAsync(cancellationToken).ConfigureAwait(false);
- foreach (var diagnostic in group)
- {
- var span = diagnostic.DataLocation.UnmappedFileSpan.GetClampedTextSpan(text);
- builder.Add(diagnostic.WithLocations(diagnostic.DataLocation.WithSpan(span, tree), additionalLocations: default));
- }
- }
- }
- }
- }
-
- return builder.ToImmutableAndClear();
- }
-
private static string GetFixTitle(bool isAddSuppression)
=> isAddSuppression ? ServicesVSResources.Suppress_diagnostics : ServicesVSResources.Remove_suppressions;
private static string GetWaitDialogMessage(bool isAddSuppression)
=> isAddSuppression ? ServicesVSResources.Computing_suppressions_fix : ServicesVSResources.Computing_remove_suppressions_fix;
- private IEnumerable? GetDiagnosticsToFix(Func shouldFixInProject, bool selectedEntriesOnly, bool isAddSuppression)
+ private IEnumerable? GetDiagnosticsToFix(bool selectedEntriesOnly, bool isAddSuppression)
{
var diagnosticsToFix = ImmutableHashSet.Empty;
void computeDiagnosticsToFix(IUIThreadOperationContext context)
@@ -218,7 +168,7 @@ void computeDiagnosticsToFix(IUIThreadOperationContext context)
// snapshots. Otherwise, get all diagnostics from the diagnostic service.
var diagnosticsToFixTask = selectedEntriesOnly
? _suppressionStateService.GetSelectedItemsAsync(isAddSuppression, cancellationToken)
- : GetAllBuildDiagnosticsAsync(shouldFixInProject, cancellationToken);
+ : Task.FromResult>([]);
diagnosticsToFix = diagnosticsToFixTask.WaitAndGetResult(cancellationToken).ToImmutableHashSet();
}
@@ -238,7 +188,7 @@ void computeDiagnosticsToFix(IUIThreadOperationContext context)
private bool ApplySuppressionFix(Func shouldFixInProject, bool selectedEntriesOnly, bool isAddSuppression, bool isSuppressionInSource, bool onlyCompilerDiagnostics, bool showPreviewChangesDialog)
{
- var diagnosticsToFix = GetDiagnosticsToFix(shouldFixInProject, selectedEntriesOnly, isAddSuppression);
+ var diagnosticsToFix = GetDiagnosticsToFix(selectedEntriesOnly, isAddSuppression);
return ApplySuppressionFix(diagnosticsToFix, shouldFixInProject, selectedEntriesOnly, isAddSuppression, isSuppressionInSource, onlyCompilerDiagnostics, showPreviewChangesDialog);
}
diff --git a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs
index e4b5cd92fbbcc..973987c5a0764 100644
--- a/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs
+++ b/src/VisualStudio/Core/Def/TaskList/ExternalErrorDiagnosticUpdateSource.cs
@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
+using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq;
using System.Threading;
@@ -13,32 +14,34 @@
using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
-using Microsoft.CodeAnalysis.Internal.Log;
-using Microsoft.CodeAnalysis.Notification;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServer;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Collections;
using Microsoft.CodeAnalysis.Shared.TestHooks;
-using Microsoft.CodeAnalysis.SolutionCrawler;
+using Microsoft.ServiceHub.Framework;
+using Microsoft.VisualStudio.RpcContracts.DiagnosticManagement;
+using Microsoft.VisualStudio.RpcContracts.Utilities;
+using Microsoft.VisualStudio.Shell.ServiceBroker;
using Roslyn.Utilities;
+using static Microsoft.ServiceHub.Framework.ServiceBrokerClient;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.TaskList;
-
///
/// Diagnostic source for warnings and errors reported from explicit build command invocations in Visual Studio.
/// VS workspaces calls into us when a build is invoked or completed in Visual Studio.
/// calls into us to clear reported diagnostics or to report new diagnostics during the build.
/// For each of these callbacks, we create/capture the current and
/// schedule updating/processing this state on a serialized in the background.
-/// The processing phase de-dupes the diagnostics reported from build and intellisense to ensure that the error list does not contain duplicate diagnostics.
-/// It raises events about diagnostic updates, which eventually trigger the "Build + Intellisense" and "Build only" error list diagnostic
-/// sources to update the reported diagnostics.
///
+[Export(typeof(ExternalErrorDiagnosticUpdateSource))]
internal sealed class ExternalErrorDiagnosticUpdateSource : IDisposable
{
private readonly Workspace _workspace;
private readonly IDiagnosticAnalyzerService _diagnosticService;
- private readonly IBuildOnlyDiagnosticsService _buildOnlyDiagnosticsService;
- private readonly IGlobalOperationNotificationService _notificationService;
+ private readonly IAsynchronousOperationListener _listener;
+ private readonly CancellationToken _disposalToken;
+ private readonly IServiceBroker _serviceBroker;
///
/// Task queue to serialize all the work for errors reported by build.
@@ -47,78 +50,57 @@ internal sealed class ExternalErrorDiagnosticUpdateSource : IDisposable
///
private readonly AsyncBatchingWorkQueue> _taskQueue;
+ ///
+ /// Holds onto the diagnostic manager service as long as this is alive.
+ /// This is important as when the manager service is disposed, the VS client will clear diagnostics from it.
+ /// Serial access is guaranteed by the
+ ///
+ private IDiagnosticManagerService? _diagnosticManagerService;
+
// Gate for concurrent access and fields guarded with this gate.
private readonly object _gate = new();
private InProgressState? _stateDoNotAccessDirectly;
- private readonly CancellationSeries _activeCancellationSeriesDoNotAccessDirectly;
-
- ///
- /// Latest diagnostics reported during current or last build.
- /// These are not the de-duped build/live diagnostics, but the actual diagnostics from build.
- /// They are directly used by the "Build only" error list setting.
- ///
- private ImmutableArray _lastBuiltResult = ImmutableArray.Empty;
+ [ImportingConstructor]
+ [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public ExternalErrorDiagnosticUpdateSource(
VisualStudioWorkspace workspace,
IDiagnosticAnalyzerService diagnosticService,
- IGlobalOperationNotificationService notificationService,
IAsynchronousOperationListenerProvider listenerProvider,
+ [Import(typeof(SVsFullAccessServiceBroker))] IServiceBroker serviceBroker,
IThreadingContext threadingContext)
- : this(workspace, diagnosticService, notificationService, listenerProvider.GetListener(FeatureAttribute.ErrorList), threadingContext.DisposalToken)
{
- }
+ _disposalToken = threadingContext.DisposalToken;
+ _workspace = workspace;
+ _diagnosticService = diagnosticService;
+ _listener = listenerProvider.GetListener(FeatureAttribute.ErrorList);
- ///
- /// internal for testing
- ///
- internal ExternalErrorDiagnosticUpdateSource(
- Workspace workspace,
- IDiagnosticAnalyzerService diagnosticService,
- IGlobalOperationNotificationService notificationService,
- IAsynchronousOperationListener listener,
- CancellationToken disposalToken)
- {
- // use queue to serialize work. no lock needed
+ _serviceBroker = serviceBroker;
_taskQueue = new AsyncBatchingWorkQueue>(
TimeSpan.Zero,
- ProcessTaskQueueItemsAsync,
- listener,
- disposalToken);
- _activeCancellationSeriesDoNotAccessDirectly = new(disposalToken);
-
- _workspace = workspace;
- _workspace.WorkspaceChanged += OnWorkspaceChanged;
-
- _diagnosticService = diagnosticService;
- _buildOnlyDiagnosticsService = _workspace.Services.GetRequiredService();
+ processBatchAsync: ProcessTaskQueueItemsAsync,
+ _listener,
+ _disposalToken
+ );
+ }
- _notificationService = notificationService;
+ private async ValueTask ProcessTaskQueueItemsAsync(ImmutableSegmentedList> list, CancellationToken cancellationToken)
+ {
+ foreach (var workItem in list)
+ await workItem(cancellationToken).ConfigureAwait(false);
}
public DiagnosticAnalyzerInfoCache AnalyzerInfoCache => _diagnosticService.AnalyzerInfoCache;
- ///
- /// Indicates if a build is currently in progress inside Visual Studio.
- ///
- public bool IsInProgress => GetBuildInProgressState() != null;
-
public void Dispose()
{
lock (_gate)
{
- _activeCancellationSeriesDoNotAccessDirectly.Dispose();
+ // Only called when the MEF catalog is disposed on shutdown.
+ _diagnosticManagerService?.Dispose();
}
}
- ///
- /// Get the latest diagnostics reported during current or last build.
- /// These are not the de-duped build/live diagnostics, but the actual diagnostics from build.
- /// They are directly used by the "Build only" error list setting.
- ///
- public ImmutableArray GetBuildErrors()
- => _lastBuiltResult;
-
///
/// Returns true if the given represents an analyzer diagnostic ID that could be reported
/// for the given during the current build in progress.
@@ -127,342 +109,168 @@ public ImmutableArray GetBuildErrors()
public bool IsSupportedDiagnosticId(ProjectId projectId, string id)
=> GetBuildInProgressState()?.IsSupportedDiagnosticId(projectId, id) ?? false;
- private void OnBuildProgressChanged(InProgressState? state)
+ public void ClearErrors(ProjectId projectId)
{
- if (state != null)
+ // Clear the previous errors associated with the project.
+ _taskQueue.AddWork(async cancellationToken =>
{
- _lastBuiltResult = state.GetBuildErrors();
- }
+ await ClearPreviousAsync(projectId: projectId, cancellationToken).ConfigureAwait(false);
+ });
}
- public void ClearErrors(ProjectId projectId)
+ ///
+ /// Called serially in response to the sln build UI context.
+ ///
+ internal void OnSolutionBuildStarted()
{
- // Capture state if it exists
- var state = GetBuildInProgressState();
+ _ = GetOrCreateInProgressState();
- // Update the state to clear diagnostics and raise corresponding diagnostic updated events
- // on a serialized task queue.
_taskQueue.AddWork(async cancellationToken =>
{
- if (state == null)
- {
- // TODO: Is it possible that ClearErrors can be invoked while the build is not in progress?
- // We fallback to current solution in the workspace and clear errors for the project.
- await ClearErrorsCoreAsync(projectId, _workspace.CurrentSolution, state, cancellationToken).ConfigureAwait(false);
- }
- else
- {
- if (state.CancellationToken.IsCancellationRequested)
- return;
-
- // We are going to clear the diagnostics for the current project.
- // Additionally, we clear errors for all projects that transitively depend on this project.
- // Otherwise, fixing errors in core projects in dependency chain will leave back stale diagnostics in dependent projects.
-
- // First check if we already cleared the diagnostics for this project when processing a referenced project.
- // If so, we don't need to clear diagnostics for it again.
- if (state.WereProjectErrorsCleared(projectId))
- return;
-
- var solution = state.Solution;
-
- await ClearErrorsCoreAsync(projectId, solution, state, cancellationToken).ConfigureAwait(false);
-
- var transitiveProjectIds = solution.GetProjectDependencyGraph().GetProjectsThatTransitivelyDependOnThisProject(projectId);
- foreach (var projectId in transitiveProjectIds)
- {
- if (state.WereProjectErrorsCleared(projectId))
- {
- continue;
- }
-
- await ClearErrorsCoreAsync(projectId, solution, state, cancellationToken).ConfigureAwait(false);
- }
- }
+ await ClearPreviousAsync(projectId: null, cancellationToken).ConfigureAwait(false);
});
-
- return;
-
- async Task ClearErrorsCoreAsync(ProjectId projectId, Solution solution, InProgressState? state, CancellationToken cancellationToken)
- {
- Debug.Assert(state == null || !state.WereProjectErrorsCleared(projectId));
-
- // Here, we clear the build and live errors for the project.
- // Additionally, we mark projects as having its errors cleared.
- // This ensures that we do not attempt to clear the diagnostics again for the same project
- // when 'ClearErrors' is invoked for multiple dependent projects.
- // Finally, we update build progress state so error list gets refreshed.
-
- using var argsBuilder = TemporaryArray.Empty;
-
- AddArgsToClearBuildOnlyProjectErrors(ref argsBuilder.AsRef(), solution, projectId);
- await ProcessAndRaiseDiagnosticsUpdatedAsync(argsBuilder.ToImmutableAndClear(), cancellationToken).ConfigureAwait(false);
- state?.MarkErrorsCleared(projectId);
-
- OnBuildProgressChanged(state);
- }
}
- private void OnWorkspaceChanged(object sender, WorkspaceChangeEventArgs e)
+ ///
+ /// Called serially in response to the sln build UI context completing.
+ ///
+ internal void OnSolutionBuildCompleted()
{
- // Clear relevant build-only errors on workspace events such as solution added/removed/reloaded,
- // project added/removed/reloaded, etc.
- switch (e.Kind)
- {
- case WorkspaceChangeKind.SolutionAdded:
- _taskQueue.AddWork(async cancellationToken =>
- {
- using var argsBuilder = TemporaryArray.Empty;
- foreach (var projectId in e.OldSolution.ProjectIds)
- {
- AddArgsToClearBuildOnlyProjectErrors(ref argsBuilder.AsRef(), e.OldSolution, projectId);
- }
-
- await ProcessAndRaiseDiagnosticsUpdatedAsync(argsBuilder.ToImmutableAndClear(), cancellationToken).ConfigureAwait(false);
- });
- break;
-
- case WorkspaceChangeKind.SolutionRemoved:
- case WorkspaceChangeKind.SolutionCleared:
- case WorkspaceChangeKind.SolutionReloaded:
- _taskQueue.AddWork(async cancellationToken =>
- {
- using var argsBuilder = TemporaryArray.Empty;
- foreach (var projectId in e.OldSolution.ProjectIds)
- {
- AddArgsToClearBuildOnlyProjectErrors(ref argsBuilder.AsRef(), e.OldSolution, projectId);
- }
-
- await ProcessAndRaiseDiagnosticsUpdatedAsync(argsBuilder.ToImmutableAndClear(), cancellationToken).ConfigureAwait(false);
- });
- break;
-
- case WorkspaceChangeKind.ProjectRemoved:
- case WorkspaceChangeKind.ProjectReloaded:
- _taskQueue.AddWork(async cancellationToken =>
- {
- using var argsBuilder = TemporaryArray.Empty;
- AddArgsToClearBuildOnlyProjectErrors(ref argsBuilder.AsRef(), e.OldSolution, e.ProjectId);
- await ProcessAndRaiseDiagnosticsUpdatedAsync(argsBuilder.ToImmutableAndClear(), cancellationToken).ConfigureAwait(false);
- });
- break;
-
- case WorkspaceChangeKind.DocumentRemoved:
- case WorkspaceChangeKind.DocumentReloaded:
- case WorkspaceChangeKind.AdditionalDocumentRemoved:
- case WorkspaceChangeKind.AdditionalDocumentReloaded:
- case WorkspaceChangeKind.AnalyzerConfigDocumentRemoved:
- case WorkspaceChangeKind.AnalyzerConfigDocumentReloaded:
- _taskQueue.AddWork(async cancellationToken =>
- {
- using var argsBuilder = TemporaryArray.Empty;
- AddArgsToClearBuildOnlyDocumentErrors(ref argsBuilder.AsRef(), e.OldSolution, e.ProjectId, e.DocumentId);
- await ProcessAndRaiseDiagnosticsUpdatedAsync(argsBuilder.ToImmutableAndClear(), cancellationToken).ConfigureAwait(false);
- });
- break;
-
- case WorkspaceChangeKind.DocumentChanged:
- case WorkspaceChangeKind.AnalyzerConfigDocumentChanged:
- case WorkspaceChangeKind.AdditionalDocumentChanged:
- // We clear build-only errors for the document on document edits.
- // This is done to address multiple customer reports of stale build-only diagnostics
- // after they fix/remove the code flagged from build-only diagnostics, but the diagnostics
- // do not get automatically removed/refreshed while typing.
- // See https://github.com/dotnet/docs/issues/26708 and https://github.com/dotnet/roslyn/issues/64659
- // for additional details.
- _taskQueue.AddWork(async cancellationToken =>
- {
- using var argsBuilder = TemporaryArray.Empty;
- AddArgsToClearBuildOnlyDocumentErrors(ref argsBuilder.AsRef(), e.OldSolution, e.ProjectId, e.DocumentId);
- await ProcessAndRaiseDiagnosticsUpdatedAsync(argsBuilder.ToImmutableAndClear(), cancellationToken).ConfigureAwait(false);
- });
- break;
-
- case WorkspaceChangeKind.ProjectAdded:
- case WorkspaceChangeKind.DocumentAdded:
- case WorkspaceChangeKind.ProjectChanged:
- case WorkspaceChangeKind.SolutionChanged:
- case WorkspaceChangeKind.AdditionalDocumentAdded:
- case WorkspaceChangeKind.AnalyzerConfigDocumentAdded:
- break;
-
- default:
- throw ExceptionUtilities.UnexpectedValue(e.Kind);
- }
+ _ = ClearInProgressState();
}
- internal void OnSolutionBuildStarted()
+ public void AddNewErrors(ProjectId projectId, Guid projectHierarchyGuid, ImmutableArray diagnostics)
{
- // Build just started, create the state and fire build in progress event.
- _ = GetOrCreateInProgressState();
- }
+ Debug.Assert(diagnostics.All(d => d.IsBuildDiagnostic()));
- internal void OnSolutionBuildCompleted()
- {
- // Building is done, so reset the state
- // and get local copy of in-progress state.
- var inProgressState = ClearInProgressState();
+ // Capture state that will be processed in background thread.
+ var state = GetOrCreateInProgressState();
- // Enqueue build/live sync in the queue.
_taskQueue.AddWork(async cancellationToken =>
{
- // nothing to do
- if (inProgressState == null)
- return;
-
- if (inProgressState.CancellationToken.IsCancellationRequested)
- return;
-
- // Mark the status as updated to refresh error list before we invoke 'SyncBuildErrorsAndReportAsync', which can take some time to complete.
- OnBuildProgressChanged(inProgressState);
-
- // We are about to update live analyzer data using one from build.
- // pause live analyzer
- using var operation = _notificationService.Start("BuildDone");
- if (_diagnosticService is DiagnosticAnalyzerService)
- await SyncBuildErrorsAndReportOnBuildCompletedAsync(inProgressState, cancellationToken).ConfigureAwait(false);
-
- // Mark build as complete.
- OnBuildProgressChanged(inProgressState);
+ await ProcessDiagnosticsReportAsync(projectId, projectHierarchyGuid, diagnostics, state, cancellationToken).ConfigureAwait(false);
});
}
- ///
- /// Core method that de-dupes live and build diagnostics at the completion of build.
- /// It raises diagnostic update events for both the Build-only diagnostics and Build + Intellisense diagnostics
- /// in the error list.
- ///
- private async Task SyncBuildErrorsAndReportOnBuildCompletedAsync(InProgressState inProgressState, CancellationToken cancellationToken)
+ private async Task ClearPreviousAsync(ProjectId? projectId, CancellationToken cancellationToken)
{
- // Allow the queue to be canceled, or this particular item to be canceled. Because we're creating a specialized
- // token here, we need to wrap with our own try/catch to make sure that token doesn't bubble out.
- using var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(inProgressState.CancellationToken, cancellationToken);
+ var diagnosticManagerService = await GetOrCreateDiagnosticManagerAsync(cancellationToken).ConfigureAwait(false);
- try
+ if (projectId is not null)
{
- await SyncBuildErrorsAndReportOnBuildCompletedWorkerAsync(inProgressState, linkedTokenSource.Token).ConfigureAwait(false);
+ await diagnosticManagerService.ClearDiagnosticsAsync(projectId.Id.ToString(), cancellationToken).ConfigureAwait(false);
}
- catch (OperationCanceledException ex) when (ExceptionUtilities.IsCurrentOperationBeingCancelled(ex, linkedTokenSource.Token))
+ else
{
+ await diagnosticManagerService.ClearAllDiagnosticsAsync(cancellationToken).ConfigureAwait(false);
}
+ }
- return;
+ private async ValueTask ProcessDiagnosticsReportAsync(ProjectId projectId, Guid projectHierarchyGuid, ImmutableArray diagnostics, InProgressState state, CancellationToken cancellationToken)
+ {
+ var diagnosticManagerService = await GetOrCreateDiagnosticManagerAsync(cancellationToken).ConfigureAwait(false);
- async Task SyncBuildErrorsAndReportOnBuildCompletedWorkerAsync(InProgressState inProgressState, CancellationToken cancellationToken)
+ using var _ = ArrayBuilder.GetInstance(out var collections);
+ // The client API asks us to pass in diagnostics grouped by the file they are in.
+ // Note - linked file diagnostics will be 'duplicated' for each project - the document collection
+ // will contain a separate diagnostic for each project the file is linked to (with the corresponding project field set).
+ var groupedDiagnostics = diagnostics.GroupBy(d => d.DataLocation.UnmappedFileSpan.Path);
+ foreach (var group in groupedDiagnostics)
{
- var solution = inProgressState.Solution;
- var allLiveErrors = inProgressState.GetLiveErrors();
+ var path = group.Key;
+ var pathAsUri = ProtocolConversions.CreateAbsoluteUri(path);
- // Raise events for build only errors
- using var argsBuilder = TemporaryArray.Empty;
- var buildErrors = GetBuildErrors().Except(allLiveErrors).GroupBy(k => k.DocumentId);
- foreach (var group in buildErrors)
+ var convertedDiagnostics = group.Select(d => CreateDiagnostic(projectId, projectHierarchyGuid, d, state.Solution)).ToImmutableArray();
+ if (convertedDiagnostics.Any())
{
- cancellationToken.ThrowIfCancellationRequested();
-
- if (group.Key == null)
- {
- foreach (var projectGroup in group.GroupBy(g => g.ProjectId))
- {
- Contract.ThrowIfNull(projectGroup.Key);
- argsBuilder.Add(CreateArgsToReportBuildErrors(projectGroup.Key, solution, projectGroup.ToImmutableArray()));
- }
-
- continue;
- }
-
- argsBuilder.Add(CreateArgsToReportBuildErrors(group.Key, solution, group.ToImmutableArray()));
+ var collection = new DiagnosticCollection(pathAsUri, documentVersionNumber: -1, diagnostics: convertedDiagnostics);
+ collections.Add(collection);
}
-
- await ProcessAndRaiseDiagnosticsUpdatedAsync(argsBuilder.ToImmutableAndClear(), cancellationToken).ConfigureAwait(false);
}
- }
- private static DiagnosticsUpdatedArgs CreateArgsToReportBuildErrors(T item, Solution solution, ImmutableArray buildErrors)
- {
- if (item is ProjectId projectId)
+ if (collections.Any())
{
- return CreateDiagnosticsCreatedArgs(solution, projectId, documentId: null, buildErrors);
+ // Report with projectId so we can clear individual project errors.
+ await diagnosticManagerService.AppendDiagnosticsAsync(projectId.Id.ToString(), collections.ToImmutable(), cancellationToken).ConfigureAwait(false);
}
-
- RoslynDebug.Assert(item is DocumentId);
- var documentId = (DocumentId)(object)item;
- return CreateDiagnosticsCreatedArgs(solution, documentId.ProjectId, documentId, buildErrors);
}
- private static void AddArgsToClearBuildOnlyProjectErrors(ref TemporaryArray builder, Solution solution, ProjectId? projectId)
+ private static Microsoft.VisualStudio.RpcContracts.DiagnosticManagement.Diagnostic? CreateDiagnostic(ProjectId projectId, Guid projectHierarchyGuid, DiagnosticData diagnostic, Solution solution)
{
- // Remove all project errors
- builder.Add(CreateDiagnosticsRemovedArgs(solution, projectId, documentId: null));
+ var project = GetProjectIdentifier(solution.GetProject(projectId), projectHierarchyGuid);
+ ImmutableArray projects = project is not null ? [project.Value] : [];
+
+ var range = GetRange(diagnostic);
+ var description = string.IsNullOrEmpty(diagnostic.Description) ? null : diagnostic.Description;
+ return new Microsoft.VisualStudio.RpcContracts.DiagnosticManagement.Diagnostic(
+ message: diagnostic.Message ?? string.Empty,
+ code: diagnostic.Id,
+ severity: GetSeverity(diagnostic.Severity),
+ range: GetRange(diagnostic),
+ tags: RpcContracts.DiagnosticManagement.DiagnosticTags.BuildError,
+ relatedInformation: null,
+ expandedMessage: description,
+ // Intentionally the same as diagnosticType, matches what we used to report.
+ source: diagnostic.Category,
+ helpLink: diagnostic.HelpLink,
+ diagnosticType: diagnostic.Category,
+ projects: projects,
+ identifier: (diagnostic.Id, diagnostic.DataLocation.UnmappedFileSpan.Path, range, diagnostic.Message).GetHashCode().ToString(),
+ outputId: null);
+ }
- var project = solution.GetProject(projectId);
- if (project == null)
+ private static RpcContracts.Utilities.ProjectIdentifier? GetProjectIdentifier(Project? project, Guid projectHierarchyGuid)
+ {
+ if (project is null)
{
- return;
+ // It is possible (but unlikely) that the solution snapshot we saved at the start of the build
+ // does not contain the projectId against which the build is reporting diagnostics due to the inherent race in invoking build.
+ return null;
}
- // Remove all document errors
- foreach (var documentId in project.DocumentIds.Concat(project.AdditionalDocumentIds).Concat(project.AnalyzerConfigDocumentIds))
- {
- AddArgsToClearBuildOnlyDocumentErrors(ref builder, solution, projectId, documentId);
- }
+ return new RpcContracts.Utilities.ProjectIdentifier(
+ name: project.Name,
+ identifier: projectHierarchyGuid.ToString());
}
- private static void AddArgsToClearBuildOnlyDocumentErrors(ref TemporaryArray builder, Solution solution, ProjectId? projectId, DocumentId? documentId)
- => builder.Add(CreateDiagnosticsRemovedArgs(solution, projectId, documentId));
-
- public void AddNewErrors(ProjectId projectId, DiagnosticData diagnostic)
+ private static RpcContracts.DiagnosticManagement.DiagnosticSeverity GetSeverity(CodeAnalysis.DiagnosticSeverity severity)
{
- Debug.Assert(diagnostic.IsBuildDiagnostic());
-
- // Capture state that will be processed in background thread.
- var state = GetOrCreateInProgressState();
-
- _taskQueue.AddWork(cancellationToken =>
- {
- if (!state.CancellationToken.IsCancellationRequested)
- state.AddError(projectId, diagnostic);
-
- return Task.CompletedTask;
- });
+ return severity switch
+ {
+ CodeAnalysis.DiagnosticSeverity.Hidden => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Hint,
+ CodeAnalysis.DiagnosticSeverity.Info => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Information,
+ CodeAnalysis.DiagnosticSeverity.Warning => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Warning,
+ CodeAnalysis.DiagnosticSeverity.Error => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Error,
+ _ => throw ExceptionUtilities.UnexpectedValue(severity),
+ };
}
- public void AddNewErrors(DocumentId documentId, DiagnosticData diagnostic)
+ private static RpcContracts.Utilities.Range GetRange(DiagnosticData diagnostic)
{
- Debug.Assert(diagnostic.IsBuildDiagnostic());
-
- // Capture state that will be processed in background thread.
- var state = GetOrCreateInProgressState();
-
- _taskQueue.AddWork(cancellationToken =>
- {
- if (!state.CancellationToken.IsCancellationRequested)
- state.AddError(documentId, diagnostic);
-
- return Task.CompletedTask;
- });
+ // Caller always created DiagnosticData with unmapped information.
+ var startPosition = diagnostic.DataLocation.UnmappedFileSpan.StartLinePosition;
+ var endPosition = diagnostic.DataLocation.UnmappedFileSpan.EndLinePosition;
+ return new RpcContracts.Utilities.Range(startPosition.Line, startPosition.Character, endPosition.Line, endPosition.Character);
}
- public void AddNewErrors(
- ProjectId projectId, HashSet projectErrors, Dictionary> documentErrorMap)
+ ///
+ /// Creates or gets the existing
+ /// It is important that this is created only once as the client will remove our errors
+ /// when the instance of the brokered service is disposed of.
+ ///
+ /// Serial access to this is guaranteed as all calls run inside the
+ ///
+ private async Task GetOrCreateDiagnosticManagerAsync(CancellationToken cancellationToken)
{
- Debug.Assert(projectErrors.All(d => d.IsBuildDiagnostic()));
- Debug.Assert(documentErrorMap.SelectMany(kvp => kvp.Value).All(d => d.IsBuildDiagnostic()));
-
- // Capture state that will be processed in background thread
- var state = GetOrCreateInProgressState();
-
- _taskQueue.AddWork(cancellationToken =>
+ if (_diagnosticManagerService == null)
{
- if (state.CancellationToken.IsCancellationRequested)
- return Task.CompletedTask;
-
- foreach (var kv in documentErrorMap)
- state.AddErrors(kv.Key, kv.Value);
+ _diagnosticManagerService = await _serviceBroker.GetProxyAsync(
+ VisualStudioServices.VS2019_7.DiagnosticManagerService,
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+ Contract.ThrowIfNull(_diagnosticManagerService, $"Unable to acquire {nameof(IDiagnosticManagerService)}");
+ }
- state.AddErrors(projectId, projectErrors);
- return Task.CompletedTask;
- });
+ return _diagnosticManagerService;
}
private InProgressState? GetBuildInProgressState()
@@ -493,64 +301,13 @@ private InProgressState GetOrCreateInProgressState()
// We take current snapshot of solution when the state is first created. and through out this code, we use this snapshot.
// Since we have no idea what actual snapshot of solution the out of proc build has picked up, it doesn't remove the race we can have
// between build and diagnostic service, but this at least make us to consistent inside of our code.
- _stateDoNotAccessDirectly = new InProgressState(this, _workspace.CurrentSolution, _activeCancellationSeriesDoNotAccessDirectly.CreateNext());
- OnBuildProgressChanged(_stateDoNotAccessDirectly);
+ _stateDoNotAccessDirectly = new InProgressState(this, _workspace.CurrentSolution);
}
return _stateDoNotAccessDirectly;
}
}
- private static DiagnosticsUpdatedArgs CreateDiagnosticsCreatedArgs(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableArray items)
- {
- return DiagnosticsUpdatedArgs.DiagnosticsCreated(solution, projectId, documentId, items);
- }
-
- private static DiagnosticsUpdatedArgs CreateDiagnosticsRemovedArgs(Solution solution, ProjectId? projectId, DocumentId? documentId)
- {
- return DiagnosticsUpdatedArgs.DiagnosticsRemoved(solution, projectId, documentId);
- }
-
- private async Task ProcessAndRaiseDiagnosticsUpdatedAsync(
- ImmutableArray argsCollection,
- CancellationToken cancellationToken)
- {
- if (argsCollection.IsEmpty)
- return;
-
- foreach (var args in argsCollection)
- {
- if (args.Kind == DiagnosticsUpdatedKind.DiagnosticsCreated)
- {
- Contract.ThrowIfNull(args.Solution);
- if (args.DocumentId != null)
- await _buildOnlyDiagnosticsService.AddBuildOnlyDiagnosticsAsync(args.DocumentId, args.Diagnostics, cancellationToken).ConfigureAwait(false);
- }
- else if (args.Kind == DiagnosticsUpdatedKind.DiagnosticsRemoved)
- {
- Contract.ThrowIfNull(args.Solution);
- var project = args.Solution.GetProject(args.ProjectId);
- if (project != null)
- await _buildOnlyDiagnosticsService.ClearBuildOnlyDiagnosticsAsync(project, args.DocumentId, cancellationToken).ConfigureAwait(false);
- }
- }
- }
-
- private async ValueTask ProcessTaskQueueItemsAsync(ImmutableSegmentedList> list, CancellationToken cancellationToken)
- {
- foreach (var workItem in list)
- await workItem(cancellationToken).ConfigureAwait(false);
- }
-
- internal TestAccessor GetTestAccessor()
- => new(this);
-
- internal readonly struct TestAccessor(ExternalErrorDiagnosticUpdateSource instance)
- {
- internal void OnWorkspaceChanged(object sender, WorkspaceChangeEventArgs e)
- => instance.OnWorkspaceChanged(sender, e);
- }
-
private sealed class InProgressState
{
private readonly ExternalErrorDiagnosticUpdateSource _owner;
@@ -563,64 +320,16 @@ private sealed class InProgressState
///
private readonly Dictionary> _allDiagnosticIdMap = [];
- ///
- /// Map from project ID to all the possible intellisense analyzer diagnostic IDs that can be reported in the project.
- /// A diagnostic is considered to be an intellise analyzer diagnostic if is reported from a non-compilation end action in an analyzer,
- /// i.e. we do not require to analyze the entire compilation to compute these diagnostics.
- /// Compilation end diagnostics are considered build-only diagnostics.
- ///
- ///
- /// This map may be accessed concurrently, so needs to ensure thread safety by using locks.
- ///
- private readonly Dictionary> _liveDiagnosticIdMap = [];
-
- // Fields that are used only from APIs invoked from serialized task queue, hence don't need to be thread safe.
- #region Serialized fields
-
- ///
- /// Map from project ID to a dictionary of reported project level diagnostics to an integral counter.
- /// Project level diagnostics are diagnostics that have no document location, i.e. reported with .
- /// Integral counter value for each diagnostic is used to order the reported diagnostics in error list
- /// based on the order in which they were reported during build.
- ///
- private readonly Dictionary> _projectMap = [];
-
- ///
- /// Map from document ID to a dictionary of reported document level diagnostics to an integral counter.
- /// Project level diagnostics are diagnostics that have a valid document location, i.e. reported with a location within a syntax tree.
- /// Integral counter value for each diagnostic is used to order the reported diagnostics in error list
- /// based on the order in which they were reported during build.
- ///
- private readonly Dictionary> _documentMap = [];
-
- ///
- /// Set of projects for which we have already cleared the build and intellisense diagnostics in the error list.
- ///
- private readonly HashSet _projectsWithErrorsCleared = [];
-
- ///
- /// Set of projects which have at least one project or document diagnostic in
- /// and/or .
- ///
- private readonly HashSet _projectsWithErrors = [];
-
- ///
- /// Counter to help order the diagnostics in error list based on the order in which they were reported during build.
- ///
- private int _incrementDoNotAccessDirectly;
-
- #endregion
-
- public InProgressState(ExternalErrorDiagnosticUpdateSource owner, Solution solution, CancellationToken cancellationToken)
+ public InProgressState(ExternalErrorDiagnosticUpdateSource owner, Solution solution)
{
_owner = owner;
Solution = solution;
- CancellationToken = cancellationToken;
}
public Solution Solution { get; }
- public CancellationToken CancellationToken { get; }
+ public bool IsSupportedDiagnosticId(ProjectId projectId, string id)
+ => GetOrCreateSupportedDiagnosticIds(projectId).Contains(id);
private static ImmutableHashSet GetOrCreateDiagnosticIds(
ProjectId projectId,
@@ -644,9 +353,6 @@ private static ImmutableHashSet GetOrCreateDiagnosticIds(
}
}
- public bool IsSupportedDiagnosticId(ProjectId projectId, string id)
- => GetOrCreateSupportedDiagnosticIds(projectId).Contains(id);
-
private ImmutableHashSet GetOrCreateSupportedDiagnosticIds(ProjectId projectId)
{
return GetOrCreateDiagnosticIds(projectId, _allDiagnosticIdMap, ComputeSupportedDiagnosticIds);
@@ -662,273 +368,11 @@ ImmutableHashSet ComputeSupportedDiagnosticIds()
// set ids set
var builder = ImmutableHashSet.CreateBuilder();
- var descriptorMap = Solution.SolutionState.Analyzers.GetDiagnosticDescriptorsPerReference(_owner._diagnosticService.AnalyzerInfoCache, project);
+ var descriptorMap = Solution.SolutionState.Analyzers.GetDiagnosticDescriptorsPerReference(_owner.AnalyzerInfoCache, project);
builder.UnionWith(descriptorMap.Values.SelectMany(v => v.Select(d => d.Id)));
return builder.ToImmutable();
}
}
-
- public ImmutableArray GetBuildErrors()
- {
- // return errors in the order that is reported
- return ImmutableArray.CreateRange(
- _projectMap.Values.SelectMany(d => d).Concat(_documentMap.Values.SelectMany(d => d)).OrderBy(kv => kv.Value).Select(kv => kv.Key));
- }
-
- public void MarkErrorsCleared(ProjectId projectId)
- {
- var added = _projectsWithErrorsCleared.Add(projectId);
- Debug.Assert(added);
- }
-
- public bool WereProjectErrorsCleared(ProjectId projectId)
- => _projectsWithErrorsCleared.Contains(projectId);
-
- public ImmutableArray GetLiveErrors()
- {
- var allLiveErrorsBuilder = ImmutableArray.CreateBuilder();
- foreach (var projectId in GetProjectsWithErrors())
- {
- CancellationToken.ThrowIfCancellationRequested();
-
- var errors = GetLiveErrorsForProject(projectId);
- allLiveErrorsBuilder.AddRange(errors);
- }
-
- return allLiveErrorsBuilder.ToImmutableAndClear();
-
- // Local functions.
- IEnumerable GetProjectsWithErrors()
- {
- // Filter out project that is no longer exist in IDE
- // this can happen if user started a "build" and then remove a project from IDE
- // before build finishes
- return _projectsWithErrors.Where(p => Solution.GetProject(p) != null);
- }
- }
-
- public ImmutableArray GetLiveErrorsForProject(ProjectId projectId)
- {
- var project = Solution.GetProject(projectId);
- if (project == null)
- {
- return ImmutableArray.Empty;
- }
-
- var diagnostics = _projectMap.Where(kv => kv.Key == projectId).SelectMany(kv => kv.Value).Concat(
- _documentMap.Where(kv => kv.Key.ProjectId == projectId).SelectMany(kv => kv.Value));
- using var _ = ArrayBuilder.GetInstance(out var builder);
- foreach (var (diagnostic, _) in diagnostics)
- {
- if (IsLive(project, diagnostic))
- {
- builder.Add(diagnostic);
- }
- }
-
- return builder.ToImmutableAndClear();
- }
-
- public void AddErrors(DocumentId key, HashSet diagnostics)
- => AddErrors(_documentMap, key, diagnostics);
-
- public void AddErrors(ProjectId key, HashSet diagnostics)
- => AddErrors(_projectMap, key, diagnostics);
-
- public void AddError(DocumentId key, DiagnosticData diagnostic)
- => AddError(_documentMap, key, diagnostic);
-
- public void AddError(ProjectId key, DiagnosticData diagnostic)
- => AddError(_projectMap, key, diagnostic);
-
- private bool IsLive(Project project, DiagnosticData diagnosticData)
- {
- // REVIEW: current design is that we special case compiler analyzer case and we accept only document level
- // diagnostic as live. otherwise, we let them be build errors. we changed compiler analyzer accordingly as well
- // so that it doesn't report project level diagnostic as live errors.
- if (!IsDocumentLevelDiagnostic(diagnosticData) &&
- diagnosticData.CustomTags.Contains(WellKnownDiagnosticTags.Compiler))
- {
- // compiler error but project level error
- return false;
- }
-
- // Compiler diagnostics reported on additional documents indicate mapped diagnostics, such as compiler diagnostics
- // in razor files which are actually reported on generated source files but mapped to razor files during build.
- // These are not reported on additional files during live analysis, and can be considered to be build-only diagnostics.
- if (IsAdditionalDocumentDiagnostic(project, diagnosticData) &&
- diagnosticData.CustomTags.Contains(WellKnownDiagnosticTags.Compiler))
- {
- return false;
- }
-
- if (IsSupportedLiveDiagnosticId(project, diagnosticData.Id))
- {
- return true;
- }
-
- return false;
-
- static bool IsDocumentLevelDiagnostic(DiagnosticData diagnosticData)
- {
- if (diagnosticData.DocumentId != null)
- {
- return true;
- }
-
- // due to mapped file such as
- //
- // A.cs having
- // #line 2 RandomeFile.txt
- // ErrorHere
- // #line default
- //
- // we can't simply say it is not document level diagnostic since
- // file path is not part of solution. build output will just tell us
- // mapped span not original span, so any code like above will not
- // part of solution.
- //
- // but also we can't simply say it is a document level error because it has file path
- // since project level error can have a file path pointing to a file such as dll
- // , pdb, embedded files and etc.
- //
- // unfortunately, there is no 100% correct way to do this.
- // so we will use a heuristic that will most likely work for most of common cases.
- return
- !string.IsNullOrEmpty(diagnosticData.DataLocation.UnmappedFileSpan.Path) &&
- (diagnosticData.DataLocation.UnmappedFileSpan.StartLinePosition.Line > 0 ||
- diagnosticData.DataLocation.UnmappedFileSpan.StartLinePosition.Character > 0);
- }
-
- static bool IsAdditionalDocumentDiagnostic(Project project, DiagnosticData diagnosticData)
- => diagnosticData.DocumentId != null && project.ContainsAdditionalDocument(diagnosticData.DocumentId);
- }
-
- private bool IsSupportedLiveDiagnosticId(Project project, string id)
- => GetOrCreateSupportedLiveDiagnostics(project).Contains(id);
-
- private ImmutableHashSet GetOrCreateSupportedLiveDiagnostics(Project project)
- {
- var fullSolutionAnalysis = _owner._diagnosticService.GlobalOptions.IsFullSolutionAnalysisEnabled(project.Language);
- if (!project.SupportsCompilation || fullSolutionAnalysis)
- {
- // Defer to _allDiagnosticIdMap so we avoid placing FSA diagnostics in _liveDiagnosticIdMap
- return GetOrCreateSupportedDiagnosticIds(project.Id);
- }
-
- return GetOrCreateDiagnosticIds(project.Id, _liveDiagnosticIdMap, ComputeSupportedLiveDiagnosticIds);
-
- ImmutableHashSet ComputeSupportedLiveDiagnosticIds()
- {
- // set ids set
- var builder = ImmutableHashSet.CreateBuilder();
- var infoCache = _owner._diagnosticService.AnalyzerInfoCache;
-
- foreach (var analyzersPerReference in project.Solution.SolutionState.Analyzers.CreateDiagnosticAnalyzersPerReference(project))
- {
- foreach (var analyzer in analyzersPerReference.Value)
- {
- var diagnosticIds = infoCache.GetNonCompilationEndDiagnosticDescriptors(analyzer).Select(d => d.Id);
- builder.UnionWith(diagnosticIds);
- }
- }
-
- return builder.ToImmutable();
- }
- }
-
- private void AddErrors(Dictionary> map, T key, HashSet diagnostics)
- where T : notnull
- {
- var errors = GetErrorSet(map, key);
- foreach (var diagnostic in diagnostics)
- {
- AddError(errors, diagnostic, key);
- }
- }
-
- private void AddError(Dictionary> map, T key, DiagnosticData diagnostic)
- where T : notnull
- {
- var errors = GetErrorSet(map, key);
- AddError(errors, diagnostic, key);
- }
-
- private void AddError(Dictionary errors, DiagnosticData diagnostic, T key)
- where T : notnull
- {
- RecordProjectContainsErrors();
-
- // add only new errors
- if (!errors.TryGetValue(diagnostic, out _))
- {
- Logger.Log(FunctionId.ExternalErrorDiagnosticUpdateSource_AddError, d => d.ToString(), diagnostic);
-
- errors.Add(diagnostic, _incrementDoNotAccessDirectly++);
- }
-
- return;
-
- void RecordProjectContainsErrors()
- {
- RoslynDebug.Assert(key is DocumentId or ProjectId);
- var projectId = (key is DocumentId documentId) ? documentId.ProjectId : (ProjectId)(object)key;
-
- if (!_projectsWithErrors.Add(projectId))
- return;
-
- _owner.OnBuildProgressChanged(this);
- }
- }
-
- private static Dictionary GetErrorSet(Dictionary> map, T key)
- where T : notnull
- => map.GetOrAdd(key, _ => new Dictionary(DiagnosticDataComparer.Instance));
- }
-
- private sealed class DiagnosticDataComparer : IEqualityComparer
- {
- public static readonly DiagnosticDataComparer Instance = new();
-
- public bool Equals(DiagnosticData item1, DiagnosticData item2)
- {
- if ((item1.DocumentId == null) != (item2.DocumentId == null) ||
- item1.Id != item2.Id ||
- item1.ProjectId != item2.ProjectId ||
- item1.Severity != item2.Severity ||
- item1.Message != item2.Message ||
- item1.DataLocation.MappedFileSpan.Span != item2.DataLocation.MappedFileSpan.Span ||
- item1.DataLocation.UnmappedFileSpan.Span != item2.DataLocation.UnmappedFileSpan.Span)
- {
- return false;
- }
-
- // TODO: unclear why we are comparing the original paths, and not the normalized paths. This may
- // indicate a bug. If it is correct behavior, this should be documented as to why this is the right span
- // to be considering.
- return (item1.DocumentId != null)
- ? item1.DocumentId == item2.DocumentId
- : item1.DataLocation.UnmappedFileSpan.Path == item2.DataLocation.UnmappedFileSpan.Path;
- }
-
- public int GetHashCode(DiagnosticData obj)
- {
- // TODO: unclear on why we're hashing the start of the data location, whereas .Equals above checks the
- // full span.
- var result =
- Hash.Combine(obj.Id,
- Hash.Combine(obj.Message,
- Hash.Combine(obj.ProjectId,
- Hash.Combine(obj.DataLocation.MappedFileSpan.Span.Start.GetHashCode(),
- Hash.Combine(obj.DataLocation.UnmappedFileSpan.Span.Start.GetHashCode(), (int)obj.Severity)))));
-
- // TODO: unclear why we are hashing the original path, and not the normalized path. This may
- // indicate a bug. If it is correct behavior, this should be documented as to why this is the right span
- // to be considering.
- return obj.DocumentId != null
- ? Hash.Combine(obj.DocumentId, result)
- : Hash.Combine(obj.DataLocation.UnmappedFileSpan.Path, result);
- }
}
}
diff --git a/src/VisualStudio/Core/Def/TaskList/ProjectExternalErrorReporter.cs b/src/VisualStudio/Core/Def/TaskList/ProjectExternalErrorReporter.cs
index 894b60f240034..6347f04d86a89 100644
--- a/src/VisualStudio/Core/Def/TaskList/ProjectExternalErrorReporter.cs
+++ b/src/VisualStudio/Core/Def/TaskList/ProjectExternalErrorReporter.cs
@@ -15,6 +15,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.ErrorReporting;
+using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem;
@@ -32,26 +33,26 @@ internal sealed class ProjectExternalErrorReporter : IVsReportExternalErrors, IV
internal static readonly ImmutableArray CompilerDiagnosticCustomTags = [WellKnownDiagnosticTags.Compiler, WellKnownDiagnosticTags.Telemetry];
private readonly ProjectId _projectId;
+
+ ///
+ /// Passed to the error reporting service to allow current project error list filters to work.
+ ///
+ private readonly Guid _projectHierarchyGuid;
private readonly string _errorCodePrefix;
private readonly string _language;
private readonly VisualStudioWorkspaceImpl _workspace;
- [Obsolete("This is a compatibility shim for F#; please do not use it.")]
- public ProjectExternalErrorReporter(ProjectId projectId, string errorCodePrefix, IServiceProvider serviceProvider)
- : this(projectId, errorCodePrefix, LanguageNames.FSharp, (VisualStudioWorkspaceImpl)serviceProvider.GetMefService())
- {
- }
-
private DiagnosticAnalyzerInfoCache AnalyzerInfoCache => _workspace.ExternalErrorDiagnosticUpdateSource.AnalyzerInfoCache;
- public ProjectExternalErrorReporter(ProjectId projectId, string errorCodePrefix, string language, VisualStudioWorkspaceImpl workspace)
+ public ProjectExternalErrorReporter(ProjectId projectId, Guid projectHierarchyGuid, string errorCodePrefix, string language, VisualStudioWorkspaceImpl workspace)
{
Debug.Assert(projectId != null);
Debug.Assert(errorCodePrefix != null);
Debug.Assert(workspace != null);
_projectId = projectId;
+ _projectHierarchyGuid = projectHierarchyGuid;
_errorCodePrefix = errorCodePrefix;
_language = language;
_workspace = workspace;
@@ -81,8 +82,7 @@ private bool CanHandle(string errorId)
public int AddNewErrors(IVsEnumExternalErrors pErrors)
{
- var projectErrors = new HashSet();
- var documentErrorsMap = new Dictionary>();
+ using var _ = ArrayBuilder.GetInstance(out var allDiagnostics);
var errors = new ExternalError[1];
var project = _workspace.CurrentSolution.GetProject(_projectId);
@@ -94,13 +94,12 @@ public int AddNewErrors(IVsEnumExternalErrors pErrors)
var diagnostic = TryCreateDocumentDiagnosticItem(error);
if (diagnostic != null)
{
- var diagnostics = documentErrorsMap.GetOrAdd(diagnostic.DocumentId, _ => new HashSet());
- diagnostics.Add(diagnostic);
+ allDiagnostics.Add(diagnostic);
continue;
}
}
- projectErrors.Add(GetDiagnosticData(
+ allDiagnostics.Add(GetDiagnosticData(
documentId: null,
_projectId,
_workspace,
@@ -112,7 +111,7 @@ public int AddNewErrors(IVsEnumExternalErrors pErrors)
AnalyzerInfoCache));
}
- DiagnosticProvider.AddNewErrors(_projectId, projectErrors, documentErrorsMap);
+ DiagnosticProvider.AddNewErrors(_projectId, _projectHierarchyGuid, allDiagnostics.ToImmutableAndClear());
return VSConstants.S_OK;
}
@@ -251,14 +250,7 @@ public void ReportError2(string bstrErrorMessage, string bstrErrorId, [ComAliasN
new LinePosition(iEndLine, iEndColumn)),
AnalyzerInfoCache);
- if (documentId == null)
- {
- DiagnosticProvider.AddNewErrors(_projectId, diagnostic);
- }
- else
- {
- DiagnosticProvider.AddNewErrors(documentId, diagnostic);
- }
+ DiagnosticProvider.AddNewErrors(_projectId, _projectHierarchyGuid, [diagnostic]);
}
public int ClearErrors()
diff --git a/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs b/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs
index 8828b7ec98de2..0a36ebeb63eb5 100644
--- a/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs
+++ b/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs
@@ -81,7 +81,7 @@ public CPSProject(ProjectSystemProject projectSystemProject, VisualStudioWorkspa
_ => null
};
- return (prefix != null) ? new ProjectExternalErrorReporter(projectSystemProject.Id, prefix, projectSystemProject.Language, visualStudioWorkspace) : null;
+ return (prefix != null) ? new ProjectExternalErrorReporter(projectSystemProject.Id, projectGuid, prefix, projectSystemProject.Language, visualStudioWorkspace) : null;
});
_projectCodeModel = projectCodeModelFactory.CreateProjectCodeModel(projectSystemProject.Id, new CPSCodeModelInstanceFactory(this));
diff --git a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb
index e1043f50cf333..eb6f8d52ac77d 100644
--- a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb
+++ b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb
@@ -3,45 +3,46 @@
' See the LICENSE file in the project root for more information.
Imports System.Collections.Immutable
+Imports System.ComponentModel.Composition
+Imports System.IO.Pipelines
Imports System.Threading
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.CodeActions
Imports Microsoft.CodeAnalysis.CommonDiagnosticAnalyzers
Imports Microsoft.CodeAnalysis.Diagnostics
+Imports Microsoft.CodeAnalysis.Editor.[Shared].Utilities
Imports Microsoft.CodeAnalysis.Editor.UnitTests
-Imports Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
-Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
-Imports Microsoft.CodeAnalysis.Notification
+Imports Microsoft.CodeAnalysis.Host.Mef
Imports Microsoft.CodeAnalysis.Options
-Imports Microsoft.CodeAnalysis.PooledObjects
Imports Microsoft.CodeAnalysis.Shared.TestHooks
-Imports Microsoft.CodeAnalysis.SolutionCrawler
Imports Microsoft.CodeAnalysis.Test.Utilities
Imports Microsoft.CodeAnalysis.Text
+Imports Microsoft.ServiceHub.Framework
+Imports Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel
Imports Microsoft.VisualStudio.LanguageServices.Implementation.TaskList
+Imports Microsoft.VisualStudio.LanguageServices.UnitTests.CodeModel.Mocks
+Imports Microsoft.VisualStudio.RpcContracts.DiagnosticManagement
+Imports Microsoft.VisualStudio.Shell.ServiceBroker
Imports Roslyn.Test.Utilities
Imports Roslyn.Utilities
Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
<[UseExportProvider]>
Public Class ExternalDiagnosticUpdateSourceTests
- Private Shared ReadOnly s_compositionWithMockDiagnosticUpdateSourceRegistrationService As TestComposition = EditorTestCompositions.EditorFeatures
-
-
- Public Sub TestExternalDiagnostics_SupportGetDiagnostics()
- Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty)
- Dim waiter = New AsynchronousOperationListener()
- Dim service = New TestDiagnosticAnalyzerService(workspace.GlobalOptions)
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
- End Using
- End Using
- End Sub
-
-
- Public Sub TestExternalDiagnostics_SupportedId()
- Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty)
- Dim waiter = New AsynchronousOperationListener()
+ Private Shared ReadOnly s_composition As TestComposition = VisualStudioTestCompositions.LanguageServices.AddParts(
+ GetType(TestServiceBroker),
+ GetType(MockServiceProvider),
+ GetType(StubVsServiceExporter(Of )),
+ GetType(StubVsServiceExporter(Of ,)),
+ GetType(MockVisualStudioWorkspace),
+ GetType(ProjectCodeModelFactory))
+
+ Private Shared ReadOnly s_projectGuid As Guid = Guid.NewGuid()
+
+
+ Public Async Function TestExternalDiagnostics_SupportedId() As Task
+ Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
+ Dim waiter = workspace.GetService(Of AsynchronousOperationListenerProvider)().GetWaiter(FeatureAttribute.ErrorList)
Dim analyzer = New AnalyzerForErrorLogTest()
Dim analyzerReference = New TestAnalyzerReferenceByLanguage(
@@ -49,248 +50,177 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference}))
+ Dim threadingContext = workspace.ExportProvider.GetExport(Of IThreadingContext).Value
+
Dim service = New TestDiagnosticAnalyzerService(workspace.GlobalOptions)
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
+ Dim vsWorkspace = workspace.ExportProvider.GetExportedValue(Of MockVisualStudioWorkspace)()
+ vsWorkspace.SetWorkspace(workspace)
+ Using source = workspace.ExportProvider.GetExportedValue(Of ExternalErrorDiagnosticUpdateSource)()
Dim project = workspace.CurrentSolution.Projects.First()
source.OnSolutionBuildStarted()
+ Await waiter.ExpeditedWaitAsync()
Assert.True(source.IsSupportedDiagnosticId(project.Id, "ID1"))
Assert.False(source.IsSupportedDiagnosticId(project.Id, "CA1002"))
End Using
End Using
- End Sub
+ End Function
-
- Public Sub TestExternalDiagnostics_SupportedDiagnosticId_Concurrent()
- Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty)
- Dim waiter = New AsynchronousOperationListener()
+
+ Public Async Function TestExternalDiagnostics_SupportedDiagnosticId_Concurrent() As Task
+ Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
+ Dim waiter = workspace.GetService(Of AsynchronousOperationListenerProvider)().GetWaiter(FeatureAttribute.ErrorList)
Dim service = New TestDiagnosticAnalyzerService(workspace.GlobalOptions)
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
+ Dim vsWorkspace = workspace.ExportProvider.GetExportedValue(Of MockVisualStudioWorkspace)()
+ vsWorkspace.SetWorkspace(workspace)
+ Using source = workspace.ExportProvider.GetExportedValue(Of ExternalErrorDiagnosticUpdateSource)()
Dim project = workspace.CurrentSolution.Projects.First()
source.OnSolutionBuildStarted()
+ Await waiter.ExpeditedWaitAsync()
Parallel.For(0, 100, Sub(i As Integer) source.IsSupportedDiagnosticId(project.Id, "CS1002"))
End Using
End Using
- End Sub
-
-
- Public Async Function TestExternalDiagnostics_DuplicatedError() As Task
- Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty)
- Dim globalOptions = workspace.GetService(Of IGlobalOptionService)
- Dim waiter = New AsynchronousOperationListener()
-
- Dim project = workspace.CurrentSolution.Projects.First()
- Dim diagnostic = GetDiagnosticData(project.Id)
+ End Function
- Dim service = New TestDiagnosticAnalyzerService(globalOptions, ImmutableArray.Create(diagnostic))
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
+
+ Public Sub TestExternalDiagnostics_SupportedIdFalseIfBuildNotStarted()
+ Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
+ Dim waiter = workspace.GetService(Of AsynchronousOperationListenerProvider)().GetWaiter(FeatureAttribute.ErrorList)
+ Dim analyzer = New AnalyzerForErrorLogTest()
- Dim map = New Dictionary(Of DocumentId, HashSet(Of DiagnosticData))()
- map.Add(project.DocumentIds.First(), New HashSet(Of DiagnosticData)(
- SpecializedCollections.SingletonEnumerable(GetDiagnosticData(project.Id))))
+ Dim analyzerReference = New TestAnalyzerReferenceByLanguage(
+ ImmutableDictionary(Of String, ImmutableArray(Of DiagnosticAnalyzer)).Empty.Add(LanguageNames.CSharp, ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)))
- source.AddNewErrors(project.Id, New HashSet(Of DiagnosticData)(SpecializedCollections.SingletonEnumerable(diagnostic)), map)
+ workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference}))
- source.OnSolutionBuildCompleted()
+ Dim threadingContext = workspace.ExportProvider.GetExport(Of IThreadingContext).Value
- Await waiter.ExpeditedWaitAsync()
+ Dim service = New TestDiagnosticAnalyzerService(workspace.GlobalOptions)
+ Dim vsWorkspace = workspace.ExportProvider.GetExportedValue(Of MockVisualStudioWorkspace)()
+ vsWorkspace.SetWorkspace(workspace)
+ Using source = workspace.ExportProvider.GetExportedValue(Of ExternalErrorDiagnosticUpdateSource)()
- Dim buildOnlyDiagnosticService = workspace.Services.GetRequiredService(Of IBuildOnlyDiagnosticsService)
- Assert.Empty(Await buildOnlyDiagnosticService.GetBuildOnlyDiagnosticsAsync(project.DocumentIds.First(), CancellationToken.None))
+ Dim project = workspace.CurrentSolution.Projects.First()
- Dim diagnostics = source.GetBuildErrors()
- Assert.Equal(2, diagnostics.Length)
+ Assert.False(source.IsSupportedDiagnosticId(project.Id, "ID1"))
+ Assert.False(source.IsSupportedDiagnosticId(project.Id, "CA1002"))
End Using
End Using
- End Function
+ End Sub
-
- Public Async Function TestBuildStartEvent() As Task
- Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty)
- Dim waiter = New AsynchronousOperationListener()
+
+ Public Async Function TestExternalDiagnosticsReported() As Task
+ Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
+ Dim waiter = workspace.GetService(Of AsynchronousOperationListenerProvider)().GetWaiter(FeatureAttribute.ErrorList)
Dim project = workspace.CurrentSolution.Projects.First()
Dim diagnostic = GetDiagnosticData(project.Id)
Dim service = New TestDiagnosticAnalyzerService(workspace.GlobalOptions)
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
-
- Dim map = New Dictionary(Of DocumentId, HashSet(Of DiagnosticData))()
- map.Add(project.DocumentIds.First(), New HashSet(Of DiagnosticData)(
- SpecializedCollections.SingletonEnumerable(GetDiagnosticData(project.Id))))
+ Dim threadingContext = workspace.ExportProvider.GetExportedValue(Of IThreadingContext)
+ Dim testServiceBroker = workspace.ExportProvider.GetExportedValue(Of TestServiceBroker)
+ Dim vsWorkspace = workspace.ExportProvider.GetExportedValue(Of MockVisualStudioWorkspace)()
+ vsWorkspace.SetWorkspace(workspace)
+ Using source = workspace.ExportProvider.GetExportedValue(Of ExternalErrorDiagnosticUpdateSource)()
- source.AddNewErrors(project.Id, New HashSet(Of DiagnosticData)(SpecializedCollections.SingletonEnumerable(diagnostic)), map)
+ source.OnSolutionBuildStarted()
Await waiter.ExpeditedWaitAsync()
+ Assert.True(testServiceBroker.DiagnosticManagerService.AllDiagnosticsCleared)
+ Dim diagnostics = {diagnostic, GetDiagnosticData(project.Id)}.ToImmutableArray()
+
+ source.AddNewErrors(project.Id, s_projectGuid, diagnostics)
source.OnSolutionBuildCompleted()
Await waiter.ExpeditedWaitAsync()
- Assert.Equal(2, source.GetBuildErrors().Length)
+
+ Assert.Equal(2, testServiceBroker.DiagnosticManagerService.AllDiagnostics.Count)
End Using
End Using
End Function
-
- Public Sub TestExternalBuildErrorCustomTags()
- Assert.Equal(1, ProjectExternalErrorReporter.CustomTags.Count)
- Assert.Equal(WellKnownDiagnosticTags.Telemetry, ProjectExternalErrorReporter.CustomTags(0))
- End Sub
-
-
- Public Sub TestExternalBuildErrorProperties()
+
+ Public Async Function TestOnlySupportsBuildErrors() As Task
Assert.Equal(1, DiagnosticData.PropertiesForBuildDiagnostic.Count)
Dim value As String = Nothing
Assert.True(DiagnosticData.PropertiesForBuildDiagnostic.TryGetValue(WellKnownDiagnosticPropertyNames.Origin, value))
Assert.Equal(WellKnownDiagnosticTags.Build, value)
- Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty)
+ Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
+ Dim waiter = workspace.GetService(Of AsynchronousOperationListenerProvider)().GetWaiter(FeatureAttribute.ErrorList)
+
Dim project = workspace.CurrentSolution.Projects.First()
+
Dim service = New TestDiagnosticAnalyzerService(workspace.GlobalOptions)
- Dim waiter = New AsynchronousOperationListener()
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
+ Dim threadingContext = workspace.ExportProvider.GetExportedValue(Of IThreadingContext)
+ Dim testServiceBroker = workspace.ExportProvider.GetExportedValue(Of TestServiceBroker)
+ Dim vsWorkspace = workspace.ExportProvider.GetExportedValue(Of MockVisualStudioWorkspace)()
+ vsWorkspace.SetWorkspace(workspace)
+ Using source = workspace.ExportProvider.GetExportedValue(Of ExternalErrorDiagnosticUpdateSource)()
- Dim diagnostic = New DiagnosticData(
- "id",
- category:="Test",
- message:="Test Message",
- severity:=DiagnosticSeverity.Error,
- defaultSeverity:=DiagnosticSeverity.Error,
- isEnabledByDefault:=True,
- warningLevel:=0,
- projectId:=project.Id,
- location:=New DiagnosticDataLocation(New FileLinePositionSpan("", Nothing)),
- customTags:=ImmutableArray(Of String).Empty,
- properties:=DiagnosticData.PropertiesForBuildDiagnostic,
- language:=LanguageNames.VisualBasic)
- Assert.True(diagnostic.IsBuildDiagnostic())
- source.AddNewErrors(project.Id, diagnostic)
+ source.OnSolutionBuildStarted()
+ Await waiter.ExpeditedWaitAsync()
+ Assert.True(testServiceBroker.DiagnosticManagerService.AllDiagnosticsCleared)
- diagnostic = New DiagnosticData(
+ Dim diagnostic = New DiagnosticData(
"id",
category:="Test",
message:="Test Message",
- severity:=DiagnosticSeverity.Error,
- defaultSeverity:=DiagnosticSeverity.Error,
+ severity:=Microsoft.CodeAnalysis.DiagnosticSeverity.Error,
+ defaultSeverity:=Microsoft.CodeAnalysis.DiagnosticSeverity.Error,
isEnabledByDefault:=True,
warningLevel:=0,
projectId:=project.Id,
- location:=New DiagnosticDataLocation(New FileLinePositionSpan("", Nothing)),
+ location:=New DiagnosticDataLocation(New FileLinePositionSpan("C:\DocumentDiagnostic", Nothing)),
customTags:=ImmutableArray(Of String).Empty,
properties:=ImmutableDictionary(Of String, String).Empty,
language:=LanguageNames.VisualBasic)
Assert.False(diagnostic.IsBuildDiagnostic())
#If DEBUG Then
- Assert.Throws(Of InvalidOperationException)(Sub() source.AddNewErrors(project.Id, diagnostic))
+ Assert.Throws(Of InvalidOperationException)(Sub() source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray()))
#End If
End Using
End Using
- End Sub
+ End Function
-
+
Public Async Function TestExternalDiagnostics_AddDuplicatedErrors() As Task
- Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty)
+ Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
Dim globalOptions = workspace.GetService(Of IGlobalOptionService)
- Dim waiter = New AsynchronousOperationListener()
+ Dim waiter = workspace.GetService(Of AsynchronousOperationListenerProvider)().GetWaiter(FeatureAttribute.ErrorList)
Dim project = workspace.CurrentSolution.Projects.First()
Dim diagnostic = GetDiagnosticData(project.Id)
Dim service = New TestDiagnosticAnalyzerService(globalOptions)
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
-
- ' we shouldn't crash here
- source.AddNewErrors(project.Id, diagnostic)
- source.AddNewErrors(project.Id, diagnostic)
-
- source.OnSolutionBuildCompleted()
+ Dim threadingContext = workspace.ExportProvider.GetExportedValue(Of IThreadingContext)
+ Dim testServiceBroker = workspace.ExportProvider.GetExportedValue(Of TestServiceBroker)
+ Dim vsWorkspace = workspace.ExportProvider.GetExportedValue(Of MockVisualStudioWorkspace)()
+ vsWorkspace.SetWorkspace(workspace)
+ Using source = workspace.ExportProvider.GetExportedValue(Of ExternalErrorDiagnosticUpdateSource)()
+ source.OnSolutionBuildStarted()
Await waiter.ExpeditedWaitAsync()
- Dim diagnostics = source.GetBuildErrors()
- Assert.Equal(1, diagnostics.Length)
- End Using
- End Using
- End Function
-
-
- Public Async Function TestExternalDiagnostics_CompilationAnalyzer() As Task
- Using workspace = TestWorkspace.CreateCSharp(String.Empty, composition:=s_compositionWithMockDiagnosticUpdateSourceRegistrationService)
- Dim globalOptions = workspace.GetService(Of IGlobalOptionService)
- Dim analyzer = New CompilationAnalyzer()
- Dim compiler = DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.CSharp)
-
- Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray())
- workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference}))
-
- Dim waiter = New AsynchronousOperationListener()
-
- Dim project = workspace.CurrentSolution.Projects.First()
-
- Dim service = Assert.IsType(Of DiagnosticAnalyzerService)(workspace.GetService(Of IDiagnosticAnalyzerService)())
- Dim registration = service.CreateIncrementalAnalyzer(workspace)
-
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
+ Assert.True(testServiceBroker.DiagnosticManagerService.AllDiagnosticsCleared)
- Dim diagnostic = GetDiagnosticData(project.Id, id:=analyzer.SupportedDiagnostics(0).Id)
- source.AddNewErrors(project.Id, diagnostic)
+ ' we shouldn't crash here
+ source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray())
+ source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray())
source.OnSolutionBuildCompleted()
-
Await waiter.ExpeditedWaitAsync()
- Dim diagnostics = source.GetBuildErrors()
-
- Assert.Equal(1, diagnostics.Length)
- Assert.Equal(diagnostics(0).Properties(WellKnownDiagnosticPropertyNames.Origin), WellKnownDiagnosticTags.Build)
+ Assert.Equal(2, testServiceBroker.DiagnosticManagerService.AllDiagnostics.Count)
End Using
End Using
End Function
-
- Public Async Function TestExternalDiagnostics_CompilationAnalyzerWithFSAOn() As Task
- Using workspace = TestWorkspace.CreateCSharp(String.Empty, composition:=s_compositionWithMockDiagnosticUpdateSourceRegistrationService)
- ' turn on FSA
- workspace.GlobalOptions.SetGlobalOption(SolutionCrawlerOptionsStorage.BackgroundAnalysisScopeOption, LanguageNames.CSharp, BackgroundAnalysisScope.FullSolution)
-
- Dim analyzer = New CompilationAnalyzer()
- Dim compiler = DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.CSharp)
-
- Dim analyzerReference = New AnalyzerImageReference(New DiagnosticAnalyzer() {compiler, analyzer}.ToImmutableArray())
- workspace.TryApplyChanges(workspace.CurrentSolution.WithAnalyzerReferences({analyzerReference}))
-
- Dim waiter = New AsynchronousOperationListener()
- Dim project = workspace.CurrentSolution.Projects.First()
-
- Dim service = Assert.IsType(Of DiagnosticAnalyzerService)(workspace.GetService(Of IDiagnosticAnalyzerService)())
- Dim registration = service.CreateIncrementalAnalyzer(workspace)
-
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
-
- Dim diagnostic = GetDiagnosticData(project.Id, id:=analyzer.SupportedDiagnostics(0).Id)
- source.AddNewErrors(project.Id, diagnostic)
-
- source.OnSolutionBuildCompleted()
-
- Await waiter.ExpeditedWaitAsync()
- Dim diagnostics = source.GetBuildErrors()
- Assert.NotEmpty(diagnostics)
- End Using
- End Using
- End Function
-
-
+
Public Async Function TestCompilerDiagnosticWithoutDocumentId() As Task
- Using workspace = TestWorkspace.CreateCSharp(String.Empty, composition:=s_compositionWithMockDiagnosticUpdateSourceRegistrationService)
+ Using workspace = EditorTestWorkspace.CreateCSharp(String.Empty, composition:=s_composition)
Dim globalOptions = workspace.GetService(Of IGlobalOptionService)
Dim analyzer = New CompilationAnalyzer()
Dim compiler = DiagnosticExtensions.GetCompilerDiagnosticAnalyzer(LanguageNames.CSharp)
@@ -305,69 +235,33 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
Dim service = Assert.IsType(Of DiagnosticAnalyzerService)(workspace.GetService(Of IDiagnosticAnalyzerService)())
Dim registration = service.CreateIncrementalAnalyzer(workspace)
- Using source = New ExternalErrorDiagnosticUpdateSource(
- workspace, service, workspace.GetService(Of IGlobalOperationNotificationService), waiter, CancellationToken.None)
+ Dim threadingContext = workspace.ExportProvider.GetExportedValue(Of IThreadingContext)
+ Dim testServiceBroker = workspace.ExportProvider.GetExportedValue(Of TestServiceBroker)
+ Dim vsWorkspace = workspace.ExportProvider.GetExportedValue(Of MockVisualStudioWorkspace)()
+ vsWorkspace.SetWorkspace(workspace)
+ Using source = workspace.ExportProvider.GetExportedValue(Of ExternalErrorDiagnosticUpdateSource)()
Dim diagnostic = New DiagnosticData(
id:="CS1002",
category:="Test",
message:="Test Message",
- severity:=DiagnosticSeverity.Error,
- defaultSeverity:=DiagnosticSeverity.Error,
+ severity:=Microsoft.CodeAnalysis.DiagnosticSeverity.Error,
+ defaultSeverity:=Microsoft.CodeAnalysis.DiagnosticSeverity.Error,
isEnabledByDefault:=True,
warningLevel:=0,
customTags:=ImmutableArray(Of String).Empty,
properties:=DiagnosticData.PropertiesForBuildDiagnostic,
project.Id,
- location:=New DiagnosticDataLocation(New FileLinePositionSpan("Test.txt", New LinePosition(4, 4), New LinePosition(4, 4)), documentId:=Nothing),
+ location:=New DiagnosticDataLocation(New FileLinePositionSpan("C:\ProjectDiagnostic", New LinePosition(4, 4), New LinePosition(4, 4)), documentId:=Nothing),
language:=project.Language)
- 'AddHandler service.DiagnosticsUpdated, Sub(o, argsCollection)
- ' Dim args = argsCollection.Single()
- ' Dim diagnostics = args.Diagnostics
-
- ' Assert.Single(diagnostics)
- ' Assert.Equal(diagnostics(0).Id, diagnostic.Id)
- ' End Sub
-
- source.AddNewErrors(project.Id, diagnostic)
- Await waiter.ExpeditedWaitAsync()
-
+ source.AddNewErrors(project.Id, s_projectGuid, {diagnostic}.ToImmutableArray())
source.OnSolutionBuildCompleted()
Await waiter.ExpeditedWaitAsync()
-
- Dim diagnosticServiceWaiter = TryCast(listenerProvider.GetListener(FeatureAttribute.DiagnosticService), AsynchronousOperationListener)
- Await diagnosticServiceWaiter.ExpeditedWaitAsync()
End Using
End Using
End Function
- Private Class CompilationEndAnalyzer
- Inherits DiagnosticAnalyzer
-
- Public ReadOnly Descriptor As DiagnosticDescriptor
-
- Public Sub New(hasCompilationEndTag As Boolean)
- Dim additionalCustomTags = If(hasCompilationEndTag, {WellKnownDiagnosticTags.CompilationEnd}, Array.Empty(Of String))
- Descriptor = DescriptorFactory.CreateSimpleDescriptor("CompilationEndAnalyzer", additionalCustomTags)
- End Sub
- Public Overrides ReadOnly Property SupportedDiagnostics As ImmutableArray(Of DiagnosticDescriptor)
- Get
- Return ImmutableArray.Create(Descriptor)
- End Get
- End Property
-
- Public Overrides Sub Initialize(context As AnalysisContext)
- context.RegisterCompilationStartAction(
- Sub(startContext)
- startContext.RegisterCompilationEndAction(
- Sub(endContext)
- ' do nothing
- End Sub)
- End Sub)
- End Sub
- End Class
-
Private Class CompilationAnalyzer
Inherits DiagnosticAnalyzer
@@ -390,12 +284,12 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
id,
category:="Test",
message:="Test Message",
- severity:=DiagnosticSeverity.Error,
- defaultSeverity:=DiagnosticSeverity.Error,
+ severity:=Microsoft.CodeAnalysis.DiagnosticSeverity.Error,
+ defaultSeverity:=Microsoft.CodeAnalysis.DiagnosticSeverity.Error,
isEnabledByDefault:=True,
warningLevel:=0,
projectId:=projectId,
- location:=New DiagnosticDataLocation(New FileLinePositionSpan("", Nothing)),
+ location:=New DiagnosticDataLocation(New FileLinePositionSpan("C:\DocumentDiagnostic", Nothing)),
customTags:=ImmutableArray(Of String).Empty,
properties:=DiagnosticData.PropertiesForBuildDiagnostic,
language:=LanguageNames.VisualBasic)
@@ -446,5 +340,78 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics
Return Task.FromResult((ImmutableArray(Of DiagnosticData).Empty, False))
End Function
End Class
+
+
+
+
+ Private Class TestServiceBroker
+ Implements IServiceBroker
+
+ Friend DiagnosticManagerService As DiagnosticManagerService = New DiagnosticManagerService()
+
+
+
+ Public Sub New()
+ End Sub
+
+ Public Event AvailabilityChanged As EventHandler(Of BrokeredServicesChangedEventArgs) Implements IServiceBroker.AvailabilityChanged
+
+ Public Function GetProxyAsync(Of T As Class)(serviceDescriptor As ServiceRpcDescriptor, Optional options As ServiceActivationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of T) Implements IServiceBroker.GetProxyAsync
+ If (GetType(T) Is GetType(IDiagnosticManagerService)) Then
+ Return New ValueTask(Of T)(Task.FromResult(CType(CType(DiagnosticManagerService, Object), T)))
+ End If
+
+ Throw New InvalidOperationException()
+ End Function
+
+ Public Function GetPipeAsync(serviceMoniker As ServiceMoniker, Optional options As ServiceActivationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of IDuplexPipe) Implements IServiceBroker.GetPipeAsync
+ Throw New NotImplementedException()
+ End Function
+ End Class
+
+ Private Class DiagnosticManagerService
+ Implements IDiagnosticManagerService
+
+ Friend DiagnosticsCleared As Boolean = False
+ Friend AllDiagnosticsCleared As Boolean = False
+ Friend AllDiagnostics As List(Of RpcContracts.DiagnosticManagement.Diagnostic) = New List(Of RpcContracts.DiagnosticManagement.Diagnostic)()
+
+ Public Sub Dispose() Implements IDisposable.Dispose
+ End Sub
+
+ Public Function SetDiagnosticsAsync(generatorId As String, diagnostics As IReadOnlyList(Of DiagnosticCollection), cancellationToken As CancellationToken) As Task Implements IDiagnosticManagerService.SetDiagnosticsAsync
+ Throw New NotImplementedException()
+ End Function
+
+ Public Function AppendDiagnosticsAsync(generatorId As String, diagnostics As IReadOnlyList(Of DiagnosticCollection), cancellationToken As CancellationToken) As Task Implements IDiagnosticManagerService.AppendDiagnosticsAsync
+ For Each collection In diagnostics
+ For Each diagnostic In collection.Diagnostics
+ AllDiagnostics.Add(diagnostic)
+ Next
+ Next
+ Return Task.CompletedTask
+ End Function
+
+ Public Function ClearDiagnosticsAsync(generatorId As String, cancellationToken As CancellationToken) As Task Implements IDiagnosticManagerService.ClearDiagnosticsAsync
+ If (DiagnosticsCleared) Then
+ Throw New InvalidOperationException()
+ End If
+ DiagnosticsCleared = True
+ Return Task.CompletedTask
+ End Function
+
+ Public Function ClearAllDiagnosticsAsync(cancellationToken As CancellationToken) As Task Implements IDiagnosticManagerService.ClearAllDiagnosticsAsync
+ If (AllDiagnosticsCleared) Then
+ Throw New InvalidOperationException()
+ End If
+ AllDiagnosticsCleared = True
+ Return Task.CompletedTask
+ End Function
+
+ Public Function AddBuildOnlyDiagnosticCodesAsync(diagnosticCodes As IReadOnlyList(Of String), cancellationToken As CancellationToken) As Task Implements IDiagnosticManagerService.AddBuildOnlyDiagnosticCodesAsync
+ Throw New NotImplementedException()
+ End Function
+ End Class
+
End Class
End Namespace
diff --git a/src/VisualStudio/LiveShare/Impl/Client/RemoteLanguageServiceWorkspace.cs b/src/VisualStudio/LiveShare/Impl/Client/RemoteLanguageServiceWorkspace.cs
index 1002d23579edb..103d3617807ec 100644
--- a/src/VisualStudio/LiveShare/Impl/Client/RemoteLanguageServiceWorkspace.cs
+++ b/src/VisualStudio/LiveShare/Impl/Client/RemoteLanguageServiceWorkspace.cs
@@ -42,7 +42,10 @@ internal sealed class RemoteLanguageServiceWorkspace : CodeAnalysis.Workspace, I
/// Gate to make sure we only update the paths and trigger RDT one at a time.
/// Guards and
///
+ // Our usage of SemaphoreSlim is fine. We don't perform blocking waits for it on the UI thread.
+#pragma warning disable RS0030 // Do not use banned APIs
private static readonly SemaphoreSlim s_RemotePathsGate = new SemaphoreSlim(initialCount: 1);
+#pragma warning restore RS0030 // Do not use banned APIs
private readonly IServiceProvider _serviceProvider;
private readonly IThreadingContext _threadingContext;
diff --git a/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj b/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj
index 6b93eb53390b8..45b2c99927f34 100644
--- a/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj
+++ b/src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj
@@ -86,6 +86,12 @@
true
BindingRedirect
+
+ Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler
+ BuiltProjectOutputGroup
+ true
+ BindingRedirect
+
Workspaces.Desktop
BuiltProjectOutputGroup;SatelliteDllsProjectOutputGroup
diff --git a/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj b/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj
index 1d4bf4f98739d..93f664be7548a 100644
--- a/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj
+++ b/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj
@@ -23,11 +23,11 @@
true
-
-
-
-
+
+
+
diff --git a/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj b/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj
index 9b3e73b619771..6d806fdba2eb8 100644
--- a/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj
+++ b/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj
@@ -38,6 +38,9 @@
true
+
+ true
+
diff --git a/src/Workspaces/Core/Portable/PublicAPI.Shipped.txt b/src/Workspaces/Core/Portable/PublicAPI.Shipped.txt
index 1dbdce17d2e70..1c3695ccc2456 100644
--- a/src/Workspaces/Core/Portable/PublicAPI.Shipped.txt
+++ b/src/Workspaces/Core/Portable/PublicAPI.Shipped.txt
@@ -1,5 +1,4 @@
abstract Microsoft.CodeAnalysis.CodeActions.CodeAction.Title.get -> string
-abstract Microsoft.CodeAnalysis.CodeActions.CodeActionWithOptions.ComputeOperationsAsync(object options, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task>
abstract Microsoft.CodeAnalysis.CodeActions.CodeActionWithOptions.GetOptions(System.Threading.CancellationToken cancellationToken) -> object
abstract Microsoft.CodeAnalysis.CodeActions.PreviewOperation.GetPreviewAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task