-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SourceKit NameLookup] Don't walk into inactive clauses. #28038
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
[SourceKit NameLookup] Don't walk into inactive clauses. #28038
Conversation
@swift-ci please smoke test |
@nathawes This PR addresses the issue by not walking into inactive clauses. I realize that this fix may reduce the utility of SourceKit in these cases. Is this limitation acceptable? If not, I see two alternatives:
So, please take a gander at this PR and let me know what you think. Thanks! |
40cac39
to
b071e5f
Compare
@nathawes Never mind--I think this fix is too draconian. Let me see what I can come up with. |
b071e5f
to
2078945
Compare
@swift-ci please smoke test |
@nathawes OK, I've got something that just forestalls the problematic lookups. If it tests acceptably, I think it's good. Check it out and let me know. Tx. |
@swift-ci please smoke test osx platform |
@swift-ci please clean smoke test os x platform |
lib/IDE/SyntaxModel.cpp
Outdated
if (auto *repr = ED->getExtendedTypeRepr()) | ||
NSR = repr->getSourceRange(); | ||
if (!inInactiveClause || ASTScope::areInactiveIfConfigClausesSupported()) { | ||
if (auto *repr = ED->getExtendedTypeRepr()) |
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.
Retrieving the type representation should be purely syntactic; I don't think this change should be needed.
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.
The compiler crashes without it. Help me out here: what would be a better fix?
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.
@DougGregor Thanks to @nathawes , I realized that I completely misunderstood your comment here. I've removed this change. Thanks for your help and patience.
2078945
to
faa0d50
Compare
@swift-ci please smoke test |
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.
LGTM - thanks for fixing it!
faa0d50
to
cd95ddb
Compare
@swift-ci please smoke test |
@swift-ci please smoke test os x platform |
@swift-ci please clean smoke test os x platform |
Don't do lookups in inactive #if clauses as long as ASTScopes do not support them.
Addresses rdar://56760957