Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 2742343006: Formalizing the hacks letting the angular analyzer plugin run for now. (Closed)
Patch Set: Rename variable not method Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/context_manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ff6c0c95bac189f7d55e738455d8ff3bac4afedd 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>();
@@ -370,9 +382,8 @@ class AnalysisServer {
ResolverProvider packageResolverProvider: null,
bool useSingleContextManager: false,
this.rethrowExceptions: true})
- // TODO(brianwilkerson) Initialize notificationManager to
- // "new NotificationManager(channel, resourceProvider)"
- : notificationManager = null {
+ : notificationManager =
+ new NotificationManager(channel, resourceProvider) {
_performance = performanceDuringStartup;
defaultContextOptions.incremental = true;
defaultContextOptions.incrementalApi =
@@ -425,6 +436,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 +534,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 +1548,9 @@ class AnalysisServer {
driver.changeFile(file);
});
+ // temporary plugin support:
+ _onFileChangedController.add(file);
+
// 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 +2020,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);
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/context_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698