Commit edd60a8
authored
feat(native): port Solidity extractor to Rust (#1100)
* feat(native): port Solidity extractor to Rust
Adds tree-sitter-solidity dependency and native extractor matching
the WASM-side behavior for Solidity symbol, import, and call extraction.
Part of #1071
* fix(extractors): emit class relation for every Solidity parent
`extract_inheritance` / `extractInheritance` previously called
`find_child(node, 'inheritance_specifier')` and stopped at the first
match, but the tree-sitter-solidity grammar models each parent in
`contract A is B, C, D { }` as a separate `inheritance_specifier`
sibling under the contract node (`_class_heritage: "is"
commaSep1($.inheritance_specifier)`). All parents past the first were
silently dropped on both the native and WASM paths.
Walk every direct child of the contract node and emit a ClassRelation
for each parent on both engines, and add multi-parent unit tests in
Rust and TypeScript to lock the behaviour in.
* fix: update native-drop test for cu still unsupported (#1100)1 parent aa7812b commit edd60a8
12 files changed
Lines changed: 700 additions & 14 deletions
File tree
- crates/codegraph-core
- src
- extractors
- src
- ast-analysis/rules
- domain
- extractors
- tests/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 | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
397 | 407 | | |
398 | 408 | | |
399 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
141 | 145 | | |
142 | 146 | | |
0 commit comments