pulumi/pkg/codegen/dotnet
Zaid Ajaj a1112c878e
[dotnet/sdk-gen] Fixes potential conflicts when generating resources called System (#14011)
# Description

When generating a C# package that has a resource called `System`, it
fails to compile when we fully qualify
`System.Diagnostics.CodeAnalysis.SuppressMessage` in the generated
`Config.cs` file since it thinks that `System.Diagnostics` is referring
to a static class on the `System` resource definition.

The fix is to prefix the attribute with `global::` so that type
resolution works as expected.

## Checklist

- [ ] I have run `make tidy` to update any new dependencies
- [ ] I have run `make lint` to verify my code passes the lint check
  - [ ] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left
unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the
`changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the
Pulumi Cloud,
then the service should honor older versions of the CLI where this
change would not exist.
You must then bump the API version in
/pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi
Cloud API version
<!-- @Pulumi employees: If yes, you must submit corresponding changes in
the service repo. -->
2023-09-22 13:41:15 +00:00
..
gen_program_test all: gofmt -w -s 2023-01-10 19:03:24 -08:00
doc.go all: Drop //nolint:goconst 2023-03-09 11:15:21 -08:00
doc_test.go sdk/go: Remove 'nolint' directives from package docs 2023-01-06 09:06:47 -08:00
gen.go [dotnet/sdk-gen] Fixes potential conflicts when generating resources called System (#14011) 2023-09-22 13:41:15 +00:00
gen_intrinsics.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
gen_program.go Add localDependencies option to GenerateProject 2023-08-08 12:28:19 +01:00
gen_program_expressions.go Fixes list initializer for plain lists in resource properties 2023-08-07 18:43:37 +02:00
gen_program_test.go Remove dotnet 2022-12-13 16:13:53 +00:00
gen_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
git_ignore.go Add GenerateProject to codegen (#9475) 2022-04-29 17:04:04 +01:00
importer.go Respect schema versions (toggled via flag) (#8881) 2022-02-03 17:07:13 +01:00
templates.go Remove UseSharedCompilation from .csproj codegen 2023-06-09 23:37:10 +01:00
test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
utilities.go Add "NotImplemented" PCL function intrinsic 2023-03-10 12:14:28 +01:00
utilities_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00