Repository navigation
Conversation
Signed-off-by: Antonio Espinosa <antespi@gmail.com>
Signed-off-by: Antonio Espinosa <antespi@gmail.com>
Named re-exports (export { a as b } from './m') and star re-exports
(export * from './m') are now recorded as re-export imports instead of
one module-level import. JS and TS call resolution uses the cross-file
import map, so a call through a barrel file reaches the function's
defining file, renames included.
Builds on the index.ts barrel commit from DeusData#2402. Covers the rename and
export * cases in DeusData#2718 and DeusData#1557.
Signed-off-by: chidev <chicagowebdev@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
The barrel walker kept a visited set of file QNs. A barrel with both
`export * from './m'` and `export { a as b } from './m'` searched m for
`b` through the star edge first, marked m visited, and then skipped m
when the renamed edge asked for `a`. The call to `b` got no edge.
The visited set is now keyed on (file QN, name). Each key is an owned
string stored as its own value and freed with the table.
Tested: new lrp_ts_barrel_star_and_renamed_same_module fails before
(renamed=0) and passes after.
Suites extraction_imports, edge_imports, path_alias, mcp,
lsp_resolution_probe: 626 passed, 4 skipped. The issue repro binds both
calls at 0.95.
Signed-off-by: chidev <chicagowebdev@gmail.com>
Formats the changed lines with clang-format 20.1.8, drops a condition that is always true (pass_calls.c), and narrows the scope of public_name (pass_lsp_cross.c), as the lint job reported. Signed-off-by: chidev <chicagowebdev@gmail.com>
The memory-core lint gate counted new raw allocator sites in the re-export commits (pass_calls.c 22 -> 28, pass_lsp_cross.c 49 -> 61). - The barrel walker now returns the graph node it reaches, borrowed for the life of the graph buffer, instead of a strdup'd QN. The import map stores that node's QN through the existing pxc_import_value_qn copy. - File and symbol lookups use cbm_pipeline_file_node and a stack-built symbol QN (cbm_pipeline_fqn_symbol_prefix_len), so they allocate nothing. - The visited-set keys are allocated and freed with cbm_alloc/cbm_free (CBM_MEM_CLASS_OTHER). - pass_calls keeps the JS/TS cross-file map as built and frees it with cbm_pxc_free_import_map, instead of copying it into a borrowed array. Both files are back at their baseline counts. Signed-off-by: chidev <chicagowebdev@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calls through
index.tsre-exports now reach the function's defining file. This covers renamed named re-exports (export { a as b } from './m') andexport *chains, the cases in #2718 and #1557.Credit
The first two commits are @antespi's from #2402 (index.ts barrels, dotted file names). I kept his authorship and sign-off unchanged. On October 4 you asked for #2402 to be split into focused PRs. This PR is only the barrel part, plus one commit of mine for renames and
export *. @antespi, if you would rather land these yourself, I will close this PR. It only builds on your work.One claim
This PR changes only TS/JS re-export resolution. It does not include the bare-specifier binding reported in #2869, and it does not change MCP output.
Reproduction
repro.sh(below) writes 6 files: a renamed re-export, anexport *chain, and a decoy file with the same names. It uses its own cache and runtime folders.main (812d075):
this branch:
repro.sh
Tests
New cases in
tests/test_extraction_imports.candtests/test_lsp_resolution_probe.c. On macOS arm64:scripts/test.sh --suites extraction_imports,edge_imports,path_alias,mcp,lsp_resolution_probegives 625 passed, 4 skipped. The only failure in a wider run isregex_compile_refuses_overlong_pattern, which fails on main too (#2899).Every commit is signed off. I have not seen CI on Linux or Windows yet.