[release/6.0] Provide locations for src-gen diagnostic output (#61614)
authorLayomi Akinrinade <laakinri@microsoft.com>
Tue, 16 Nov 2021 18:09:58 +0000 (10:09 -0800)
committerGitHub <noreply@github.com>
Tue, 16 Nov 2021 18:09:58 +0000 (10:09 -0800)
commitfd61aefcf12382a9ddd24295f660b95606201d57
treeaf43e7f267def719565a7d9bb32e676be534381d
parent216555588c3b16a4a15388dbe784379016e98ad2
[release/6.0] Provide locations for src-gen diagnostic output (#61614)

* Provide locations for src-gen diagnostic output

* Fix tests and address feedback

* Add defensive check for context type location
src/libraries/System.Text.Json/gen/ContextGenerationSpec.cs
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs
src/libraries/System.Text.Json/gen/Reflection/FieldInfoWrapper.cs
src/libraries/System.Text.Json/gen/Reflection/PropertyInfoWrapper.cs
src/libraries/System.Text.Json/gen/Reflection/ReflectionExtensions.cs
src/libraries/System.Text.Json/gen/Reflection/TypeWrapper.cs
src/libraries/System.Text.Json/gen/TypeGenerationSpec.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs