Repository navigation
Resolve package self-imports, directory imports, and values over same-named types - #727
Open
jaywyawhare wants to merge 1 commit into
Open
jaywyawhare wants to merge 1 commit into
jaywyawhare wants to merge 1 commit into
Conversation
…lues over same-named types
4 tasks done
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.
Summary
Resolve three kinds of calls the indexer missed or got wrong: a package root importing itself by name, TypeScript imports of
.and.., and calls that linked to a type sharing its name with the function or const they call. Stacked on #724, which adds the corpus these figures come from.Implementation details
Decisions
__init__.pyalso resolves its modules under the root folder's own name, sofrom sanic.cli.app import SanicCLIworks withsanic/as the root. This is apackagesentry in the Python module table..and..in JS and TS imports count as relative and reach the folder's index file, the root folder included.tests/fixtures/code-self, drives tests in both SDKs and a newcode_selfconformance case.Results on the pinned corpus (precision / recall, %)
The other roots are unchanged. Python and TypeScript produce identical call edges on all 11 roots.
Validation
scripts/precheck.pypasses (215 changed lines, clean trial merge).Limits
The package name comes from the root folder's name only; parents outside the root are not consulted.
Linked issue
Closes #725
AI Assistance
AI tools helped write and test parts of this. I reviewed and ran every change.
Checklist
/approved.AGENTS.md). No new codes.Breaking changes
None. Some calls that resolved to nothing now get a
CALLSorCONSTRUCTSedge, and zod-style calls now link to the value instead of the same-named type.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.