Chromium Code Reviews| Index: pkg/analysis_server/lib/src/analysis_server.dart |
| diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart |
| index 7f6e898b054328daef6bed83441396e5faf52f53..a3610231a5764fbb8601c52626795093b8db8e55 100644 |
| --- a/pkg/analysis_server/lib/src/analysis_server.dart |
| +++ b/pkg/analysis_server/lib/src/analysis_server.dart |
| @@ -336,6 +336,18 @@ class AnalysisServer { |
| nd.AnalysisDriverScheduler analysisDriverScheduler; |
| /** |
| + * This exists as a temporary stopgap for plugins, until the official plugin |
| + * API is complete. |
| + */ |
| + StreamController<String> _onFileAddedController; |
| + |
| + /** |
| + * This exists as a temporary stopgap for plugins, until the official plugin |
| + * API is complete. |
| + */ |
| + StreamController<String> _onFileChangedController; |
| + |
| + /** |
| * The set of the files that are currently priority. |
| */ |
| final Set<String> priorityFiles = new Set<String>(); |
| @@ -372,7 +384,8 @@ class AnalysisServer { |
| this.rethrowExceptions: true}) |
| // TODO(brianwilkerson) Initialize notificationManager to |
| // "new NotificationManager(channel, resourceProvider)" |
|
Brian Wilkerson
2017/03/13 21:00:22
You can delete the TODO comment now.
|
| - : notificationManager = null { |
| + : notificationManager = |
| + new NotificationManager(channel, resourceProvider) { |
| _performance = performanceDuringStartup; |
| defaultContextOptions.incremental = true; |
| defaultContextOptions.incrementalApi = |
| @@ -425,6 +438,10 @@ class AnalysisServer { |
| AnalysisEngine.instance.logger = new AnalysisLogger(this); |
| _onAnalysisStartedController = new StreamController.broadcast(); |
| _onFileAnalyzedController = new StreamController.broadcast(); |
| + // temporary plugin support: |
| + _onFileAddedController = new StreamController.broadcast(); |
| + // temporary plugin support: |
| + _onFileChangedController = new StreamController.broadcast(); |
| _onPriorityChangeController = |
| new StreamController<PriorityChangeEvent>.broadcast(); |
| running = true; |
| @@ -519,6 +536,20 @@ class AnalysisServer { |
| Stream get onFileAnalyzed => _onFileAnalyzedController.stream; |
| /** |
| + * The stream that is notified when a single file has been added. This exists |
| + * as a temporary stopgap for plugins, until the official plugin API is |
| + * complete. |
| + */ |
| + Stream get onFileAdded => _onFileAddedController.stream; |
| + |
| + /** |
| + * The stream that is notified when a single file has been changed. This |
| + * exists as a temporary stopgap for plugins, until the official plugin API is |
| + * complete. |
| + */ |
| + Stream get onFileChanged => _onFileChangedController.stream; |
| + |
| + /** |
| * The stream that is notified when priority sources change. |
| */ |
| Stream<PriorityChangeEvent> get onPriorityChange => |
| @@ -1519,6 +1550,9 @@ class AnalysisServer { |
| driver.changeFile(file); |
| }); |
| + // temporary plugin support: |
| + _onFileAddedController.add(file); |
|
Brian Wilkerson
2017/03/13 21:00:22
Should this be `_onFileChangedController`?
|
| + |
| // If the file did not exist, and is "overlay only", it still should be |
| // analyzed. Add it to driver to which it should have been added. |
| contextManager.getDriverFor(file)?.addFile(file); |
| @@ -1988,9 +2022,13 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks { |
| if (analysisDriver != null) { |
| changeSet.addedSources.forEach((source) { |
| analysisDriver.addFile(source.fullName); |
| + // temporary plugin support: |
| + analysisServer._onFileAddedController.add(source.fullName); |
| }); |
| changeSet.changedSources.forEach((source) { |
| analysisDriver.changeFile(source.fullName); |
| + // temporary plugin support: |
| + analysisServer._onFileChangedController.add(source.fullName); |
| }); |
| changeSet.removedSources.forEach((source) { |
| analysisDriver.removeFile(source.fullName); |