diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 98d0dd1..43efa59 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -55,6 +55,7 @@ function supported_tokens() : array 'cs_propget_interface', 'cs_propset_interface', 'cs_propgetset_interface', + 'cs_obsolete', //TODO: //'i18n' ]; diff --git a/tpl/codegen_bundle.twig b/tpl/codegen_bundle.twig index 4a4e8b8..122d1a9 100644 --- a/tpl/codegen_bundle.twig +++ b/tpl/codegen_bundle.twig @@ -1,6 +1,7 @@ //THIS FILE IS GENERATED AUTOMATICALLY, DO NOT TOUCH IT! using System.Collections.Generic; using metagen; +using System; {%- import "macro.twig" as macro -%} diff --git a/tpl/macro.twig b/tpl/macro.twig index d1e65ce..e8bba25 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -188,6 +188,12 @@ ResetFieldMask(); {% endmacro %} {%- macro attributes(o) %} +{% if has_token(o, "cs_obsolete") %} +/// +/// {{token(o, "cs_obsolete")}} +/// +[Obsolete] +{% endif %} {%- if has_token(o, 'cs_attributes') -%} {%- for attr in token(o, 'cs_attributes')|split(',') -%} [{{attr}}]