Skip to content

Commit 5fb9af4

Browse files
KJ7LNWEric Wheeler
andauthored
feat: enhance Rust tree-sitter parser with advanced language structures (#2335)
* test: add comprehensive Rust Tree-sitter tests Add test suite for Rust language support in Tree-sitter: - Verify parsing of struct definitions - Verify parsing of method definitions within impl blocks - Verify parsing of standalone function definitions - Add tests for complex Rust structures - Include skipped debug test for future diagnostics These tests confirm the existing Rust support in Tree-sitter is working correctly and provide a foundation for future enhancements to the Rust parser. Signed-off-by: Eric Wheeler <[email protected]> * feat: enhance Rust tree-sitter parser with advanced language structures - Add support for additional Rust language structures: - Enum definitions - Trait definitions - Impl trait for struct - Generic structs with lifetime parameters - Macro definitions - Module definitions - Union types - Closures - Match expressions - Where clauses - Async functions - Impl blocks with generic parameters - Complex trait bounds - Update tests to verify capture of these structures - Modify debug helper to use environment variables Signed-off-by: Eric Wheeler <[email protected]> --------- Signed-off-by: Eric Wheeler <[email protected]> Co-authored-by: Eric Wheeler <[email protected]>
1 parent 5e0c9a7 commit 5fb9af4

File tree

3 files changed

+568
-2
lines changed

3 files changed

+568
-2
lines changed

src/services/tree-sitter/__tests__/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import * as path from "path"
55
import Parser from "web-tree-sitter"
66
import tsxQuery from "../queries/tsx"
77

8-
// Global debug flag - set to 0 to disable debug logging
9-
export const DEBUG = 0
8+
// Global debug flag - read from environment variable or default to 0
9+
export const DEBUG = process.env.DEBUG ? parseInt(process.env.DEBUG, 10) : 0
1010

1111
// Debug function to conditionally log messages
1212
export const debugLog = (message: string, ...args: any[]) => {

0 commit comments

Comments
 (0)