Commit 29ad42a
committed
fix(extractors): align JS ObjC engine with native for v3 grammar (#1106)
The v3 tree-sitter-objc grammar emits flat 'identifier' + 'method_parameter'
children directly under method nodes (no 'keyword_selector' wrapper) and
nests property names under 'struct_declaration > struct_declarator >
[pointer_declarator >] identifier' rather than exposing a 'name' field. The
JS extractor was still following the old grammar shape, which silently
dropped multi-keyword method definitions, never populated parameter
children, and omitted all '@Property' members from class children.
- buildSelector: assemble selector from flat 'identifier'+'method_parameter'
children directly under the method node, matching build_selector in
crates/codegraph-core/src/extractors/objc.rs.
- extractMethodParams: iterate 'method_parameter' children directly and use
the last 'identifier' child as the parameter name (mirrors
extract_method_params in the Rust extractor).
- collectClassMembers: extract '@Property' names via a deep identifier walk
under 'struct_declaration > struct_declarator' (mirrors
extract_property_name in the Rust extractor).
Added three regression tests covering keyword method definitions with
parameters, and pointer + non-pointer '@Property' member names.1 parent b64a886 commit 29ad42a
2 files changed
Lines changed: 100 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
372 | 374 | | |
| 375 | + | |
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
388 | 383 | | |
389 | 384 | | |
390 | | - | |
| 385 | + | |
| 386 | + | |
391 | 387 | | |
392 | 388 | | |
393 | 389 | | |
| |||
440 | 436 | | |
441 | 437 | | |
442 | 438 | | |
443 | | - | |
| 439 | + | |
444 | 440 | | |
445 | | - | |
| 441 | + | |
446 | 442 | | |
447 | 443 | | |
448 | 444 | | |
449 | 445 | | |
450 | 446 | | |
451 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
452 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
453 | 483 | | |
454 | 484 | | |
455 | 485 | | |
456 | | - | |
| 486 | + | |
| 487 | + | |
457 | 488 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
469 | 498 | | |
470 | 499 | | |
471 | 500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
93 | 133 | | |
0 commit comments