diff --git a/scripts/cxx-api/parser/member/variable_member.py b/scripts/cxx-api/parser/member/variable_member.py index 8c456f6c1e1..403af09eae4 100644 --- a/scripts/cxx-api/parser/member/variable_member.py +++ b/scripts/cxx-api/parser/member/variable_member.py @@ -111,6 +111,8 @@ class VariableMember(Member): result += f"{qualified_type} (*{name})({formatted_args})" else: result += f"{format_parsed_type(self._parsed_type)} {name}" + if self.argstring: + result += self.argstring if STORE_INITIALIZERS_IN_SNAPSHOT and self.value is not None: if self.is_brace_initializer: diff --git a/scripts/cxx-api/tests/snapshots/should_handle_array_variable/snapshot.api b/scripts/cxx-api/tests/snapshots/should_handle_array_variable/snapshot.api new file mode 100644 index 00000000000..fd3f119e956 --- /dev/null +++ b/scripts/cxx-api/tests/snapshots/should_handle_array_variable/snapshot.api @@ -0,0 +1 @@ +const char test::ViewComponentName[]; diff --git a/scripts/cxx-api/tests/snapshots/should_handle_array_variable/test.h b/scripts/cxx-api/tests/snapshots/should_handle_array_variable/test.h new file mode 100644 index 00000000000..cf1624f6b91 --- /dev/null +++ b/scripts/cxx-api/tests/snapshots/should_handle_array_variable/test.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +namespace test { + +const char ViewComponentName[] = "View"; + +} // namespace test