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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 CompilationUnit dartUnit = | 995 CompilationUnit dartUnit = |
996 _getResolvedCompilationUnitToResendNotification(context, source); | 996 _getResolvedCompilationUnitToResendNotification(context, source); |
997 if (dartUnit != null) { | 997 if (dartUnit != null) { |
998 switch (service) { | 998 switch (service) { |
999 case AnalysisService.HIGHLIGHTS: | 999 case AnalysisService.HIGHLIGHTS: |
1000 sendAnalysisNotificationHighlights(this, file, dartUnit); | 1000 sendAnalysisNotificationHighlights(this, file, dartUnit); |
1001 break; | 1001 break; |
1002 case AnalysisService.OUTLINE: | 1002 case AnalysisService.OUTLINE: |
1003 AnalysisContext context = dartUnit.element.context; | 1003 AnalysisContext context = dartUnit.element.context; |
1004 LineInfo lineInfo = context.getLineInfo(source); | 1004 LineInfo lineInfo = context.getLineInfo(source); |
1005 sendAnalysisNotificationOutline(this, file, lineInfo, dartUnit); | 1005 SourceKind kind = context.getKindOf(source); |
| 1006 sendAnalysisNotificationOutline( |
| 1007 this, file, lineInfo, kind, dartUnit); |
1006 break; | 1008 break; |
1007 case AnalysisService.OVERRIDES: | 1009 case AnalysisService.OVERRIDES: |
1008 sendAnalysisNotificationOverrides(this, file, dartUnit); | 1010 sendAnalysisNotificationOverrides(this, file, dartUnit); |
1009 break; | 1011 break; |
1010 } | 1012 } |
1011 } | 1013 } |
1012 } | 1014 } |
1013 } | 1015 } |
1014 }); | 1016 }); |
1015 // remember new subscriptions | 1017 // remember new subscriptions |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 // When the client sends any change for a source, we should resend | 1216 // When the client sends any change for a source, we should resend |
1215 // subscribed notifications, even if there were no changes in the | 1217 // subscribed notifications, even if there were no changes in the |
1216 // source contents. | 1218 // source contents. |
1217 // TODO(scheglov) consider checking if there are subscriptions. | 1219 // TODO(scheglov) consider checking if there are subscriptions. |
1218 if (AnalysisEngine.isDartFileName(file)) { | 1220 if (AnalysisEngine.isDartFileName(file)) { |
1219 List<CompilationUnit> dartUnits = | 1221 List<CompilationUnit> dartUnits = |
1220 context.ensureResolvedDartUnits(source); | 1222 context.ensureResolvedDartUnits(source); |
1221 if (dartUnits != null) { | 1223 if (dartUnits != null) { |
1222 AnalysisErrorInfo errorInfo = context.getErrors(source); | 1224 AnalysisErrorInfo errorInfo = context.getErrors(source); |
1223 for (var dartUnit in dartUnits) { | 1225 for (var dartUnit in dartUnits) { |
1224 scheduleNotificationOperations(this, file, errorInfo.lineInfo, | 1226 scheduleNotificationOperations( |
1225 context, null, dartUnit, errorInfo.errors); | 1227 this, |
| 1228 source, |
| 1229 file, |
| 1230 errorInfo.lineInfo, |
| 1231 context, |
| 1232 null, |
| 1233 dartUnit, |
| 1234 errorInfo.errors); |
1226 scheduleIndexOperation(this, file, context, dartUnit); | 1235 scheduleIndexOperation(this, file, context, dartUnit); |
1227 } | 1236 } |
1228 } else { | 1237 } else { |
1229 schedulePerformAnalysisOperation(context); | 1238 schedulePerformAnalysisOperation(context); |
1230 } | 1239 } |
1231 } | 1240 } |
1232 } | 1241 } |
1233 }); | 1242 }); |
1234 } | 1243 } |
1235 // The source is not analyzed by any context, add to the containing one. | 1244 // The source is not analyzed by any context, add to the containing one. |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 /** | 1602 /** |
1594 * The [PerformanceTag] for time spent in server request handlers. | 1603 * The [PerformanceTag] for time spent in server request handlers. |
1595 */ | 1604 */ |
1596 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 1605 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
1597 | 1606 |
1598 /** | 1607 /** |
1599 * The [PerformanceTag] for time spent in split store microtasks. | 1608 * The [PerformanceTag] for time spent in split store microtasks. |
1600 */ | 1609 */ |
1601 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 1610 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
1602 } | 1611 } |
OLD | NEW |