mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Cherry-pick of #2223, merged as 45534b0b90
**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