Skip to content

Commit bbf0646

Browse files
committed
fix: fix missing entries in migration table
Members that were renamed without their containing type being renamed were missing. For instance: `STKEngine.StartApplication(...)`.
1 parent 3eab493 commit bbf0646

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

doc/source/conf.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,17 @@ def render_migration_table(app: sphinx.application.Sphinx):
644644
type_old_name = type_mapping.get("OldName")
645645
type_new_name = type_mapping.get("NewName")
646646
mappings[type_old_name] = {"new_name": type_new_name, "members": {}}
647-
member_mappings = root.findall(f'./Mapping[@ParentScope="{type_old_name}"]')
648-
for member_mapping in member_mappings:
649-
member_old_name = member_mapping.get("OldName")
650-
member_new_name = member_mapping.get("NewName")
651-
mappings[type_old_name]["members"][member_old_name] = member_new_name
647+
648+
member_categories = ["enum_value", "method"]
649+
for member_category in member_categories:
650+
method_mappings = root.findall(f'./Mapping[@Category="{member_category}"]')
651+
for method_mapping in method_mappings:
652+
type_old_name = method_mapping.get("ParentScope")
653+
member_old_name = method_mapping.get("OldName")
654+
member_new_name = method_mapping.get("NewName")
655+
if not type_old_name in mappings:
656+
mappings[type_old_name] = {"new_name": type_old_name, "members": {}}
657+
mappings[type_old_name]["members"][member_old_name] = member_new_name
652658

653659
json_file = xml_file.parent / "main.json"
654660
json_file.write_text(json.dumps(mappings, indent=4))

0 commit comments

Comments
 (0)