@@ -31,28 +31,30 @@ namespace llvm {
31
31
namespace SourceKit {
32
32
class LangSupport ;
33
33
class NotificationCenter ;
34
-
35
- class GlobalConfig {
36
- public:
37
- struct Settings {
38
- struct IDEInspectionOptions {
39
-
40
- // / Max count of reusing ASTContext for cached IDE inspection.
41
- unsigned MaxASTContextReuseCount = 100 ;
42
-
43
- // / Interval second for checking dependencies in cached IDE inspection.
44
- unsigned CheckDependencyInterval = 5 ;
45
- } IDEInspectionOpts;
46
- };
47
-
48
- private:
49
- Settings State;
50
- mutable llvm::sys::Mutex Mtx;
51
-
52
- public:
53
- Settings update (std::optional<unsigned > IDEInspectionMaxASTContextReuseCount,
54
- std::optional<unsigned > IDEInspectionCheckDependencyInterval);
55
- Settings::IDEInspectionOptions getIDEInspectionOpts () const ;
34
+ class PluginSupport ;
35
+
36
+ class GlobalConfig {
37
+ public:
38
+ struct Settings {
39
+ struct IDEInspectionOptions {
40
+
41
+ // / Max count of reusing ASTContext for cached IDE inspection.
42
+ unsigned MaxASTContextReuseCount = 100 ;
43
+
44
+ // / Interval second for checking dependencies in cached IDE inspection.
45
+ unsigned CheckDependencyInterval = 5 ;
46
+ } IDEInspectionOpts;
47
+ };
48
+
49
+ private:
50
+ Settings State;
51
+ mutable llvm::sys::Mutex Mtx;
52
+
53
+ public:
54
+ Settings
55
+ update (std::optional<unsigned > IDEInspectionMaxASTContextReuseCount,
56
+ std::optional<unsigned > IDEInspectionCheckDependencyInterval);
57
+ Settings::IDEInspectionOptions getIDEInspectionOpts () const ;
56
58
};
57
59
58
60
// / Keeps track of all requests that are currently in progress and coordinates
@@ -169,13 +171,16 @@ class Context {
169
171
std::shared_ptr<NotificationCenter> NotificationCtr;
170
172
std::shared_ptr<GlobalConfig> Config;
171
173
std::shared_ptr<RequestTracker> ReqTracker;
174
+ std::shared_ptr<PluginSupport> Plugins;
172
175
std::shared_ptr<SlowRequestSimulator> SlowRequestSim;
173
176
174
177
public:
175
178
Context (StringRef SwiftExecutablePath, StringRef RuntimeLibPath,
176
179
StringRef DiagnosticDocumentationPath,
177
180
llvm::function_ref<std::unique_ptr<LangSupport>(Context &)>
178
181
LangSupportFactoryFn,
182
+ llvm::function_ref<std::shared_ptr<PluginSupport>(Context &)>
183
+ PluginSupportFactoryFn,
179
184
bool shouldDispatchNotificationsOnMain = true );
180
185
~Context ();
181
186
@@ -192,6 +197,8 @@ class Context {
192
197
193
198
std::shared_ptr<GlobalConfig> getGlobalConfiguration () { return Config; }
194
199
200
+ std::shared_ptr<PluginSupport> getPlugins () { return Plugins; }
201
+
195
202
std::shared_ptr<SlowRequestSimulator> getSlowRequestSimulator () {
196
203
return SlowRequestSim;
197
204
}
0 commit comments