Commit 44a3505
authored
feat(native): port R extractor to Rust (#1102)
* feat(native): port R extractor to Rust
Adds tree-sitter-r dependency and native extractor matching
the WASM-side behavior for R symbol, import, and call extraction.
Part of #1071
* fix(native): include .r in NATIVE_SUPPORTED_EXTENSIONS
The drift guard test expects parity between NATIVE_SUPPORTED_EXTENSIONS
(JS-side) and from_extension in parser_registry.rs (Rust-side). After
this PR added native R support, .r was missing from the JS-side set,
causing the drift guard test to fail.
Also updates the classifyNativeDrops tests that previously assumed .r
was unsupported by native — those tests now correctly assert that
.R/.r files dropped by the native engine indicate an extractor failure,
not a parser-limit gap.
* fix(extractors): handle named arguments in R library() calls
Greptile flagged that `first_argument_value` (native) and
`handleLibraryCall` (WASM) both returned the first identifier child
inside an `argument` node, which for named arguments like
`library(package = dplyr)` returned `package` (the parameter name)
instead of `dplyr` (the value).
Fix in both engines together to preserve native/WASM parity:
- Prefer the field-named `value` child of the `argument` node, which
the tree-sitter-r grammar exposes explicitly for named arguments.
- Fall back to a positional child scan that skips any child reachable
via the `name` field, so positional grammar variants still work.
Two new tests cover the identifier and string-literal forms.
* chore: sync Cargo.lock with codegraph-core 3.10.0 from main
* fix: address lint format error in r.test.ts (#1102)
* fix: correct unsupported-native count after Clojure native port (#1102)
* chore: re-trigger CI (#1102)
* fix: bump EXPECTED_LEN to 28 after merging Julia + R
* fix(r-extractor): index-based quote strip preserves inner quote (#1102)
* test: exempt 3.10.0:Query time regression for #1102
Combined R + Solidity native ports trip the bench gate's 25% Query
time threshold (+110% native, 49.6 → 104ms) — neither PR caused this
individually. Tracked in #1113.
docs check acknowledged
* test: exempt 3.10.0:fnDeps depth 5 regression for #1102 merge1 parent 7eb7482 commit 44a3505
13 files changed
Lines changed: 603 additions & 11 deletions
File tree
- crates/codegraph-core
- src
- extractors
- src
- ast-analysis/rules
- domain
- extractors
- tests
- benchmarks
- parsers
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
407 | 418 | | |
408 | 419 | | |
409 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
| |||
0 commit comments