Skip to content

codegen: resolve language chooser markup in generated SDKs (currently only XML-escaped) #1023

Description

@pose

Context

Consumer half of pulumi/pulumi#16099, under epic pulumi/home#4787. pulumi-dotnet's gen-sdk codegen does not resolve the per-language chooser markup (<span pulumi-lang-*> / <!--Start PulumiCodeChooser -->…<!--End PulumiCodeChooser -->) that bridged-provider schemas carry in description / deprecationMessage:

  • Doc comments: printCommentprintCommentWithOptions(escape=true) runs docCommentEscaper (pulumi-language-dotnet/codegen/gen.go, ~lines 480–507), which XML-escapes </> — so the chooser is emitted as &lt;span pulumi-lang-…&gt; in the /// <summary> rather than resolved to the C# token.
  • Deprecation: [Obsolete(@"...DeprecationMessage...")] (gen.go ~896–897, 1192–1193, 1436–1437) emits the raw message (only """ escaping), so chooser markup there is emitted literally.
  • Comments are filtered via the shared codegen.FilterExamples(r.Comment, "csharp") (examples-only; does not resolve the chooser).

Note: pulumi/ci-mgmt#2240 measured ".NET 0" because it grepped for the literal <span; the doc-comment XML-escaping hides it from that grep, but the markup is still present and diverges from the bridge's resolved output.

Acceptance criteria

  • Generated C# /// <summary> docs and [Obsolete(...)] deprecation strings resolve the chooser to the C# token (and code-chooser blocks to the C# example), matching the bridge tfgen output — no &lt;span pulumi-lang-…&gt; and no literal <span …>.
  • Applied to both description and deprecationMessage at every level (package, resource, function, type, property, enum value).
  • Covered by a codegen test using a chooser-bearing schema.

Prior art: pulumi-terraform-bridge/pkg/tfgen/schemafilter.FilterSchemaByLanguage (field-agnostic, handles both markup forms).

Part of pulumi/home#4787.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions