Skip to content

[5.9][CodeCompletion] Enable SwiftParser parsing for code completion #65080

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Apr 11, 2023

cherry-pick #65078 into release/5.9

Explanation: The new SwiftSyntax parsing is required for macro expansion, but it was disabled for a source manager mode that has code completion token in the buffer. Because of that, any macro generated declarations weren't suggested in code completion. Enable SwiftParser parsing for code completion, but without the roundtrip/validation testing. With this change, macros are correctly expanded, and those introduced decls are correctly suggested in code completion
Scope: Code completion with macros
Risk: Low-Mid. This introduces a new thing to code completion, but it is well tested in other modes including compilation and SourceKit cursor info
Testing: Added a regression test case
Issues: rdar://107900870
Reviewers: Ben Barham (@bnbarham) Alex Hoppen (@ahoppen)

@rintaro rintaro requested a review from a team as a code owner April 11, 2023 22:25
@rintaro
Copy link
Member Author

rintaro commented Apr 11, 2023

@swift-ci Please test

rintaro added 2 commits April 11, 2023 17:39
But disable roundtrip/validation testing. So that macro expansions are
correctly performed in code completion, but avoid an assertion failure
caused by existence of null character in the source buffer.

rdar://107900870
(cherry picked from commit f9feee6)
@rintaro rintaro force-pushed the 5.9-ide-completion-rdar107900870 branch from f151173 to 9b10878 Compare April 12, 2023 00:40
@rintaro
Copy link
Member Author

rintaro commented Apr 12, 2023

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Apr 12, 2023

@swift-ci Please test Windows

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Apr 13, 2023

@swift-ci Please test Windows

@rintaro rintaro merged commit ae30e97 into swiftlang:release/5.9 Apr 13, 2023
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants