Skip to content

Conversation

@MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Jul 29, 2025

Cherry-pick of #2223, merged as 45534b0
Explanation: When neovim detects a change of the document on-disk (eg. caused by git operations). It closes the document and re-opens it with the same document version but different contents. We didn’t clear the swift-syntax tree of a document when it was closed, so we re-used the old syntax tree for the re-opened document. Ensure we clear the syntax tree when the document is closed so we build a new tree when it is re-opened.
Scope: Limited to closeDocument notification.
Risk: Low due to limited scope, additional testing, and small size of the change.
Testing: Added an additional automated test case.
Issue: rdar://157046766
Reviewer: @bnbarham

@MaxDesiatov MaxDesiatov requested a review from a team as a code owner July 29, 2025 20:27
When neovim detects a change of the document on-disk (eg. caused by git operations). It closes the document and re-opens it with the same document version but different contents. We didn’t clear the swift-syntax tree of a document when it was closed, so we re-used the old syntax tree for the re-opened document. Ensure we clear the syntax tree when the document is closed so we build a new tree when it is re-opened.
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov added the bug Something isn't working label Jul 29, 2025
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) July 29, 2025 20:43
@bnbarham
Copy link
Contributor

@swift-ci please test Windows platform

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit d6ae933 into swiftlang:release/6.2 Jul 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants