Commit c12bb60
committed
fix(fsharp): restore dual function_type/curried_spec detection for val (#1162)
The npm and cargo tree-sitter-fsharp 0.3.0 grammars — though sharing a
version tag — still emit type signatures with different node shapes:
WASM 0.3.0 produces `function_type` directly under `value_definition`,
while cargo 0.3.0 wraps every signature in `curried_spec` with
`arguments_spec` children for function types.
#1165 removed the `function_type` branch on the assumption that both
grammars had converged at v0.3.0, which broke WASM extraction: every
`val name : a -> b` declaration was being indexed as a `variable`
instead of a `function`. Restore the dual-shape detection in the
TypeScript extractor and update the documentation accordingly.
Also clarifies the nested-module test comment in fsharp-signature.test
to reflect that the WASM signature grammar is now at v0.3.0 but still
emits ERROR nodes for `module Foo = ...` (the fix is still pending,
tracked under #1161).1 parent 02cd2f1 commit c12bb60
3 files changed
Lines changed: 37 additions & 19 deletions
File tree
- crates/codegraph-core/src/extractors
- src/extractors
- tests/parsers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
324 | 332 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
330 | 346 | | |
| 347 | + | |
331 | 348 | | |
332 | 349 | | |
333 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
0 commit comments