| 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 | 9 |
| 10 import 'package:analysis_server/src/analysis_logger.dart'; | 10 import 'package:analysis_server/src/analysis_logger.dart'; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 requestId, e.message)); | 296 requestId, e.message)); |
| 297 } | 297 } |
| 298 } | 298 } |
| 299 | 299 |
| 300 /** | 300 /** |
| 301 * Implementation for `analysis.updateContent`. | 301 * Implementation for `analysis.updateContent`. |
| 302 */ | 302 */ |
| 303 void updateContent(Map<String, ContentChange> changes) { | 303 void updateContent(Map<String, ContentChange> changes) { |
| 304 changes.forEach((file, change) { | 304 changes.forEach((file, change) { |
| 305 AnalysisContext analysisContext = _getAnalysisContext(file); | 305 AnalysisContext analysisContext = _getAnalysisContext(file); |
| 306 // TODO(paulberry): handle the case where a file is referred to by more |
| 307 // than one context (e.g package A depends on package B using a local |
| 308 // path, user has both packages open for editing in separate contexts, |
| 309 // and user modifies a file in package B). |
| 306 if (analysisContext != null) { | 310 if (analysisContext != null) { |
| 307 Source source = _getSource(file); | 311 Source source = _getSource(file); |
| 308 if (change.offset == null) { | 312 if (change.offset == null) { |
| 309 analysisContext.setContents(source, change.content); | 313 analysisContext.setContents(source, change.content); |
| 310 } else { | 314 } else { |
| 311 analysisContext.setChangedContents(source, change.content, | 315 analysisContext.setChangedContents(source, change.content, |
| 312 change.offset, change.oldLength, change.newLength); | 316 change.offset, change.oldLength, change.newLength); |
| 313 } | 317 } |
| 314 schedulePerformAnalysisOperation(analysisContext); | 318 schedulePerformAnalysisOperation(analysisContext); |
| 315 } | 319 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 /** | 489 /** |
| 486 * An enumeration of the services provided by the server domain. | 490 * An enumeration of the services provided by the server domain. |
| 487 */ | 491 */ |
| 488 class ServerService extends Enum2<ServerService> { | 492 class ServerService extends Enum2<ServerService> { |
| 489 static const ServerService STATUS = const ServerService('STATUS', 0); | 493 static const ServerService STATUS = const ServerService('STATUS', 0); |
| 490 | 494 |
| 491 static const List<ServerService> VALUES = const [STATUS]; | 495 static const List<ServerService> VALUES = const [STATUS]; |
| 492 | 496 |
| 493 const ServerService(String name, int ordinal) : super(name, ordinal); | 497 const ServerService(String name, int ordinal) : super(name, ordinal); |
| 494 } | 498 } |
| OLD | NEW |