Skip to content

[CodeCompletion] Fix issue in which parts of a result builder were incorrectly skipped #70898

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

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jan 12, 2024

getLoc does not necesarrily return the start location of the location (e.g. for a.b().c() it returns the location of c because that’s the location of the call). But we used the location from getLoc as the start location of the synthesized buildExpression call. In the added test case, this means that the buildExpression call only contained everlay() {} and not the code completion token. We thus infered that we could skip it the entire MyStack {}.pnTabGesture {}.everlay() {} call for code completion, which isn’t correct.

rdar://120798355

…correctly skipped

`getLoc` does not necesarrily return the start location of the location (e.g. for `a.b().c()` it returns the location of `c` because that’s the location of the call). But we used the location from `getLoc` as the start location of the synthesized `buildExpression` call. In the added test case, this means that the `buildExpression` call only contained `everlay() {}` and not the code completion token. We thus infered that we could skip it the entire `MyStack {}.pnTabGesture {}.everlay() {}` call for code completion, which isn’t correct.

rdar://120798355
@ahoppen
Copy link
Member Author

ahoppen commented Jan 12, 2024

@swift-ci Please smoke test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants