-
-
Notifications
You must be signed in to change notification settings - Fork 862
refactor(semantic): directly record current_node_id when adding a scope
#4265
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,7 +121,7 @@ impl TraverseScoping { | |
| /// `flags` provided are amended to inherit from parent scope's flags. | ||
| pub fn create_scope_child_of_current(&mut self, flags: ScopeFlags) -> ScopeId { | ||
| let flags = self.scopes.get_new_scope_flags(flags, self.current_scope_id); | ||
| self.scopes.add_scope(Some(self.current_scope_id), flags) | ||
| self.scopes.add_scope(Some(self.current_scope_id), AstNodeId::dummy(), flags) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this will result in multiple scopes having the same node ID (0), is this a bug in the logic?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can answer this one. So... long story short... This is part of what I hope to look at when I review |
||
| } | ||
|
|
||
| /// Insert a scope into scope tree below a statement. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not
self.current_node_idhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I guess we could do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please feel free to submit a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't build semantic for
.d.tsfile now. So we haven't current_node_id. We may need to build semantic ford.tsin the future. Rolldown needs this to bundle types to one entry point.