-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Disable parse-time name lookup in swift-ide-test #34739
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
Disable parse-time name lookup in swift-ide-test #34739
Conversation
|
@swift-ci Please smoke test |
1 similar comment
|
@swift-ci Please smoke test |
rintaro
left a comment
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.
Looks great. Thank you!
lib/Parse/ParseGeneric.cpp
Outdated
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.
I think we can just return result here
include/swift/AST/GenericParamList.h
Outdated
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.
How about
if (WhereLoc.isInvalid())
return SourceRange();
if (Requirements.empty())
return WhereLoc;We have two ways of knowing if we're inside of an inactive #if clause. Refactor the only two places that called getScopeInfo().isInactiveConfigBlock() to check InInactiveClauseEnvironment instead. This removes the last remaining usage of Scope that's not related to parse-time name lookup.
Also, store the end location of the where clause explicitly, so that we can recover it even if there are no requirements. This fixes one of the failing tests when parser lookup is disabled in swift-ide-test by ensuring that the source range of the function extends to the end of the 'where' clause, even though the 'where' clause has a code completion token in it.
ca1e4a6 to
74e72a6
Compare
|
Thanks for the review, @rintaro! |
|
@swift-ci Please smoke test |
I have some leftover patches from my work on ASTScope. A couple of places that create an ASTContext without a CompilerInvocation still had parser lookup enabled; swift-ide-test is one of them.