mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-09 22:31:08 +00:00
feat: add test declarations support in typescript tree-sitter queries (#1899)
Add parsing support for:
- Jest describe/test/it blocks
- npm test exports
This enables proper identification of test definitions in TypeScript files:
```
// File: multi-search-replace.test.ts (192 definitions)
│| 2 - 1565 ||describe("MultiSearchReplaceDiffStrategy", () => {
│| 3 - 632 || describe("exact matching", () => {
│| 10 - 28 || it("should replace matching content", async () => {
|| ||----
│| 30 - 48 || it("should match content with different surrounding whitespace", async () => {
|| ||----
│| 50 - 68 || it("should match content with different indentation in search block", async () => {
|| ||----
│| 70 - 88 || it("should handle tab-based indentation", async () => {
|| ||----
```
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
This commit is contained in:
parent
15338ed76a
commit
187979af2b
1 changed files with 15 additions and 0 deletions
|
|
@ -29,4 +29,19 @@ export default `
|
|||
|
||||
(class_declaration
|
||||
name: (type_identifier) @name.definition.class) @definition.class
|
||||
|
||||
(call_expression
|
||||
function: (identifier) @func_name
|
||||
arguments: (arguments
|
||||
(string) @name
|
||||
[(arrow_function) (function_expression)]) @definition.test)
|
||||
(#match? @func_name "^(describe|test|it)$")
|
||||
|
||||
(assignment_expression
|
||||
left: (member_expression
|
||||
object: (identifier) @obj
|
||||
property: (property_identifier) @prop)
|
||||
right: [(arrow_function) (function_expression)]) @definition.test
|
||||
(#eq? @obj "exports")
|
||||
(#eq? @prop "test")
|
||||
`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue