Chromium Code Reviews| 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 context.directory.manager; | 5 library context.directory.manager; |
| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 511 } | 511 } |
| 512 Source source = info.sources[path]; | 512 Source source = info.sources[path]; |
| 513 if (source != null) { | 513 if (source != null) { |
| 514 ChangeSet changeSet = new ChangeSet(); | 514 ChangeSet changeSet = new ChangeSet(); |
| 515 changeSet.removedSource(source); | 515 changeSet.removedSource(source); |
| 516 applyChangesToContext(folder, changeSet); | 516 applyChangesToContext(folder, changeSet); |
| 517 info.sources.remove(path); | 517 info.sources.remove(path); |
| 518 } | 518 } |
| 519 break; | 519 break; |
| 520 case ChangeType.MODIFY: | 520 case ChangeType.MODIFY: |
| 521 Source source = info.sources[path]; | 521 List<Source> sources = info.context.getSourcesWithFullName(path); |
|
Paul Berry
2015/03/06 21:56:42
I just noticed that there's a pre-existing bug her
Brian Wilkerson
2015/03/06 23:17:11
Done.
| |
| 522 if (source != null) { | 522 if (!sources.isEmpty) { |
| 523 ChangeSet changeSet = new ChangeSet(); | 523 ChangeSet changeSet = new ChangeSet(); |
| 524 changeSet.changedSource(source); | 524 sources.forEach((Source source) { |
|
Paul Berry
2015/03/06 21:56:42
Nit: this is inefficient since it copies Source ob
Brian Wilkerson
2015/03/06 23:17:11
Yes it is. But the field is 'final', so making it
Paul Berry
2015/03/09 18:05:33
Fair enough.
| |
| 525 changeSet.changedSource(source); | |
| 526 }); | |
| 525 applyChangesToContext(folder, changeSet); | 527 applyChangesToContext(folder, changeSet); |
| 526 } | 528 } |
| 527 break; | 529 break; |
| 528 } | 530 } |
| 529 | 531 |
| 530 if (info.packageMapDependencies.contains(path)) { | 532 if (info.packageMapDependencies.contains(path)) { |
| 531 _recomputePackageUriResolver(info); | 533 _recomputePackageUriResolver(info); |
| 532 } | 534 } |
| 533 } | 535 } |
| 534 | 536 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 710 return excludes(resource.path); | 712 return excludes(resource.path); |
| 711 } | 713 } |
| 712 | 714 |
| 713 /** | 715 /** |
| 714 * Returns `true` if [path] is the pubspec file of this context. | 716 * Returns `true` if [path] is the pubspec file of this context. |
| 715 */ | 717 */ |
| 716 bool isPubspec(String path) { | 718 bool isPubspec(String path) { |
| 717 return path == pubspecPath; | 719 return path == pubspecPath; |
| 718 } | 720 } |
| 719 } | 721 } |
| OLD | NEW |