8000 Split defining packages apart from imports/exports by jez · Pull Request #8840 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Split defining packages apart from imports/exports #8840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 7, 2025

Conversation

jez
Copy link
Collaborator
@jez jez commented May 6, 2025

Motivation

This is more similar to the way that namer is split, with three phases:

  1. findSymbols
  2. defineSymbols
  3. symbolizeTrees

If we're going to use namer to enter packages, we need to model that a bit more closely. In particular, we won't be able to resolve the imports of a package until the symbolizeTrees phase, which means we need to split defining packages and populating the imports.

This is all the no-op prework to get us closer, but there are more changes coming.

Test plan

Existing tests.

@jez jez requested a review from a team as a code owner May 6, 2025 23:35
@jez jez requested review from elliottt and removed request for a team May 6, 2025 23:35
Copy link
Collaborator
@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think there's a missing unfreeze of the name table, and took a guess at where it might need to be.

setPackageNameOnFiles(gs, files);

{
auto packages = gs.unfreezePackages();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to unfreeze the name table here as well, as populatePackageEdges will potentially introduce new names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I got this confused when I extracted it from another branch I'm working on where I stop creating MangledNames for packages that don't exist, meaning that resolving import and visible_to lines doesn't require entering new names

I'll add it back to this and make a note to delete it eventually.

@jez jez enabled auto-merge (squash) May 7, 2025 20:59
@jez jez merged commit 58b6d91 into master May 7, 2025
14 checks passed
@jez jez deleted the jez-split-define-package branch May 7, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0