Skip to content

Commit

Permalink
fix: update_schema.py doesn't work for pyright 1.1.367
Browse files Browse the repository at this point in the history
The "$id" has been removed in microsoft/pyright@4b84651

Traceback (most recent call last):
  File "D:\jfcherng\Desktop\repos\my\LSP-pyright\scripts\update_schema.py", line 116, in <module>
    main()
  File "D:\jfcherng\Desktop\repos\my\LSP-pyright\scripts\update_schema.py", line 40, in main
    new_schema_keys = sorted(update_schema(sublime_package_schema_json, pyrightconfig_schema_json))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\jfcherng\Desktop\repos\my\LSP-pyright\scripts\update_schema.py", line 88, in update_schema
    update_property_ref(override_key, override_value, pyrightconfig_properties)
  File "D:\jfcherng\Desktop\repos\my\LSP-pyright\scripts\update_schema.py", line 111, in update_property_ref
    pyrightconfig_property_id: str = pyrightconfig_properties[property_key]["$id"]
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: '$id'

Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Jun 12, 2024
1 parent 2823ab5 commit 02e1597
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/update_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def update_schema(sublime_package_json: JsonDict, pyrightconfig_schema_json: Jso

def update_property_ref(property_key: str, property_schema: JsonDict, pyrightconfig_properties: JsonDict) -> None:
property_schema.clear()
pyrightconfig_property_id: str = pyrightconfig_properties[property_key]["$id"]
property_schema["$ref"] = PYRIGHTCONFIG_SCHEMA_ID + pyrightconfig_property_id
property_schema["$ref"] = f'{PYRIGHTCONFIG_SCHEMA_ID}#/properties/{property_key}'


if __name__ == "__main__":
Expand Down

0 comments on commit 02e1597

Please sign in to comment.