fix(ast-engine): restore Language::from_path regression tests#107
Conversation
… commits Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Restores regression tests and clarifies the documented contract for Language::from_path in thread-ast-engine, ensuring the default “unimplemented” (panic) behavior and an overridden (non-panicking) implementation remain verified going forward.
Changes:
- Tightened
Language::from_pathrustdoc to explicitly document that the default implementation panics. - Reintroduced tests covering both the default (panic) and overridden (returns
Option)from_pathbehaviors. - Extracted small shared TSX/tree-sitter helpers to reduce duplication across test language impls.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…o copilot/sub-pr-103-again Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
c148107
into
fix-rule-not-found-deserialize-9177764991747379115
|
👋 Hey @copilot, Thanks for your contribution to thread! 🧵You need to agree to the CLA first... 🖊️Before we can accept your contribution, you need to agree to our Contributor License Agreement (CLA). To agree to the CLA, please comment:
Those exact words are important1, so please don't change them. 😉 You can read the full CLA here: Contributor License Agreement ✅ @copilot has signed the CLA. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. Footnotes
|
Tests for
Language::from_pathpanic behavior were removed in a prior cleanup commit (a79e527) and never restored, leaving the contract untested despite the implementation being correct.Changes
crates/ast-engine/src/language.rsNoFromPathandTsxWithFromPathtest structs covering the un-overridden (panics) and overridden (returnsOption) casesdefault_from_path_panicsandoverridden_from_path_does_not_panicteststsx_kind_to_id,tsx_field_to_id,tsx_ts_language) to reduce duplication across test implsfrom_pathdoc comment to explicitly document the panic-on-unimplemented contract✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.