Repository navigation
fix(code-intel): make trace follow type-qualified call edges - #744
Merged
Merged
Conversation
trace walked the bare-name edges table, so every same-named method of a workspace merged into one node. trace Type::name now follows only calls made through that type in both directions, and every hop continues from the type of the node it reached (the qualifier of a call, the impl type of the calling method). Nodes report the type they were reached as, --strict drops calls whose type is unknown once a node has one, and bare-name traces behave as before. Also repairs the graph test module: a block of tests (the call helper, the exact-match caller tests and the type-qualified tests added with the call graph change) had ended up inside the raw-string fixture of the cross-crate dead-code test, so none of them was compiled or run. They sit after that test now, run, and the two that still used an old store_edges argument order were updated.
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.
What
cora trace Type::namefollows only calls made through that type, in both directions, and every hop continues from the type of the node it reached (the qualifier of a call, the impl type of the calling method). Nodes report the type they were reached as, and--strictdrops calls whose type is unknown once a node has one. Bare-name traces behave as before.callhelper, the exact-match caller tests and the type-qualified tests added with the call graph change) had ended up inside the raw-string fixture of the cross-crate dead-code test, so none of them was compiled or run. They now sit after that test and run. Two of them used an oldstore_edgesargument order and one new test reused identical rows, so both were corrected.Why
tracewalked the bare-name edges table, so same-named methods of different types were still merged after thecallersandimpactchange. Closes #743.Testing
--strict; on a fixture,trace WebSearchTool::from_env --direction incominglists 2 callers,WebFetchTool::from_env1, and the bare name 3.callersand typedimpacttests).cargo fmt --all -- --check,cargo clippy --all-targets --features tree-sitter -- -D warnings,cargo test --features tree-sitter,cora review --base origin/develop: no issues.