Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Tauri LSP server by introducing robust cross-type diagnostics and improved type information extraction. It adds new modules for parsing generated TypeScript bindings and extracting Rust command schemas, enabling the server to validate Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and valuable feature: cross-type diagnostics between the Rust backend and TypeScript/JavaScript frontend. It achieves this by adding parsers for various binding generators (tauri-specta, ts-rs, tauri-typegen) and a system to extract type information from Rust source code. This new type information is then used to provide diagnostics for mismatched arguments and return types in invoke calls. The implementation is extensive, adding new modules for configuration reading, bindings parsing, and Rust type extraction. The changes are well-structured and include a good number of tests. My review focuses on improving the robustness of the parsing logic in a few edge cases.
165c3b1 to
89e8cd4
Compare
There was a problem hiding this comment.
Code Review
This is a substantial and impressive pull request that adds a whole new layer of type-aware diagnostics and intelligence to the language server. The introduction of parsers for generated bindings, schema extraction from Rust source, and the integration into diagnostics, code actions, and hovers is a significant feature enhancement. The code is generally well-structured, with new responsibilities cleanly separated into new modules. I have one major point of feedback regarding the manual parsing of TOML configuration, which should be addressed to improve robustness.
Note: Security Review is unavailable for this PR.
There was a problem hiding this comment.
Code Review
This is an impressive pull request that introduces comprehensive cross-language type diagnostics for Tauri commands and events. The implementation is robust, leveraging tree-sitter for accurate parsing and a new configuration reader to automatically detect generated bindings from various tools like tauri-specta, ts-rs, and tauri-typegen. The code is well-structured with new features organized into dedicated modules and is accompanied by extensive tests, which is great to see. I have one suggestion to further enhance the new diagnostics by adding validation for the number of arguments in Specta-style command calls, which seems to be a missing piece in the current implementation.
Note: Security Review did not run due to the size of the PR.
Parse event schemas from tauri-specta (__makeEvents__ blocks) and tauri-typegen (listen<T>('event-name') patterns) binding files, with
Rust source as optional fallback. Emit HINT for missing <T> on emit/listen calls and WARNING for payload type mismatches, with quick-fix code actions to insert or replace the generic type argument
discover_specta looked for .export( and the path in the window to the first ), but in a multi-line call, the first ) was inside BigIntExportBehavior::Number), not the closing paren of .export(...)
…en's generated code, not types
…with the toml crate
…ties
- Fix stale RustSource schemas: clear command_schemas and event_schemas
before re-extracting when a Rust file changes (bug: renamed/deleted
commands left orphaned entries forever)
- Targeted diagnostic_info_cache invalidation: replace full .clear()
with per-key removal on file changes (perf: avoid wiping entire cache
every 300ms during typing)
- Unified Rust parse pass: new parse_rust_full() creates one Parser +
one tree, then runs findings/command/event queries sequentially
(perf: 3 parse calls → 1 per Rust file change)
- Consolidate LSP utilities: move point_to_position,
is_position_in_range, lsp_character_to_byte_index into utils.rs
- Deduplicate bracket matchers: replace 4 specialized functions with
generic find_matching_bracket() and find_matching_paren_with_generics()
…s, enforce clippy
- Move utils tests from src/ #[cfg(test)] to tests/utils_tests.rs per project rules
- Replace manual .contains("ts-rs") Cargo.toml check with proper toml crate parsing
- Replace unwrap_promise_result/extract_ok_type bracket tracking with tree-sitter node walking
- Extract 8 inline tree-sitter queries to dedicated .scm files loaded via include_str!
- Remove 11 crate-level #![allow(clippy::...)] from main.rs; fix warnings or add item-level allows
0ac5c70 to
bc1bd1b
Compare
Add parser support for tauri-specta's typed event Converts camelCase event property names to kebab-case using new camel_to_kebab utility. Uses standard Emit/Listen behaviors so all existing capabilities (CodeLens, navigation, hover, references, diagnostics) work automatically.
- Remove `detect_generator_kind()` fallback — binding files are now
discovered exclusively via config-based parsing
- Add `discover_specta_typescript()` for standalone specta-typescript
crate (`Typescript::default().export_to("path", &types)`)
- Add tree-sitter query pattern for `export_to` (path as first arg)
- Update tests to use `set_generator_bindings()` instead of fallback
- Simplify README type generation section
There was a problem hiding this comment.
Code Review
This is an impressive and substantial pull request that introduces cross-language type diagnostics, a major new feature. The implementation is well-structured, introducing new modules for parsing bindings, reading configurations, and extracting type information from Rust code. The use of tree-sitter has been expanded and made more robust, and the core indexer is thoughtfully updated to support the new schemas. The addition of comprehensive tests is also commendable. I've found a couple of areas for improvement: a potential bug in the manual parsing of Rust generic types and a minor performance optimization opportunity in the indexing logic. Overall, this is a high-quality contribution.
Note: Security Review did not run due to the size of the PR.
…arg with extract_first_generic_arg_from_type
…n (it's now a HashSet)
No description provided.