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

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

Issue 2463193002: Send analysis notifications after subscription. (Closed)
Patch Set: Created 4 years, 1 month 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/analyzer/lib/src/dart/analysis/driver.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 81bc1d947cf85edd4b437a0a666ebb155f496c57..292043a493a7e7de772790378db2056090967a3f 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -1106,7 +1106,20 @@ class AnalysisServer {
Map<AnalysisService, Set<String>> subscriptions) {
if (options.enableNewAnalysisDriver) {
this.analysisServices = subscriptions;
- // TODO(scheglov) send notifications for new files
+ Iterable<nd.AnalysisDriver> drivers = driverMap.values;
+ if (drivers.isNotEmpty) {
+ Set<String> allNewFiles =
+ subscriptions.values.expand((files) => files).toSet();
+ for (String file in allNewFiles) {
+ nd.AnalysisDriver driver = drivers.firstWhere(
+ (driver) => driver.isAddedFile(file),
+ orElse: () => drivers.first);
+ // The result will be produced by the "results" stream with
+ // the fully resolved unit, and processed with sending analysis
+ // notifications as it happens after content changes.
+ driver.getResult(file);
+ }
+ }
return;
}
// send notifications for already analyzed sources
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/analysis/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698