feat(provider): add compile-time registry

This commit is contained in:
csh
2025-12-21 22:21:46 +08:00
parent f54050bad2
commit 2c1c1d8a88
82 changed files with 751 additions and 1001 deletions
+17 -3
View File
@@ -128,9 +128,23 @@ def validate_responses(by_id: dict[str, dict]) -> None:
else:
assert_error_code(resolved, -32603, "completion resolve response")
assert_error_code(by_id["4"], -32601, "definition response")
assert_error_code(by_id["5"], -32601, "rename response")
assert_error_code(by_id["6"], -32601, "references response")
definition = by_id["4"]
assert_has_key(definition, "result", "definition response")
definition_result = definition["result"]
if definition_result is not None and not isinstance(definition_result, (dict, list)):
raise RuntimeError("definition response should be a location, list of locations, or null")
rename = by_id["5"]
assert_has_key(rename, "result", "rename response")
rename_result = rename["result"]
if rename_result is not None and not isinstance(rename_result, dict):
raise RuntimeError("rename response should be a workspace edit or null")
references = by_id["6"]
assert_has_key(references, "result", "references response")
references_result = references["result"]
if not isinstance(references_result, list):
raise RuntimeError("references response should be a list of locations")
shutdown = by_id["7"]
if "error" in shutdown: