Skip to content

Conversation

@bashandbone
Copy link
Contributor

Finalized (for now) ast-grep integration as the core layer of Thread. Prepares the library for Thread-specific feature development

Copilot AI review requested due to automatic review settings July 20, 2025 20:47
@bashandbone bashandbone added documentation Improvements or additions to documentation enhancement New feature or request rust Pull requests that update rust code labels Jul 20, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jul 20, 2025

⚠️ No Changeset found

Latest commit: fbee7d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@bashandbone bashandbone merged commit 9a06970 into staging Jul 20, 2025
7 of 18 checks passed
Copy link

Copilot AI left a 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")]
Copy link

Copilot AI Jul 20, 2025

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.

Suggested change
#[cfg(feature = "typescript")]
#[cfg(feature = "tsx")]

Copilot uses AI. Check for mistakes.
S::Scala => Scala.$method($($pname,)*),
#[cfg(feature = "swift")]
S::Swift => Swift.$method($($pname,)*),
#[cfg(feature = "typescript")]
Copy link

Copilot AI Jul 20, 2025

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.

Suggested change
#[cfg(feature = "typescript")]
#[cfg(feature = "tsx")]

Copilot uses AI. Check for mistakes.
"tsx" => return Some(SupportLang::Tsx),
"py" | "py3" | "pyi" => return Some(SupportLang::Python),
"java" => return Some(SupportLang::Java),
#[cfg(feature = "bash")]
Copy link

Copilot AI Jul 20, 2025

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.

Copilot uses AI. Check for mistakes.
}
#[cfg(feature = "c")]
"c" | "h" => return Some(SupportLang::C),
#[cfg(feature = "csharp")]
Copy link

Copilot AI Jul 20, 2025

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.

Suggested change
#[cfg(feature = "csharp")]
#[cfg(feature = "cpp")]

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants