@@ -31,28 +31,30 @@ namespace llvm {
3131namespace SourceKit {
3232 class LangSupport ;
3333 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 ;
5658};
5759
5860// / Keeps track of all requests that are currently in progress and coordinates
@@ -169,13 +171,16 @@ class Context {
169171 std::shared_ptr<NotificationCenter> NotificationCtr;
170172 std::shared_ptr<GlobalConfig> Config;
171173 std::shared_ptr<RequestTracker> ReqTracker;
174+ std::shared_ptr<PluginSupport> Plugins;
172175 std::shared_ptr<SlowRequestSimulator> SlowRequestSim;
173176
174177public:
175178 Context (StringRef SwiftExecutablePath, StringRef RuntimeLibPath,
176179 StringRef DiagnosticDocumentationPath,
177180 llvm::function_ref<std::unique_ptr<LangSupport>(Context &)>
178181 LangSupportFactoryFn,
182+ llvm::function_ref<std::shared_ptr<PluginSupport>(Context &)>
183+ PluginSupportFactoryFn,
179184 bool shouldDispatchNotificationsOnMain = true );
180185 ~Context ();
181186
@@ -192,6 +197,8 @@ class Context {
192197
193198 std::shared_ptr<GlobalConfig> getGlobalConfiguration () { return Config; }
194199
200+ std::shared_ptr<PluginSupport> getPlugins () { return Plugins; }
201+
195202 std::shared_ptr<SlowRequestSimulator> getSlowRequestSimulator () {
196203 return SlowRequestSim;
197204 }
0 commit comments