From 27859bb1f4908578a8b4b1e71ddb904f596f546d Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Wed, 7 Apr 2021 15:30:59 +0200 Subject: [PATCH 1/4] Only updated generated files if they have changed --- .../CSharpClientGenerator.cs | 10 ----- .../ClientGeneratorContext.cs | 22 ++++++++++- .../SingleFileDocumentWriter.cs | 38 ++++++++++++++----- .../src/MSBuild/StrawberryShake.props | 1 + .../src/MSBuild/StrawberryShake.targets | 1 + 5 files changed, 51 insertions(+), 21 deletions(-) diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs index b72d09b11a1..62ea035ebf7 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs @@ -94,8 +94,6 @@ private void Execute(ClientGeneratorContext context) { try { - CreateDirectoryIfNotExists(context.OutputDirectory); - if (!TryGenerateClient(context, out CSharpGeneratorResult? result)) { // there were unexpected errors and we will stop generating this client. @@ -362,14 +360,6 @@ private IReadOnlyList GetGraphQLConfigFiles( .Where(t => IOPath.GetFileName(t).EqualsOrdinal(".graphqlrc.json")) .ToList(); - private void CreateDirectoryIfNotExists(string? directory) - { - if (!Directory.Exists(directory)) - { - Directory.CreateDirectory(directory); - } - } - private ILogger CreateLogger(GeneratorExecutionContext context) { if (context.AnalyzerConfigOptions.GlobalOptions.TryGetValue( diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/ClientGeneratorContext.cs b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/ClientGeneratorContext.cs index fe274dc6e61..45a7d37e36f 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/ClientGeneratorContext.cs +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/ClientGeneratorContext.cs @@ -8,6 +8,7 @@ using static StrawberryShake.CodeGeneration.ErrorHelper; using static StrawberryShake.CodeGeneration.CSharp.Analyzers.SourceGeneratorErrorCodes; using static StrawberryShake.CodeGeneration.CSharp.Analyzers.DiagnosticErrorHelper; +using System.IO; namespace StrawberryShake.CodeGeneration.CSharp.Analyzers { @@ -28,7 +29,7 @@ public ClientGeneratorContext( Filter = filter; ClientDirectory = clientDirectory; OutputDirectory = IOPath.Combine( - clientDirectory, + clientDirectory, settings.OutputDirectoryName ?? ".generated"); OutputFiles = settings.OutputDirectoryName is not null; _allDocuments = allDocuments; @@ -127,5 +128,24 @@ public string GetNamespace() return null; } + + public string? GetStateDirectory() + { + if (Execution.AnalyzerConfigOptions.GlobalOptions.TryGetValue( + "build_property.StrawberryShake_State", + out string? value) && + !string.IsNullOrEmpty(value)) + { + if (!Directory.Exists(value)) + { + Directory.CreateDirectory(value); + } + + return value; + } + + throw new GraphQLException( + $"The MSBuild property `StrawberryShake_State` cannot be empty."); + } } } diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs index e8a6b3319f1..7754d1abdc6 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs @@ -3,15 +3,18 @@ using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; +using HotChocolate.Language; using IOPath = System.IO.Path; namespace StrawberryShake.CodeGeneration.CSharp.Analyzers { public class SingleFileDocumentWriter : IDocumentWriter { - private StringBuilder _content = new(); + private readonly StringBuilder _content = new(); + private readonly MD5DocumentHashProvider _hashProvider = new(); private GeneratorExecutionContext? _execution; private string? _fileName; + private string? _hashFile; private bool _emitCode; public void WriteDocument(ClientGeneratorContext context, SourceDocument document) @@ -28,6 +31,9 @@ public void WriteDocument(ClientGeneratorContext context, SourceDocument documen _fileName = IOPath.Combine( context.OutputDirectory, $"{context.Settings.Name}.StrawberryShake.cs"); + _hashFile = IOPath.Combine( + context.GetStateDirectory(), + context.Settings.Name + ".md5"); _emitCode = context.Settings.EmitGeneratedCode; context.FileNames.Add(_fileName); } @@ -51,19 +57,31 @@ public void Flush() if (_emitCode && _fileName is not null) { - string directory = IOPath.GetDirectoryName(_fileName); + string? hash = _hashFile is not null && File.Exists(_hashFile) + ? File.ReadAllText(_hashFile) + : null; - if (!Directory.Exists(directory)) - { - Directory.CreateDirectory(directory); - } + string currentHash = _hashProvider.ComputeHash( + Encoding.UTF8.GetBytes(_content.ToString())); - if (File.Exists(_fileName)) + // we only write the file if it has changed so we do not trigger a loop on + // dotnet watch. + if (!currentHash.Equals(hash, StringComparison.Ordinal)) { - File.Delete(_fileName); - } + string directory = IOPath.GetDirectoryName(_fileName); - File.WriteAllText(_fileName, _content.ToString(), Encoding.UTF8); + if (!Directory.Exists(directory)) + { + Directory.CreateDirectory(directory); + } + + if (File.Exists(_fileName)) + { + File.Delete(_fileName); + } + + File.WriteAllText(_fileName, _content.ToString(), Encoding.UTF8); + } } } } diff --git a/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.props b/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.props index dca09794e52..9635dd0f58b 100644 --- a/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.props +++ b/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.props @@ -46,6 +46,7 @@ + diff --git a/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.targets b/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.targets index b1f35edce0b..c42d9f68350 100644 --- a/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.targets +++ b/src/StrawberryShake/SourceGenerator/src/MSBuild/StrawberryShake.targets @@ -8,6 +8,7 @@ false $(RootNamespace) $(AssemblyName) + $(BaseIntermediateOutputPath)\berry From 88e543ab8047b8b83da0d9fd5e9b61c7a9def28b Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Wed, 7 Apr 2021 15:36:29 +0200 Subject: [PATCH 2/4] write hash --- .../SingleFileDocumentWriter.cs | 1 + ...ake.CodeGeneration.CSharp.Analyzers.csproj | 2 +- .../StarWarsClient.StrawberryShake.cs | 232 ++++++------------ .../StarWars/ChatGetPeople.graphql | 1 - ...deGeneration.CSharp.Analyzers.Tests.csproj | 2 +- 5 files changed, 84 insertions(+), 154 deletions(-) diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs index 7754d1abdc6..4a41c7903d9 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs @@ -81,6 +81,7 @@ public void Flush() } File.WriteAllText(_fileName, _content.ToString(), Encoding.UTF8); + File.WriteAllText(_hashFile, currentHash, Encoding.UTF8); } } } diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj index 4e874fd21bc..2ebacf6fd85 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs index 0851eb259bf..5a074a669b2 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs @@ -8,22 +8,22 @@ namespace Microsoft.Extensions.DependencyInjection [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] public static partial class StarWarsClientServiceCollectionExtensions { - public static global::StrawberryShake.IClientBuilder AddStarWarsClient(this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.StarWarsClientProfileKind profile = global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.StarWarsClientProfileKind.Default) + public static global::StrawberryShake.IClientBuilder AddStarWarsClient(this global::Microsoft.Extensions.DependencyInjection.IServiceCollection services, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.StarWarsClientProfileKind profile = global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.StarWarsClientProfileKind.Default) { global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => { var serviceCollection = profile switch { - global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.StarWarsClientProfileKind.Default => ConfigureClientDefault(sp, strategy), global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.StarWarsClientProfileKind.WebSocket => ConfigureClientWebSocket(sp, strategy), _ => throw new global::System.ArgumentOutOfRangeException()} + global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.StarWarsClientProfileKind.Default => ConfigureClientDefault(sp, strategy), global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.StarWarsClientProfileKind.WebSocket => ConfigureClientWebSocket(sp, strategy), _ => throw new global::System.ArgumentOutOfRangeException()} ; return new ClientServiceProvider(global::Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(serviceCollection)); }); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.StarWarsClientStoreAccessor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); - return new global::StrawberryShake.ClientBuilder("StarWarsClient", services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.StarWarsClientStoreAccessor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)))); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp))); + return new global::StrawberryShake.ClientBuilder("StarWarsClient", services); } private static global::Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureClientDefault(global::System.IServiceProvider parentServices, global::StrawberryShake.ExecutionStrategy strategy = global::StrawberryShake.ExecutionStrategy.NetworkOnly) @@ -36,7 +36,7 @@ public static partial class StarWarsClientServiceCollectionExtensions var clientFactory = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(parentServices); return new global::StrawberryShake.Transport.Http.HttpConnection(() => clientFactory.CreateClient("StarWarsClient")); }); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.GetPeople_People_Nodes_PersonFromPersonEntityMapper>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.GetPeople_People_Nodes_PersonFromPersonEntityMapper>(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); @@ -53,16 +53,16 @@ public static partial class StarWarsClientServiceCollectionExtensions global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.GetPeopleResultFactory>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.GetPeopleBuilder>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.GetPeopleResultFactory>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.GetPeopleBuilder>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); return services; } @@ -76,7 +76,7 @@ public static partial class StarWarsClientServiceCollectionExtensions var sessionPool = global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(parentServices); return new global::StrawberryShake.Transport.WebSockets.WebSocketConnection(async ct => await sessionPool.CreateAsync("StarWarsClient", ct)); }); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.GetPeople_People_Nodes_PersonFromPersonEntityMapper>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.GetPeople_People_Nodes_PersonFromPersonEntityMapper>(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); @@ -93,16 +93,16 @@ public static partial class StarWarsClientServiceCollectionExtensions global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => new global::StrawberryShake.Serialization.SerializerResolver(global::System.Linq.Enumerable.Concat(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(parentServices), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)))); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.GetPeopleResultFactory>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.GetPeopleBuilder>(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); - global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.GetPeopleResultFactory>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton, global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.GetPeopleBuilder>(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton>(services, sp => new global::StrawberryShake.OperationExecutor(global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), () => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService>(sp), global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp), strategy)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services); + global::Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton(services, sp => global::Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(sp)); return services; } @@ -130,13 +130,13 @@ public void Dispose() } } -namespace StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL +namespace StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests { // StrawberryShake.CodeGeneration.CSharp.Generators.ResultTypeGenerator [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] public partial class GetPeopleResult : global::System.IEquatable, IGetPeopleResult { - public GetPeopleResult(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeople_People? people) + public GetPeopleResult(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? people) { People = people; } @@ -144,10 +144,7 @@ public GetPeopleResult(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.T /// /// Gets access to all the people known to this service. /// - public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeople_People? People - { - get; - } + public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? People { get; } public override global::System.Boolean Equals(global::System.Object? obj) { @@ -211,7 +208,7 @@ public GetPeopleResult(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.T [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] public partial class GetPeople_People_PersonConnection : global::System.IEquatable, IGetPeople_People_PersonConnection { - public GetPeople_People_PersonConnection(global::System.Collections.Generic.IReadOnlyList? nodes) + public GetPeople_People_PersonConnection(global::System.Collections.Generic.IReadOnlyList? nodes) { Nodes = nodes; } @@ -219,10 +216,7 @@ public GetPeople_People_PersonConnection(global::System.Collections.Generic.IRea /// /// A flattened list of the nodes. /// - public global::System.Collections.Generic.IReadOnlyList? Nodes - { - get; - } + public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } public override global::System.Boolean Equals(global::System.Object? obj) { @@ -297,25 +291,13 @@ public GetPeople_People_Nodes_Person(global::System.String name, global::System. LastSeen = lastSeen; } - public global::System.String Name - { - get; - } + public global::System.String Name { get; } - public global::System.String Email - { - get; - } + public global::System.String Email { get; } - public global::System.Boolean IsOnline - { - get; - } + public global::System.Boolean IsOnline { get; } - public global::System.DateTimeOffset LastSeen - { - get; - } + public global::System.DateTimeOffset LastSeen { get; } public override global::System.Boolean Equals(global::System.Object? obj) { @@ -378,10 +360,7 @@ public interface IGetPeopleResult /// /// Gets access to all the people known to this service. /// - public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeople_People? People - { - get; - } + public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? People { get; } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator @@ -394,10 +373,7 @@ public interface IGetPeople_People /// /// A flattened list of the nodes. /// - public global::System.Collections.Generic.IReadOnlyList? Nodes - { - get; - } + public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator @@ -413,25 +389,13 @@ public interface IGetPeople_People_PersonConnection : IGetPeople_People [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] public interface IGetPeople_People_Nodes { - public global::System.String Name - { - get; - } + public global::System.String Name { get; } - public global::System.String Email - { - get; - } + public global::System.String Email { get; } - public global::System.Boolean IsOnline - { - get; - } + public global::System.Boolean IsOnline { get; } - public global::System.DateTimeOffset LastSeen - { - get; - } + public global::System.DateTimeOffset LastSeen { get; } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator @@ -468,20 +432,10 @@ private GetPeopleQueryDocument() { } - public static GetPeopleQueryDocument Instance - { - get; - } - - = new GetPeopleQueryDocument(); + public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; public global::System.ReadOnlySpan Body => new global::System.Byte[0]; - public global::StrawberryShake.DocumentHash Hash - { - get; - } - - = new global::StrawberryShake.DocumentHash("md5Hash", "22e3b8ba92883af43c70567c7d1cf143"); + public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("md5Hash", "22e3b8ba92883af43c70567c7d1cf143"); public override global::System.String ToString() { #if NETSTANDARD2_0 @@ -514,7 +468,7 @@ public static GetPeopleQueryDocument Instance /// /// [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] - public partial class GetPeopleQuery : global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeopleQuery + public partial class GetPeopleQuery : global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleQuery { private readonly global::StrawberryShake.IOperationExecutor _operationExecutor; public GetPeopleQuery(global::StrawberryShake.IOperationExecutor operationExecutor) @@ -584,16 +538,16 @@ public interface IGetPeopleQuery : global::StrawberryShake.IOperationRequestFact /// Represents the StarWarsClient GraphQL client /// [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] - public partial class StarWarsClient : global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IStarWarsClient + public partial class StarWarsClient : global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IStarWarsClient { - private readonly global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeopleQuery _getPeople; - public StarWarsClient(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeopleQuery getPeople) + private readonly global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleQuery _getPeople; + public StarWarsClient(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleQuery getPeople) { _getPeople = getPeople ?? throw new global::System.ArgumentNullException(nameof(getPeople)); } public static global::System.String ClientName => "StarWarsClient"; - public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeopleQuery GetPeople => _getPeople; + public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleQuery GetPeople => _getPeople; } // StrawberryShake.CodeGeneration.CSharp.Generators.ClientInterfaceGenerator @@ -603,10 +557,7 @@ public StarWarsClient(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Te [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] public interface IStarWarsClient { - global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeopleQuery GetPeople - { - get; - } + global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleQuery GetPeople { get; } } // StrawberryShake.CodeGeneration.CSharp.Generators.TransportProfileEnumGenerator @@ -618,7 +569,7 @@ public enum StarWarsClientProfileKind } } -namespace StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State +namespace StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State { // StrawberryShake.CodeGeneration.CSharp.Generators.EntityTypeGenerator [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.2.0.0")] @@ -632,40 +583,28 @@ public PersonEntity(global::System.String name, global::System.String email, glo LastSeen = lastSeen; } - public global::System.String Name - { - get; - } + public global::System.String Name { get; } - public global::System.String Email - { - get; - } + public global::System.String Email { get; } - public global::System.Boolean IsOnline - { - get; - } + public global::System.Boolean IsOnline { get; } - public global::System.DateTimeOffset LastSeen - { - get; - } + public global::System.DateTimeOffset LastSeen { get; } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultDataFactoryGenerator [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] - public partial class GetPeopleResultFactory : global::StrawberryShake.IOperationResultDataFactory + public partial class GetPeopleResultFactory : global::StrawberryShake.IOperationResultDataFactory { private readonly global::StrawberryShake.IEntityStore _entityStore; - private readonly global::StrawberryShake.IEntityMapper _getPeople_People_Nodes_PersonFromPersonEntityMapper; - public GetPeopleResultFactory(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityMapper getPeople_People_Nodes_PersonFromPersonEntityMapper) + private readonly global::StrawberryShake.IEntityMapper _getPeople_People_Nodes_PersonFromPersonEntityMapper; + public GetPeopleResultFactory(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityMapper getPeople_People_Nodes_PersonFromPersonEntityMapper) { _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); _getPeople_People_Nodes_PersonFromPersonEntityMapper = getPeople_People_Nodes_PersonFromPersonEntityMapper ?? throw new global::System.ArgumentNullException(nameof(getPeople_People_Nodes_PersonFromPersonEntityMapper)); } - global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeopleResult); + global::System.Type global::StrawberryShake.IOperationResultDataFactory.ResultType => typeof(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleResult); public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo dataInfo, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) @@ -681,7 +620,7 @@ public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo d throw new global::System.ArgumentException("GetPeopleResultInfo expected."); } - private global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeople_People? MapIGetPeople_People(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonConnectionData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot) + private global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? MapIGetPeople_People(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData? data, global::StrawberryShake.IEntityStoreSnapshot snapshot) { if (data is null) { @@ -701,14 +640,14 @@ public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo d return returnValue; } - private global::System.Collections.Generic.IReadOnlyList? MapIGetPeople_People_NodesArray(global::System.Collections.Generic.IReadOnlyList? list, global::StrawberryShake.IEntityStoreSnapshot snapshot) + private global::System.Collections.Generic.IReadOnlyList? MapIGetPeople_People_NodesArray(global::System.Collections.Generic.IReadOnlyList? list, global::StrawberryShake.IEntityStoreSnapshot snapshot) { if (list is null) { return null; } - var persons = new global::System.Collections.Generic.List(); + var persons = new global::System.Collections.Generic.List(); foreach (global::StrawberryShake.EntityId? child in list) { persons.Add(MapIGetPeople_People_Nodes(child, snapshot)); @@ -717,7 +656,7 @@ public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo d return persons; } - private global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.IGetPeople_People_Nodes? MapIGetPeople_People_Nodes(global::StrawberryShake.EntityId? entityId, global::StrawberryShake.IEntityStoreSnapshot snapshot) + private global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People_Nodes? MapIGetPeople_People_Nodes(global::StrawberryShake.EntityId? entityId, global::StrawberryShake.IEntityStoreSnapshot snapshot) { if (entityId is null) { @@ -726,7 +665,7 @@ public GetPeopleResult Create(global::StrawberryShake.IOperationResultDataInfo d if (entityId.Value.Name.Equals("Person", global::System.StringComparison.Ordinal)) { - return _getPeople_People_Nodes_PersonFromPersonEntityMapper.Map(snapshot.GetEntity(entityId.Value) ?? throw new global::StrawberryShake.GraphQLClientException()); + return _getPeople_People_Nodes_PersonFromPersonEntityMapper.Map(snapshot.GetEntity(entityId.Value) ?? throw new global::StrawberryShake.GraphQLClientException()); } throw new global::System.NotSupportedException(); @@ -744,7 +683,7 @@ public partial class GetPeopleResultInfo : global::StrawberryShake.IOperationRes { private readonly global::System.Collections.Generic.IReadOnlyCollection _entityIds; private readonly global::System.UInt64 _version; - public GetPeopleResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonConnectionData? people, global::System.Collections.Generic.IReadOnlyCollection entityIds, global::System.UInt64 version) + public GetPeopleResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData? people, global::System.Collections.Generic.IReadOnlyCollection entityIds, global::System.UInt64 version) { People = people; _entityIds = entityIds ?? throw new global::System.ArgumentNullException(nameof(entityIds)); @@ -754,10 +693,7 @@ public GetPeopleResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Analyze /// /// Gets access to all the people known to this service. /// - public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonConnectionData? People - { - get; - } + public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData? People { get; } public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; @@ -769,7 +705,7 @@ public GetPeopleResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Analyze // StrawberryShake.CodeGeneration.CSharp.Generators.ResultFromEntityTypeMapperGenerator [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] - public partial class GetPeople_People_Nodes_PersonFromPersonEntityMapper : global::StrawberryShake.IEntityMapper + public partial class GetPeople_People_Nodes_PersonFromPersonEntityMapper : global::StrawberryShake.IEntityMapper { private readonly global::StrawberryShake.IEntityStore _entityStore; public GetPeople_People_Nodes_PersonFromPersonEntityMapper(global::StrawberryShake.IEntityStore entityStore) @@ -777,7 +713,7 @@ public GetPeople_People_Nodes_PersonFromPersonEntityMapper(global::StrawberrySha _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); } - public GetPeople_People_Nodes_Person Map(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonEntity entity, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) + public GetPeople_People_Nodes_Person Map(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonEntity entity, global::StrawberryShake.IEntityStoreSnapshot? snapshot = null) { if (snapshot is null) { @@ -790,15 +726,15 @@ public GetPeople_People_Nodes_Person Map(global::StrawberryShake.CodeGeneration. // StrawberryShake.CodeGeneration.CSharp.Generators.JsonResultBuilderGenerator [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] - public partial class GetPeopleBuilder : global::StrawberryShake.IOperationResultBuilder + public partial class GetPeopleBuilder : global::StrawberryShake.IOperationResultBuilder { private readonly global::StrawberryShake.IEntityStore _entityStore; private readonly global::StrawberryShake.IEntityIdSerializer _idSerializer; - private readonly global::StrawberryShake.IOperationResultDataFactory _resultDataFactory; + private readonly global::StrawberryShake.IOperationResultDataFactory _resultDataFactory; private readonly global::StrawberryShake.Serialization.ILeafValueParser _stringParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _booleanParser; private readonly global::StrawberryShake.Serialization.ILeafValueParser _dateTimeParser; - public GetPeopleBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) + public GetPeopleBuilder(global::StrawberryShake.IEntityStore entityStore, global::StrawberryShake.IEntityIdSerializer idSerializer, global::StrawberryShake.IOperationResultDataFactory resultDataFactory, global::StrawberryShake.Serialization.ISerializerResolver serializerResolver) { _entityStore = entityStore ?? throw new global::System.ArgumentNullException(nameof(entityStore)); _idSerializer = idSerializer ?? throw new global::System.ArgumentNullException(nameof(idSerializer)); @@ -839,7 +775,7 @@ public GetPeopleBuilder(global::StrawberryShake.IEntityStore entityStore, global { var entityIds = new global::System.Collections.Generic.HashSet(); global::StrawberryShake.IEntityStoreSnapshot snapshot = default !; - global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonConnectionData? peopleId = default !; + global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData? peopleId = default !; _entityStore.Update(session => { peopleId = DeserializeIGetPeople_People(session, global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "people"), entityIds); @@ -849,7 +785,7 @@ public GetPeopleBuilder(global::StrawberryShake.IEntityStore entityStore, global return (_resultDataFactory.Create(resultInfo), resultInfo); } - private global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonConnectionData? DeserializeIGetPeople_People(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) + private global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData? DeserializeIGetPeople_People(global::StrawberryShake.IEntityStoreUpdateSession session, global::System.Text.Json.JsonElement? obj, global::System.Collections.Generic.ISet entityIds) { if (!obj.HasValue) { @@ -859,7 +795,7 @@ public GetPeopleBuilder(global::StrawberryShake.IEntityStore entityStore, global var typename = obj.Value.GetProperty("__typename").GetString(); if (typename?.Equals("PersonConnection", global::System.StringComparison.Ordinal) ?? false) { - return new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonConnectionData(typename, nodes: UpdateIGetPeople_People_NodesEntityArray(session, global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "nodes"), entityIds)); + return new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData(typename, nodes: UpdateIGetPeople_People_NodesEntityArray(session, global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "nodes"), entityIds)); } throw new global::System.NotSupportedException(); @@ -892,13 +828,13 @@ public GetPeopleBuilder(global::StrawberryShake.IEntityStore entityStore, global entityIds.Add(entityId); if (entityId.Name.Equals("Person", global::System.StringComparison.Ordinal)) { - if (session.CurrentSnapshot.TryGetEntity(entityId, out global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonEntity? entity)) + if (session.CurrentSnapshot.TryGetEntity(entityId, out global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonEntity? entity)) { - session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonEntity(DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "email")), DeserializeNonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "isOnline")), DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastSeen")))); + session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonEntity(DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "email")), DeserializeNonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "isOnline")), DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastSeen")))); } else { - session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.GraphQL.State.PersonEntity(DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "email")), DeserializeNonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "isOnline")), DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastSeen")))); + session.SetEntity(entityId, new global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonEntity(DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "name")), DeserializeNonNullableString(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "email")), DeserializeNonNullableBoolean(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "isOnline")), DeserializeNonNullableDateTimeOffset(global::StrawberryShake.Json.JsonElementExtensions.GetPropertyOrNull(obj, "lastSeen")))); } return entityId; @@ -951,18 +887,12 @@ public PersonConnectionData(global::System.String __typename, global::System.Col Nodes = nodes; } - public global::System.String __typename - { - get; - } + public global::System.String __typename { get; } /// /// A flattened list of the nodes. /// - public global::System.Collections.Generic.IReadOnlyList? Nodes - { - get; - } + public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } } // StrawberryShake.CodeGeneration.CSharp.Generators.EntityIdFactoryGenerator diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql index 233d5a58f46..9787ebb01a0 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql @@ -8,4 +8,3 @@ query GetPeople { } } } - diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj index 88d278192cf..5f8ea8d476f 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj @@ -11,7 +11,7 @@ - + From fbfbc14c9ba580061e91a73ccaedee5e60e4b33e Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Wed, 7 Apr 2021 15:49:09 +0200 Subject: [PATCH 3/4] only write persisted queries if changed --- .../CSharpClientGenerator.cs | 12 +- .../SingleFileDocumentWriter.cs | 6 +- ...ake.CodeGeneration.CSharp.Analyzers.csproj | 2 +- .../StarWarsClient.StrawberryShake.cs | 114 ++++++++++++++---- .../StarWars/ChatGetPeople.graphql | 1 + ...deGeneration.CSharp.Analyzers.Tests.csproj | 2 +- 6 files changed, 105 insertions(+), 32 deletions(-) diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs index 62ea035ebf7..9b44cdeae05 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/CSharpClientGenerator.cs @@ -20,6 +20,7 @@ namespace StrawberryShake.CodeGeneration.CSharp.Analyzers public class CSharpClientGenerator : ISourceGenerator { private const string _category = "StrawberryShakeGenerator"; + private readonly MD5DocumentHashProvider _hashProvider = new(); private static string _location = System.IO.Path.GetDirectoryName( typeof(CSharpClientGenerator).Assembly.Location)!; @@ -155,14 +156,13 @@ private void WriteGraphQLQuery( string documentName = document.Hash + ".graphql"; string fileName = IOPath.Combine(persistedQueryDirectory, documentName); - context.Log.WriteDocument(documentName); - - if (File.Exists(fileName)) + // we only write the file if it does not exist to not trigger + // dotnet watch. + if (!File.Exists(fileName)) { - File.Delete(fileName); + context.Log.WriteDocument(documentName); + File.WriteAllText(fileName, document.SourceText, Encoding.UTF8); } - - File.WriteAllText(fileName, document.SourceText, Encoding.UTF8); } private void Clean(ClientGeneratorContext context) diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs index 4a41c7903d9..87efafe5515 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/SingleFileDocumentWriter.cs @@ -64,9 +64,11 @@ public void Flush() string currentHash = _hashProvider.ComputeHash( Encoding.UTF8.GetBytes(_content.ToString())); + bool fileExists = File.Exists(_fileName); + // we only write the file if it has changed so we do not trigger a loop on // dotnet watch. - if (!currentHash.Equals(hash, StringComparison.Ordinal)) + if (!fileExists || !currentHash.Equals(hash, StringComparison.Ordinal)) { string directory = IOPath.GetDirectoryName(_fileName); @@ -75,7 +77,7 @@ public void Flush() Directory.CreateDirectory(directory); } - if (File.Exists(_fileName)) + if (fileExists) { File.Delete(_fileName); } diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj index 2ebacf6fd85..2d615013bd3 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs index 5a074a669b2..31465ffe2c7 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/.generated/StarWarsClient.StrawberryShake.cs @@ -144,7 +144,10 @@ public GetPeopleResult(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.T /// /// Gets access to all the people known to this service. /// - public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? People { get; } + public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? People + { + get; + } public override global::System.Boolean Equals(global::System.Object? obj) { @@ -216,7 +219,10 @@ public GetPeople_People_PersonConnection(global::System.Collections.Generic.IRea /// /// A flattened list of the nodes. /// - public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } + public global::System.Collections.Generic.IReadOnlyList? Nodes + { + get; + } public override global::System.Boolean Equals(global::System.Object? obj) { @@ -291,13 +297,25 @@ public GetPeople_People_Nodes_Person(global::System.String name, global::System. LastSeen = lastSeen; } - public global::System.String Name { get; } + public global::System.String Name + { + get; + } - public global::System.String Email { get; } + public global::System.String Email + { + get; + } - public global::System.Boolean IsOnline { get; } + public global::System.Boolean IsOnline + { + get; + } - public global::System.DateTimeOffset LastSeen { get; } + public global::System.DateTimeOffset LastSeen + { + get; + } public override global::System.Boolean Equals(global::System.Object? obj) { @@ -360,7 +378,10 @@ public interface IGetPeopleResult /// /// Gets access to all the people known to this service. /// - public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? People { get; } + public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeople_People? People + { + get; + } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator @@ -373,7 +394,10 @@ public interface IGetPeople_People /// /// A flattened list of the nodes. /// - public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } + public global::System.Collections.Generic.IReadOnlyList? Nodes + { + get; + } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator @@ -389,13 +413,25 @@ public interface IGetPeople_People_PersonConnection : IGetPeople_People [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] public interface IGetPeople_People_Nodes { - public global::System.String Name { get; } + public global::System.String Name + { + get; + } - public global::System.String Email { get; } + public global::System.String Email + { + get; + } - public global::System.Boolean IsOnline { get; } + public global::System.Boolean IsOnline + { + get; + } - public global::System.DateTimeOffset LastSeen { get; } + public global::System.DateTimeOffset LastSeen + { + get; + } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultInterfaceGenerator @@ -432,10 +468,20 @@ private GetPeopleQueryDocument() { } - public static GetPeopleQueryDocument Instance { get; } = new GetPeopleQueryDocument(); + public static GetPeopleQueryDocument Instance + { + get; + } + + = new GetPeopleQueryDocument(); public global::StrawberryShake.OperationKind Kind => global::StrawberryShake.OperationKind.Query; public global::System.ReadOnlySpan Body => new global::System.Byte[0]; - public global::StrawberryShake.DocumentHash Hash { get; } = new global::StrawberryShake.DocumentHash("md5Hash", "22e3b8ba92883af43c70567c7d1cf143"); + public global::StrawberryShake.DocumentHash Hash + { + get; + } + + = new global::StrawberryShake.DocumentHash("md5Hash", "22e3b8ba92883af43c70567c7d1cf143"); public override global::System.String ToString() { #if NETSTANDARD2_0 @@ -557,7 +603,10 @@ public StarWarsClient(global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Te [global::System.CodeDom.Compiler.GeneratedCode("StrawberryShake", "11.0.0")] public interface IStarWarsClient { - global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleQuery GetPeople { get; } + global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.IGetPeopleQuery GetPeople + { + get; + } } // StrawberryShake.CodeGeneration.CSharp.Generators.TransportProfileEnumGenerator @@ -583,13 +632,25 @@ public PersonEntity(global::System.String name, global::System.String email, glo LastSeen = lastSeen; } - public global::System.String Name { get; } + public global::System.String Name + { + get; + } - public global::System.String Email { get; } + public global::System.String Email + { + get; + } - public global::System.Boolean IsOnline { get; } + public global::System.Boolean IsOnline + { + get; + } - public global::System.DateTimeOffset LastSeen { get; } + public global::System.DateTimeOffset LastSeen + { + get; + } } // StrawberryShake.CodeGeneration.CSharp.Generators.ResultDataFactoryGenerator @@ -693,7 +754,10 @@ public GetPeopleResultInfo(global::StrawberryShake.CodeGeneration.CSharp.Analyze /// /// Gets access to all the people known to this service. /// - public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData? People { get; } + public global::StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.State.PersonConnectionData? People + { + get; + } public global::System.Collections.Generic.IReadOnlyCollection EntityIds => _entityIds; public global::System.UInt64 Version => _version; @@ -887,12 +951,18 @@ public PersonConnectionData(global::System.String __typename, global::System.Col Nodes = nodes; } - public global::System.String __typename { get; } + public global::System.String __typename + { + get; + } /// /// A flattened list of the nodes. /// - public global::System.Collections.Generic.IReadOnlyList? Nodes { get; } + public global::System.Collections.Generic.IReadOnlyList? Nodes + { + get; + } } // StrawberryShake.CodeGeneration.CSharp.Generators.EntityIdFactoryGenerator diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql index 9787ebb01a0..233d5a58f46 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql @@ -8,3 +8,4 @@ query GetPeople { } } } + diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj index 5f8ea8d476f..281e9db3345 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj @@ -11,7 +11,7 @@ - + From 071bfcb47c8c1368f8a4124adff47320940312dd Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Wed, 7 Apr 2021 15:51:40 +0200 Subject: [PATCH 4/4] Fixed infinite loop cycles when running dotnet watch --- .../StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj | 2 +- .../StarWars/ChatGetPeople.graphql | 1 - ...StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj index 2d615013bd3..6506eca7f2a 100644 --- a/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj +++ b/src/StrawberryShake/SourceGenerator/src/CodeGeneration.CSharp.Analyzers/StrawberryShake.CodeGeneration.CSharp.Analyzers.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql index 233d5a58f46..9787ebb01a0 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StarWars/ChatGetPeople.graphql @@ -8,4 +8,3 @@ query GetPeople { } } } - diff --git a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj index 281e9db3345..05fbd45101c 100644 --- a/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj +++ b/src/StrawberryShake/SourceGenerator/test/CodeGeneration.CSharp.Analyzers.Tests/StrawberryShake.CodeGeneration.CSharp.Analyzers.Tests.csproj @@ -11,7 +11,7 @@ - +