Skip to content

Conversation

@hamishknight
Copy link
Contributor

6.3 cherry-pick of part of #85952

  • Explanation: Fixes a SourceKit crash that could occur when attempting to retrieve the semantic tokens of a SourceFile that uses a body macro
  • Scope: Affects SourceKit semantic tokens
  • Issue: rdar://165420658, LSP crashes on file that uses attached macro #85705
  • Risk: Low, only affects SourceKit, and the fix applies existing logic in more cases
  • Testing: Added tests to test suite
  • Reviewer: TBD

Make sure we don't ever try to record semantic tokens for a different
buffer. This works around an ASTWalker issue where it will walk macro
expanded bodies even in non-macro-expansion mode.

rdar://165420658
@hamishknight hamishknight requested a review from a team as a code owner December 10, 2025 20:51
@hamishknight hamishknight added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.3 labels Dec 10, 2025
@hamishknight
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

Thanks!

@hamishknight hamishknight merged commit 5ddeac2 into swiftlang:release/6.3 Dec 11, 2025
5 checks passed
@hamishknight hamishknight deleted the skip-body-macro-6.3 branch December 11, 2025 11:06
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 6.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants