| 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 | 8 |
| 9 import 'package:analysis_server/src/analysis_logger.dart'; | 9 import 'package:analysis_server/src/analysis_logger.dart'; |
| 10 import 'package:analysis_server/src/channel.dart'; | 10 import 'package:analysis_server/src/channel.dart'; |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 subscriptions.forEach((service, Set<String> newFiles) { | 318 subscriptions.forEach((service, Set<String> newFiles) { |
| 319 Set<String> oldFiles = analysisServices[service]; | 319 Set<String> oldFiles = analysisServices[service]; |
| 320 Set<String> todoFiles = oldFiles != null ? newFiles.difference(oldFiles) :
newFiles; | 320 Set<String> todoFiles = oldFiles != null ? newFiles.difference(oldFiles) :
newFiles; |
| 321 for (String file in todoFiles) { | 321 for (String file in todoFiles) { |
| 322 if (service == AnalysisService.ERRORS) { | 322 if (service == AnalysisService.ERRORS) { |
| 323 Source source = _getSource(file); | 323 Source source = _getSource(file); |
| 324 AnalysisContext analysisContext = _getAnalysisContext(file); | 324 AnalysisContext analysisContext = _getAnalysisContext(file); |
| 325 List<AnalysisError> errors = analysisContext.getErrors(source).errors; | 325 List<AnalysisError> errors = analysisContext.getErrors(source).errors; |
| 326 sendAnalysisNotificationErrors(this, file, errors); | 326 sendAnalysisNotificationErrors(this, file, errors); |
| 327 } | 327 } |
| 328 // TODO(scheglov) |
| 329 // 1. implement resolveCompilationUnit() |
| 330 // 2. Share "if (dartUnit != null)" |
| 328 if (service == AnalysisService.HIGHLIGHTS) { | 331 if (service == AnalysisService.HIGHLIGHTS) { |
| 329 CompilationUnit dartUnit = test_getResolvedCompilationUnit(file); | 332 CompilationUnit dartUnit = test_getResolvedCompilationUnit(file); |
| 330 if (dartUnit != null) { | 333 if (dartUnit != null) { |
| 331 sendAnalysisNotificationHighlights(this, file, dartUnit); | 334 sendAnalysisNotificationHighlights(this, file, dartUnit); |
| 332 } | 335 } |
| 333 } | 336 } |
| 337 if (service == AnalysisService.NAVIGATION) { |
| 338 CompilationUnit dartUnit = test_getResolvedCompilationUnit(file); |
| 339 if (dartUnit != null) { |
| 340 sendAnalysisNotificationNavigation(this, file, dartUnit); |
| 341 } |
| 342 } |
| 343 if (service == AnalysisService.OUTLINE) { |
| 344 CompilationUnit dartUnit = test_getResolvedCompilationUnit(file); |
| 345 if (dartUnit != null) { |
| 346 sendAnalysisNotificationOutline(this, file, dartUnit); |
| 347 } |
| 348 } |
| 334 } | 349 } |
| 335 }); | 350 }); |
| 336 // remember new subscriptions | 351 // remember new subscriptions |
| 337 this.analysisServices = subscriptions; | 352 this.analysisServices = subscriptions; |
| 338 } | 353 } |
| 339 | 354 |
| 340 /** | 355 /** |
| 341 * Return the [AnalysisContext] that is used to analyze the given [path]. | 356 * Return the [AnalysisContext] that is used to analyze the given [path]. |
| 342 * Return `null` if there is no such context. | 357 * Return `null` if there is no such context. |
| 343 */ | 358 */ |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 /** | 479 /** |
| 465 * An enumeration of the services provided by the server domain. | 480 * An enumeration of the services provided by the server domain. |
| 466 */ | 481 */ |
| 467 class ServerService extends Enum2<ServerService> { | 482 class ServerService extends Enum2<ServerService> { |
| 468 static const ServerService STATUS = const ServerService('STATUS', 0); | 483 static const ServerService STATUS = const ServerService('STATUS', 0); |
| 469 | 484 |
| 470 static const List<ServerService> VALUES = const [STATUS]; | 485 static const List<ServerService> VALUES = const [STATUS]; |
| 471 | 486 |
| 472 const ServerService(String name, int ordinal) : super(name, ordinal); | 487 const ServerService(String name, int ordinal) : super(name, ordinal); |
| 473 } | 488 } |
| OLD | NEW |