| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…keyword collectExportedDeclarations/collect_exported_var_declarations computed a single export line from the wrapping export_statement node and applied it to every branch, while the matching Definition row for that declaration is built from the declaration's own node (or, for a function-valued declarator, the function value's own node, per #2265). Whenever export and its declaration start on different lines -- valid JS, since ASI doesn't apply between export and its declaration -- the two rows diverged and the exported=1 UPDATE (matched by name/kind/file/line, #1728) silently never fired. Each branch now sources its line from the same node its own Definition already uses, mirrored across both engines. Closes #2293 Impact: 3 functions changed, 0 affected
Greptile SummaryThe PR aligns JavaScript export metadata lines with the AST nodes used to create matching definitions.
Confidence Score: 5/5The PR appears safe to merge, with the changed export-line calculations matching their corresponding definition-line calculations across both engines. The TypeScript and Rust implementations consistently select declaration nodes for named and constant definitions and function-value nodes for function-valued definitions, while the added tests cover the affected multiline cases. Important Files Changed
Reviews (1): Last reviewed commit: "fix(extractors): export line matches the..." | Re-trigger Greptile |
Sorry, something went wrong.
Codegraph Impact Analysis3 functions changed → 7 callers affected across 1 files
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Note on scope
While writing regression tests, found that a bare export\n<declaration> (the issue's own illustrative repro) doesn't actually reach this code at all — tree-sitter-javascript fails to parse a newline-separated bare export followed by a declaration keyword as a single export_statement, silently dropping the export relationship entirely (worse than a line mismatch). That's an upstream grammar limitation, filed separately as #2459 — not addressed here. This PR's tests use export default/multi-binding export const reproductions, which the grammar does parse correctly across multiple lines, to exercise the actual line-computation fix.
Closes #2293
Test plan