Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 981283003: Change all sources associated with changed files (issue 22680) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698