mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If a semantic update finishes fast enough, the token snapshot may be identical to the edit snapshot, but because of getBufferForSnapshot consolidating edits into a new buffer, we were not detecting that case properly, and it could cause an assertion failure (or potentially incorrect range shifting in a release build). This would have reproduced very rarely in practice, but I can reproduce it by putting `sleep(2)` calls right before we read the semantic info in open and edit requests. Incidentally, fix sourcekit-test and unit tests for the (rare) case where an open or edit already has updated semantic info.
9.7 KiB
9.7 KiB