-
Notifications
You must be signed in to change notification settings - Fork 213
fix Go-to-def fails on unreachable branches #1254 #1523
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
base: main
Are you sure you want to change the base?
Conversation
| /// Synthesize a static definition entry for `name` in the current scope if it | ||
| /// is missing. This is used when we deliberately analyze unreachable code for | ||
| /// IDE metadata; those code paths may not have been included in the up-front | ||
| /// static scan, so we add a lightweight placeholder on demand. | ||
| pub fn add_synthetic_definition(&mut self, name: &Name, range: TextRange) { |
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.
This feels a bit complicated to me. I wonder if a better alternative would be to just keep all defs in the very beginning when they are calculated, recording their unreachable status so downstream type checking logic would avoid emitting type errors for those instead.
8984cdf to
3e919fc
Compare
3e919fc to
3e93c31
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity for more than 2 weeks. If you are still working on this this pull request, please add a comment or push new commits to keep it active. Otherwise, please unassign yourself and allow someone else to take over. Thank you for your contributions! |
fix #1254
Added a suppression stack so binding code can execute unreachable branches without emitting type errors and exposed a helper to gate this behavior to filesystem/memory modules only, skipping
builtins/__builtins__.Updated the if binding logic to analyze statically false branches only when the new gate allows it, then discard their flow so control-flow facts stay unchanged while IDE features (like go-to-def) gain the needed Keys.