| 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 domain.execution; | 5 library domain.execution; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 onFileAnalyzed = null; | 147 onFileAnalyzed = null; |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 return new ExecutionSetSubscriptionsResult().toResponse(request.id); | 150 return new ExecutionSetSubscriptionsResult().toResponse(request.id); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void _fileAnalyzed(ChangeNotice notice) { | 153 void _fileAnalyzed(ChangeNotice notice) { |
| 154 ServerPerformanceStatistics.executionNotifications.makeCurrentWhile(() { | 154 ServerPerformanceStatistics.executionNotifications.makeCurrentWhile(() { |
| 155 Source source = notice.source; | 155 Source source = notice.source; |
| 156 String filePath = source.fullName; | 156 String filePath = source.fullName; |
| 157 if (!_isInAnalysisRoot(filePath)) { | 157 AnalysisContext context = server.getContainingContext(filePath); |
| 158 return; | |
| 159 } | |
| 160 AnalysisContext context = server.getAnalysisContext(filePath); | |
| 161 if (context == null) { | 158 if (context == null) { |
| 162 return; | 159 return; |
| 163 } | 160 } |
| 164 if (AnalysisEngine.isDartFileName(filePath)) { | 161 if (AnalysisEngine.isDartFileName(filePath)) { |
| 165 ExecutableKind kind = ExecutableKind.NOT_EXECUTABLE; | 162 ExecutableKind kind = ExecutableKind.NOT_EXECUTABLE; |
| 166 if (context.isClientLibrary(source)) { | 163 if (context.isClientLibrary(source)) { |
| 167 kind = ExecutableKind.CLIENT; | 164 kind = ExecutableKind.CLIENT; |
| 168 if (context.isServerLibrary(source)) { | 165 if (context.isServerLibrary(source)) { |
| 169 kind = ExecutableKind.EITHER; | 166 kind = ExecutableKind.EITHER; |
| 170 } | 167 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (_isInAnalysisRoot(filePath)) { | 226 if (_isInAnalysisRoot(filePath)) { |
| 230 server.sendNotification( | 227 server.sendNotification( |
| 231 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification()); | 228 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification()); |
| 232 } | 229 } |
| 233 } | 230 } |
| 234 | 231 |
| 235 static List<String> _getFullNames(List<Source> sources) { | 232 static List<String> _getFullNames(List<Source> sources) { |
| 236 return sources.map((Source source) => source.fullName).toList(); | 233 return sources.map((Source source) => source.fullName).toList(); |
| 237 } | 234 } |
| 238 } | 235 } |
| OLD | NEW |