[SourceKit] If diagnostics are 'stale' for a particular snapshot then ignore them and only return the syntactic parser diagnostics (#10388)

This makes sure that diagnostics returned for a particular state of source buffer are consistent and accurate.
rdar://32769873
This commit is contained in:
Argyrios Kyrtzidis
2017-06-20 12:26:32 -07:00
committed by GitHub
parent 531c2e8868
commit 0cfc56ec04
12 changed files with 337 additions and 191 deletions

View File

@@ -18,8 +18,9 @@ using namespace SourceKit;
SourceKit::Context::Context(StringRef RuntimeLibPath,
llvm::function_ref<std::unique_ptr<LangSupport>(Context &)>
LangSupportFactoryFn) : RuntimeLibPath(RuntimeLibPath),
NotificationCtr(new NotificationCenter()) {
LangSupportFactoryFn,
bool shouldDispatchNotificationsOnMain) : RuntimeLibPath(RuntimeLibPath),
NotificationCtr(new NotificationCenter(shouldDispatchNotificationsOnMain)) {
// Should be called last after everything is initialized.
SwiftLang = LangSupportFactoryFn(*this);
}