Skip to content

Commit d76e77b

Browse files
abradymeta-codesync[bot]
authored andcommitted
Use includes_for_codegen to filter annotations
Summary: Addresses reviewer feedback (hchok) on D94439428 — removes the fragile `is_annotation?` string-contains check (`ns.find("Annotation")`) and replaces it with a `codegen_includes` property on the `t_program` prototype that uses the canonical `t_program::get_includes_for_codegen()` method. This is consistent with how other Thrift generators filter annotation includes. Reviewed By: vitaut Differential Revision: D94711724 fbshipit-source-id: cfb7af3af656c5c8b9d34dae345fc1c77b90b968
1 parent e0cd171 commit d76e77b

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • third-party/thrift/src/thrift/compiler/generate/templates/csharp

third-party/thrift/src/thrift/compiler/generate/templates/csharp/module.mustache

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
}}
1717
{{#import "types/enum" as enum_tmpl}}
1818
{{> common/file_header}}
19-
{{#each root_program.includes as |inc|}}
19+
{{#each root_program.includes_for_codegen as |inc|}}
2020
{{#if inc.is_useful_alias?}}
21-
{{! Skip annotation includes - they are compile-time only metadata, not runtime types }}
22-
{{#if (not inc.is_annotation?)}}
2321
using {{inc.alias}} = {{inc.csharp_namespace}};
24-
{{/if (not inc.is_annotation?)}}
2522
{{/if inc.is_useful_alias?}}
2623
{{/each}}
2724

0 commit comments

Comments
 (0)