-
Notifications
You must be signed in to change notification settings - Fork 0
Feat integrate ast grep #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR finalizes the integration of ast-grep as Thread's core AST analysis layer, implementing significant refactoring to establish a clean foundation for Thread-specific features. The changes focus on modernizing the language system, optimizing performance, and improving code organization while maintaining backward compatibility.
- Comprehensive refactoring of the language system with feature-gated language support and enhanced documentation
- Performance optimizations including cached parser initialization and SIMD-accelerated operations
- Infrastructure improvements with new development tools and streamlined build processes
Reviewed Changes
Copilot reviewed 53 out of 56 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update-licenses.py | Adds new command for updating only missing license files with JSON output processing |
| scripts/llm-edit.sh | New multi-file editing script with parallel processing and styled output |
| scripts/get-langs.sh | Fixes array syntax issues in shell script |
| scripts/README-llm-edit.md | Documentation for the new multi-file editing system |
| sbom.spdx | Major SPDX regeneration reflecting project restructuring |
| mise.toml | Adds new development tools and shell aliases |
| hk.pkl | Minor formatting cleanup |
| crates/rule-engine/src/rule_core.rs | Updates Pattern constructor call to use reference |
| crates/rule-engine/src/rule/relational_rule.rs | Updates Pattern and KindMatcher constructors to use references |
| crates/rule-engine/src/rule/referent_rule.rs | Updates Pattern constructor to use reference |
| crates/rule-engine/src/label.rs | Updates Pattern constructor calls to use references |
| crates/rule-engine/src/fixer.rs | Updates KindMatcher constructor to use reference |
| crates/language/src/ruby.rs | Updates Pattern constructor to use reference |
| crates/language/src/profiling.rs | Adds documentation for memory profiling utilities |
| crates/language/src/parsers.rs | Major refactoring with feature-gated parsers and comprehensive documentation |
| crates/language/src/lib.rs | Complete overhaul with feature-gated language support and enhanced API |
Comments suppressed due to low confidence (1)
crates/language/src/lib.rs:743
- Incorrect feature attribute - line 763 should use
#[cfg(feature = "java")]not#[cfg(feature = "json")]for the Java language match arm.
match $me {
| S::Scala => Scala.$method($($pname,)*), | ||
| #[cfg(feature = "swift")] | ||
| S::Swift => Swift.$method($($pname,)*), | ||
| #[cfg(feature = "typescript")] |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect feature attribute - line 785 should use #[cfg(feature = "tsx")] not #[cfg(feature = "typescript")] for the Tsx language match arm.
| #[cfg(feature = "typescript")] | |
| #[cfg(feature = "tsx")] |
| S::Scala => Scala.$method($($pname,)*), | ||
| #[cfg(feature = "swift")] | ||
| S::Swift => Swift.$method($($pname,)*), | ||
| #[cfg(feature = "typescript")] |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect feature attribute - line 786 should use #[cfg(feature = "typescript")] not #[cfg(feature = "typescript")] for the TypeScript language match arm. This appears correct but should be verified against the enum definition.
| #[cfg(feature = "typescript")] | |
| #[cfg(feature = "tsx")] |
| "tsx" => return Some(SupportLang::Tsx), | ||
| "py" | "py3" | "pyi" => return Some(SupportLang::Python), | ||
| "java" => return Some(SupportLang::Java), | ||
| #[cfg(feature = "bash")] |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The bash extension pattern is overly complex with many hardcoded values. Consider extracting this to a constant or using a more maintainable approach.
| } | ||
| #[cfg(feature = "c")] | ||
| "c" | "h" => return Some(SupportLang::C), | ||
| #[cfg(feature = "csharp")] |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect feature attribute - this should be #[cfg(feature = "cpp")] for cpp/cc/cxx extensions, not csharp.
| #[cfg(feature = "csharp")] | |
| #[cfg(feature = "cpp")] |
Finalized (for now) ast-grep integration as the core layer of Thread. Prepares the library for Thread-specific feature development