mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
committed by
GitHub
parent
531c2e8868
commit
0cfc56ec04
@@ -35,7 +35,8 @@ class Context {
|
||||
public:
|
||||
Context(StringRef RuntimeLibPath,
|
||||
llvm::function_ref<
|
||||
std::unique_ptr<LangSupport>(Context &)> LangSupportFactoryFn);
|
||||
std::unique_ptr<LangSupport>(Context &)> LangSupportFactoryFn,
|
||||
bool shouldDispatchNotificationsOnMain = true);
|
||||
~Context();
|
||||
|
||||
StringRef getRuntimeLibPath() const { return RuntimeLibPath; }
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#define LLVM_SOURCEKIT_CORE_NOTIFICATIONCENTER_H
|
||||
|
||||
#include "SourceKit/Core/LLVM.h"
|
||||
#include "llvm/Support/Mutex.h"
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
@@ -23,9 +24,14 @@ typedef std::function<void(StringRef DocumentName)>
|
||||
DocumentUpdateNotificationReceiver;
|
||||
|
||||
class NotificationCenter {
|
||||
bool DispatchToMain;
|
||||
std::vector<DocumentUpdateNotificationReceiver> DocUpdReceivers;
|
||||
mutable llvm::sys::Mutex Mtx;
|
||||
|
||||
public:
|
||||
explicit NotificationCenter(bool dispatchToMain);
|
||||
~NotificationCenter();
|
||||
|
||||
void addDocumentUpdateNotificationReceiver(
|
||||
DocumentUpdateNotificationReceiver Receiver);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user