refactor: unify type discovery and improve Rust type parsing#39
Open
ap-apely wants to merge 3 commits into
Open
refactor: unify type discovery and improve Rust type parsing#39ap-apely wants to merge 3 commits into
ap-apely wants to merge 3 commits into
Conversation
… are applied. Added support for `snake_case` keys in `tauri.conf.json` so `project_path` actually works. * **Enum Type Discovery**: Fixed the analyzer to recursively find and generate types used inside enum variants (tuple and struct styles). * **Rust Type Parsing**: Added support for module-qualified names (`std::collections::HashMap`), slices (`[u8]`), and fixed arrays (`[u8; 32]`). * **Lifetime Filtering**: Updated the parser to strip out lifetimes like `'a` from generic arguments, preventing `unknown` types in TypeScript. * **Event Deduplication**: Generators now deduplicate events by name so you don't get multiple listeners for the same event string. * **Path Handling**: Switched skip-logic for `target` and `.git` folders to use proper path components instead of string matching. * **Cleaned Up Generators**: Centralized all type discovery logic into a single method, removing redundant manual loops from both TS and Zod generators.
…initions across nested modules
Owner
|
Hi @ap-apely thank you for the contribution! Would you please create an issue, too, describing the problem your change fixes? After that, I'll pick it up for the next version. |
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.
Previously, some valid Rust types were not parsed correctly.
For example:
Issues:
Another case:
Issues:
These cases are now handled correctly.