-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion] Fix issue causing the completion status to not be set correctly for pattern completion #38559
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
Conversation
@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.
A little unfortunate that this is needed, but looks good to me!
Hmm, there's a guard not to call So if
is true, there must be something wrong in |
Apparently, |
An interesting test case is protocol P {
var value: Int { get }
}
struct S: P {
let foo = val, #COMPLETE^#
} We want to offer |
d1deae4
to
f6ef7cb
Compare
Thanks a lot, @rintaro, there was indeed a simpler fix to just set the code completion status correctly in pattern parsing. I updated the PR accordingly. |
@swift-ci Please smoke test |
…t correctly for pattern completion We weren’t setting the code completion token status correctly when parsing patterns with code completion tokens. Because of this, in the added test case, the `searchSubject` gets added as a member of `Foo` twice - once in the first pass and once in the second pass, causing an assertion failure. Fixes rdar://80575116 [SR-14687]
f6ef7cb
to
fec7f6c
Compare
@swift-ci Please smoke test |
@swift-ci Please smoke test macOS |
1 similar comment
@swift-ci Please smoke test macOS |
We weren’t setting the code completion token status correctly when parsing patterns with code completion tokens.
Because of this, in the added test case, the
searchSubject
gets added as a member ofFoo
twice - once in the first pass and once in the second pass, causing an assertion failure.Fixes rdar://80575116 [SR-14687]