Apply the SourceWriter pattern to the STJ source generator. (#86526)
authorEirik Tsarpalis <eirik.tsarpalis@gmail.com>
Mon, 22 May 2023 17:30:34 +0000 (18:30 +0100)
committerGitHub <noreply@github.com>
Mon, 22 May 2023 17:30:34 +0000 (18:30 +0100)
commitc5cfd7b97f904e38c2d8daf28e8f2c99c8528603
tree1db6ea293eaec6e6d28964bf5b4aa77d6ce477f3
parentb380e2c07f6b8b191d39d646e3c6b0bac88d0f32
Apply the SourceWriter pattern to the STJ source generator. (#86526)

* Use the SourceWriter pattern in the STJ SG emitter.

* Make helper method static.

* Minimize the size of the generic helper method.
src/libraries/System.Text.Json/gen/Helpers/KnownTypeSymbols.cs
src/libraries/System.Text.Json/gen/Helpers/SourceWriter.cs [new file with mode: 0644]
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs
src/libraries/System.Text.Json/gen/Model/PropertyGenerationSpec.cs
src/libraries/System.Text.Json/gen/Model/PropertyInitializerGenerationSpec.cs
src/libraries/System.Text.Json/gen/Model/TypeGenerationSpec.cs
src/libraries/System.Text.Json/gen/System.Text.Json.SourceGeneration.targets