Replace JSON with XML as primary doc source#2
Merged
Conversation
- Fix CLI flag name (--godot-extension-api, not --api-json) - Add DocDatabase.loadFromXmlDir specification - Add builtin class detection strategy (hardcoded Variant type list) - Add enum extraction from XML constants with enum attribute - Specify godot-not-found error behavior - Specify cache sentinel (Object/index.md) - Note --no-xml / GDOC_NO_XML removal - Clarify @globalscope vs @GDscript collision handling - Fix: operator already exists in EntryKind, only constructor is new - Clarify test migration: JSON fixture tests deleted, not rewritten
- Fix tutorials listed as existing Entry field (it's new) - Rename utility_function to global_function (matches codebase) - Note Config.testing update for no_xml removal - Add cli/root.zig to removals list - Add markdownForSymbol signature change section - Make MemberDoc fields explicitly nullable with usage notes - Add replacement error-path test coverage
All XML <class> elements become EntryKind.class uniformly. Constructors and operators render via their own entry kinds.
- Merge Task 11 (CLI) into Task 12 (root.zig) since they can't compile independently - Move InvalidApiJson removal to Task 8 (alongside JSON deletion) - Fix error name in XML parse failure test (was referencing nonexistent error) - Add enum grouping test to Task 6 - Add operator rendering assertions to integration test - Add BBCode conversion test to Task 8 - Update signal parsing to reuse parseMethodElement for param capture - Renumber tasks 12-15 after merge
- Replace `builtin_class` with `constructor` in EntryKind enum - Add `inherits`, `qualifiers`, and `default_value` fields to Entry - Update all `.builtin_class` references to `.class` for compilation
Add loadFromXmlDir function that iterates a directory of Godot XML doc files and builds a complete symbol table with class entries, methods, properties, signals, constants (with enum grouping), constructors, and operators. Includes signature building helpers and dual-registration of @GlobalScope/@GDscript functions as top-level entries.
…lues Add inheritance line after heading in generateMarkdownForEntry. Add constructor and operator lists to generateMemberListings. Show qualifiers and default values in formatMemberLine. Add test for inheritance display in generated markdown.
Delete JSON-specific functions (loadFromJsonFileLeaky, loadFromJsonLeaky, parseClass, parseEntry, parseEntryArray, etc.), handler maps, RootState enum, InvalidApiJson error, and all JSON-based tests. Add BBCode-to-Markdown conversion in loadFromXmlDir for class and member descriptions.
Remove api.zig, the no_xml config field, getJsonCachePathInDir, xmlDocsArePopulated, mergeXmlDocs, fetchXmlDocs, and all JSON-direct-load codepaths. The cache rebuild flow now exclusively uses XML docs via DocDatabase.loadFromXmlDir. Update cacheIsPopulated to check xml_docs/.complete marker + Object/index.md sentinel. Remove godot-extension-api CLI flag and associated error handlers.
Add XML-to-markdown roundtrip integration test that verifies the full pipeline: XML parsing -> DocDatabase -> markdown cache -> readback. Add error-path tests for malformed XML skipping and symbol-not-found on an XML-loaded database.
ensureDirectoryExists used makeDirAbsolute which only creates a single directory level. After --clear-cache removes the entire cache tree, nested paths like cache/Node2D/ fail because the parent doesn't exist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
godot --dump-extension-api) with XML class documentation as the sole data sourceapi.zig, and the--godot-extension-apiCLI flagDocDatabase.loadFromXmlDirto build the symbol table directly from XML filesXmlDocParserto parse params, return types, qualifiers, constructors, operators, and enum-grouped constantsextension_api.json+Node/index.mdtoxml_docs/.complete+Object/index.mdTest plan
loadFromXmlDir(symbol table, enum grouping, @globalscope dual-registration)loadFromXmlDirzig build run -- Node2D,zig build run -- Vector2,zig build run -- sin🤖 Generated with Claude Code