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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
970 * Implementation for `analysis.setSubscriptions`. | 970 * Implementation for `analysis.setSubscriptions`. |
971 */ | 971 */ |
972 void setAnalysisSubscriptions( | 972 void setAnalysisSubscriptions( |
973 Map<AnalysisService, Set<String>> subscriptions) { | 973 Map<AnalysisService, Set<String>> subscriptions) { |
974 // send notifications for already analyzed sources | 974 // send notifications for already analyzed sources |
975 subscriptions.forEach((service, Set<String> newFiles) { | 975 subscriptions.forEach((service, Set<String> newFiles) { |
976 Set<String> oldFiles = analysisServices[service]; | 976 Set<String> oldFiles = analysisServices[service]; |
977 Set<String> todoFiles = | 977 Set<String> todoFiles = |
978 oldFiles != null ? newFiles.difference(oldFiles) : newFiles; | 978 oldFiles != null ? newFiles.difference(oldFiles) : newFiles; |
979 for (String file in todoFiles) { | 979 for (String file in todoFiles) { |
980 if (contextManager.isIgnored(file)) { | |
981 continue; | |
Brian Wilkerson
2015/11/19 00:17:08
Do we need to remember the subscriptions so that i
scheglov
2015/11/19 01:30:16
Actually yes, we need.
But we don't do it now.
So,
| |
982 } | |
983 // prepare context | |
980 ContextSourcePair contextSource = getContextSourcePair(file); | 984 ContextSourcePair contextSource = getContextSourcePair(file); |
981 // prepare context | |
982 AnalysisContext context = contextSource.context; | 985 AnalysisContext context = contextSource.context; |
983 if (context == null) { | 986 if (context == null) { |
984 continue; | 987 continue; |
985 } | 988 } |
986 Source source = contextSource.source; | 989 Source source = contextSource.source; |
987 // Ensure that if the AST is flushed / not ready, it will be | 990 // Ensure that if the AST is flushed / not ready, it will be |
988 // computed eventually. | 991 // computed eventually. |
989 if (AnalysisEngine.isDartFileName(file)) { | 992 if (AnalysisEngine.isDartFileName(file)) { |
990 (context as InternalAnalysisContext).ensureResolvedDartUnits(source); | 993 (context as InternalAnalysisContext).ensureResolvedDartUnits(source); |
991 } | 994 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1059 void setPriorityFiles(String requestId, List<String> files) { | 1062 void setPriorityFiles(String requestId, List<String> files) { |
1060 // Note: when a file is a priority file, that information needs to be | 1063 // Note: when a file is a priority file, that information needs to be |
1061 // propagated to all contexts that analyze the file, so that all contexts | 1064 // propagated to all contexts that analyze the file, so that all contexts |
1062 // will be able to do incremental resolution of the file. See | 1065 // will be able to do incremental resolution of the file. See |
1063 // dartbug.com/22209. | 1066 // dartbug.com/22209. |
1064 Map<AnalysisContext, List<Source>> sourceMap = | 1067 Map<AnalysisContext, List<Source>> sourceMap = |
1065 new HashMap<AnalysisContext, List<Source>>(); | 1068 new HashMap<AnalysisContext, List<Source>>(); |
1066 List<String> unanalyzed = new List<String>(); | 1069 List<String> unanalyzed = new List<String>(); |
1067 Source firstSource = null; | 1070 Source firstSource = null; |
1068 files.forEach((String file) { | 1071 files.forEach((String file) { |
1072 if (contextManager.isIgnored(file)) { | |
1073 unanalyzed.add(file); | |
1074 return; | |
1075 } | |
1076 // Prepare the context/source pair. | |
1069 ContextSourcePair contextSource = getContextSourcePair(file); | 1077 ContextSourcePair contextSource = getContextSourcePair(file); |
1070 AnalysisContext preferredContext = contextSource.context; | 1078 AnalysisContext preferredContext = contextSource.context; |
1071 Source source = contextSource.source; | 1079 Source source = contextSource.source; |
1072 // Try to make the file analyzable. | 1080 // Try to make the file analyzable. |
1073 // If it is not in any context yet, add it to the first one which | 1081 // If it is not in any context yet, add it to the first one which |
1074 // could use it, e.g. imports its package, even if not the library. | 1082 // could use it, e.g. imports its package, even if not the library. |
1075 if (preferredContext == null) { | 1083 if (preferredContext == null) { |
1076 Resource resource = resourceProvider.getResource(file); | 1084 Resource resource = resourceProvider.getResource(file); |
1077 if (resource is File && resource.exists) { | 1085 if (resource is File && resource.exists) { |
1078 for (AnalysisContext context in folderMap.values) { | 1086 for (AnalysisContext context in folderMap.values) { |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1666 /** | 1674 /** |
1667 * The [PerformanceTag] for time spent in server request handlers. | 1675 * The [PerformanceTag] for time spent in server request handlers. |
1668 */ | 1676 */ |
1669 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 1677 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
1670 | 1678 |
1671 /** | 1679 /** |
1672 * The [PerformanceTag] for time spent in split store microtasks. | 1680 * The [PerformanceTag] for time spent in split store microtasks. |
1673 */ | 1681 */ |
1674 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 1682 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
1675 } | 1683 } |
OLD | NEW |