From c1f27f2e52b14feba3d9573785adf4180e0eb60f Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Wed, 25 May 2022 09:04:18 -0700 Subject: [PATCH] Use GetText instead of ToFullString See dotnet/roslyn#61506 --- .../OperationLightupGenerator.cs | 6 +++--- .../SyntaxLightupGenerator.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs index 681559ea6..f9aa8be29 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs @@ -579,7 +579,7 @@ private void GenerateOperationInterface(in SourceProductionContext context, Inte .WithTrailingTrivia( SyntaxFactory.CarriageReturnLineFeed); - context.AddSource(node.WrapperName + ".g.cs", SourceText.From(wrapperNamespace.ToFullString(), Encoding.UTF8)); + context.AddSource(node.WrapperName + ".g.cs", wrapperNamespace.GetText(Encoding.UTF8)); } private void GenerateOperationWrapperHelper(in SourceProductionContext context, ImmutableArray wrapperTypes) @@ -787,7 +787,7 @@ private void GenerateOperationWrapperHelper(in SourceProductionContext context, .WithTrailingTrivia( SyntaxFactory.CarriageReturnLineFeed); - context.AddSource("OperationWrapperHelper.g.cs", SourceText.From(wrapperNamespace.ToFullString(), Encoding.UTF8)); + context.AddSource("OperationWrapperHelper.g.cs", wrapperNamespace.GetText(Encoding.UTF8)); } private void GenerateOperationKindEx(in SourceProductionContext context, ImmutableArray wrapperTypes) @@ -840,7 +840,7 @@ private void GenerateOperationKindEx(in SourceProductionContext context, Immutab .WithTrailingTrivia( SyntaxFactory.CarriageReturnLineFeed); - context.AddSource("OperationKindEx.g.cs", SourceText.From(wrapperNamespace.ToFullString(), Encoding.UTF8)); + context.AddSource("OperationKindEx.g.cs", wrapperNamespace.GetText(Encoding.UTF8)); } private sealed class DocumentData diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs index 9a2348610..78fb4566d 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs @@ -859,7 +859,7 @@ private void GenerateSyntaxWrapper(in SourceProductionContext context, SyntaxDat .WithTrailingTrivia( SyntaxFactory.CarriageReturnLineFeed); - context.AddSource(nodeData.WrapperName + ".g.cs", SourceText.From(wrapperNamespace.ToFullString(), Encoding.UTF8)); + context.AddSource(nodeData.WrapperName + ".g.cs", wrapperNamespace.GetText(Encoding.UTF8)); } private void GenerateSyntaxWrapperHelper(in SourceProductionContext context, ImmutableArray wrapperTypes) @@ -1246,7 +1246,7 @@ private void GenerateSyntaxWrapperHelper(in SourceProductionContext context, Imm .WithTrailingTrivia( SyntaxFactory.CarriageReturnLineFeed); - context.AddSource("SyntaxWrapperHelper.g.cs", SourceText.From(wrapperNamespace.ToFullString(), Encoding.UTF8)); + context.AddSource("SyntaxWrapperHelper.g.cs", wrapperNamespace.GetText(Encoding.UTF8)); } private sealed class SyntaxData