We fulfilled the allDocumentsOpened expectation directly after dispatching the notification to open LibD.swift. This left a very short window in which LibB’s preparation could finish and LibC’s expectation could start before the open notification for LibD.swift was handled, causing an unexpected preparation of LibC.
We fulfilled the
allDocumentsOpened
expectation directly after dispatching the notification to open LibD.swift. This left a very short window in which LibB’s preparation could finish and LibC’s expectation could start before the open notification for LibD.swift was handled, causing an unexpected preparation of LibC.This fixes the issue first reported as rdar://129698768 and for which I added logging in https://github.com/apple/sourcekit-lsp/pull/1478.