Skip to content

[5.9] [SourceKit] Include generated macro buffers in diagnostic responses #65582

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 6 commits into from
May 3, 2023

Conversation

hamishknight
Copy link
Contributor

5.9 cherry-pick of #65472

  • Explanation: Adds generated buffers to SourceKit diagnostic responses, and fixes an incorrect filepath for some notes in Clang headers
  • Scope: Affects SourceKit diagnostic responses
  • Issues: rdar://107281079, rdar://107952288
  • Risk: Low/Medium, the change does involve some refactoring, but should only add additional information to the SourceKit response, except in the cases impacted by rdar://107281079, where we adjust the filepath for ClangImporter notes to point to the correct location.
  • Testing: Added tests to the test suite
  • Reviewer: Alex Hoppen, Ben Barham

@hamishknight hamishknight added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9 labels May 2, 2023
@hamishknight hamishknight requested a review from airspeedswift May 2, 2023 12:47
@hamishknight hamishknight requested a review from a team as a code owner May 2, 2023 12:47
DougGregor and others added 6 commits May 2, 2023 16:25
Use this to simplify the writing of ranges into
SourceKit responses.
This could cause us to double up on the same note
for nested macro expansions, as we'd generate the
note, then when recursing back through the function
we'd compute the same note again. Also remove the
seemingly unused `lastBufferID` param.
Introduce a new key `generated_buffers`, which
stores an array of generated buffers. These
include the buffer text, as well as its original
location and any parent buffers.

While here, also fix rdar://107281079 such that
only apply the filename fallback logic to the
pretty-printed Decl case. We ought to remove this
fallback once the editor can handle it though.

rdar://107281079
rdar://107952288
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 0670d6f into swiftlang:release/5.9 May 3, 2023
@hamishknight hamishknight deleted the buffering-5.9 branch May 3, 2023 09:04
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 swift 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants