| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analysis.server; | 5 library analysis.server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:core' hide Resource; | 9 import 'dart:core' hide Resource; |
| 10 import 'dart:math' show max; | 10 import 'dart:math' show max; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 * content cache for all contexts. | 250 * content cache for all contexts. |
| 251 */ | 251 */ |
| 252 final ContentCache overlayState = new ContentCache(); | 252 final ContentCache overlayState = new ContentCache(); |
| 253 | 253 |
| 254 /** | 254 /** |
| 255 * The plugins that are defined outside the analysis_server package. | 255 * The plugins that are defined outside the analysis_server package. |
| 256 */ | 256 */ |
| 257 List<Plugin> userDefinedPlugins; | 257 List<Plugin> userDefinedPlugins; |
| 258 | 258 |
| 259 /** | 259 /** |
| 260 * If the "analysis.analyzedFiles" notification is currently being subscribed |
| 261 * to (see [generalAnalysisServices]), and at least one such notification has |
| 262 * been sent since the subscription was enabled, the set of analyzed files |
| 263 * that was delivered in the most recently sent notification. Otherwise |
| 264 * `null`. |
| 265 */ |
| 266 Set<String> prevAnalyzedFiles; |
| 267 |
| 268 /** |
| 260 * Initialize a newly created server to receive requests from and send | 269 * Initialize a newly created server to receive requests from and send |
| 261 * responses to the given [channel]. | 270 * responses to the given [channel]. |
| 262 * | 271 * |
| 263 * If a [contextManager] is provided, then the [packageResolverProvider] will | 272 * If a [contextManager] is provided, then the [packageResolverProvider] will |
| 264 * be ignored. | 273 * be ignored. |
| 265 * | 274 * |
| 266 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are | 275 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are |
| 267 * propagated up the call stack. The default is true to allow analysis | 276 * propagated up the call stack. The default is true to allow analysis |
| 268 * exceptions to show up in unit tests, but it should be set to false when | 277 * exceptions to show up in unit tests, but it should be set to false when |
| 269 * running a full analysis server. | 278 * running a full analysis server. |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 * Implementation for `analysis.setGeneralSubscriptions`. | 972 * Implementation for `analysis.setGeneralSubscriptions`. |
| 964 */ | 973 */ |
| 965 void setGeneralAnalysisSubscriptions( | 974 void setGeneralAnalysisSubscriptions( |
| 966 List<GeneralAnalysisService> subscriptions) { | 975 List<GeneralAnalysisService> subscriptions) { |
| 967 Set<GeneralAnalysisService> newServices = subscriptions.toSet(); | 976 Set<GeneralAnalysisService> newServices = subscriptions.toSet(); |
| 968 if (newServices.contains(GeneralAnalysisService.ANALYZED_FILES) && | 977 if (newServices.contains(GeneralAnalysisService.ANALYZED_FILES) && |
| 969 !generalAnalysisServices | 978 !generalAnalysisServices |
| 970 .contains(GeneralAnalysisService.ANALYZED_FILES) && | 979 .contains(GeneralAnalysisService.ANALYZED_FILES) && |
| 971 isAnalysisComplete()) { | 980 isAnalysisComplete()) { |
| 972 sendAnalysisNotificationAnalyzedFiles(this); | 981 sendAnalysisNotificationAnalyzedFiles(this); |
| 982 } else if (!newServices.contains(GeneralAnalysisService.ANALYZED_FILES) && |
| 983 generalAnalysisServices |
| 984 .contains(GeneralAnalysisService.ANALYZED_FILES)) { |
| 985 prevAnalyzedFiles = null; |
| 973 } | 986 } |
| 974 generalAnalysisServices = newServices; | 987 generalAnalysisServices = newServices; |
| 975 } | 988 } |
| 976 | 989 |
| 977 /** | 990 /** |
| 978 * Set the priority files to the given [files]. | 991 * Set the priority files to the given [files]. |
| 979 */ | 992 */ |
| 980 void setPriorityFiles(String requestId, List<String> files) { | 993 void setPriorityFiles(String requestId, List<String> files) { |
| 981 // Note: when a file is a priority file, that information needs to be | 994 // Note: when a file is a priority file, that information needs to be |
| 982 // propagated to all contexts that analyze the file, so that all contexts | 995 // propagated to all contexts that analyze the file, so that all contexts |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 /** | 1565 /** |
| 1553 * The [PerformanceTag] for time spent in server request handlers. | 1566 * The [PerformanceTag] for time spent in server request handlers. |
| 1554 */ | 1567 */ |
| 1555 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 1568 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
| 1556 | 1569 |
| 1557 /** | 1570 /** |
| 1558 * The [PerformanceTag] for time spent in split store microtasks. | 1571 * The [PerformanceTag] for time spent in split store microtasks. |
| 1559 */ | 1572 */ |
| 1560 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 1573 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
| 1561 } | 1574 } |
| OLD | NEW |