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

Side by Side Diff: pkg/analysis_server/lib/src/services/refactoring/rename_class_member.dart

Issue 574573002: Add SourceFileEdit.time field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: tweak Created 6 years, 3 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
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 services.src.refactoring.rename_class_member; 5 library services.src.refactoring.rename_class_member;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind; 9 import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
10 import 'package:analysis_server/src/services/correction/status.dart'; 10 import 'package:analysis_server/src/services/correction/status.dart';
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // check the element being renamed is accessible 113 // check the element being renamed is accessible
114 { 114 {
115 LibraryElement whereLibrary = reference.element.library; 115 LibraryElement whereLibrary = reference.element.library;
116 if (!element.isAccessibleIn(whereLibrary)) { 116 if (!element.isAccessibleIn(whereLibrary)) {
117 continue; 117 continue;
118 } 118 }
119 } 119 }
120 // add edit 120 // add edit
121 SourceEdit edit = 121 SourceEdit edit =
122 createReferenceEdit(reference, newName, id: _newPotentialId()); 122 createReferenceEdit(reference, newName, id: _newPotentialId());
123 change.addEdit(reference.file, edit); 123 addElementSourceChange(change, reference.element, edit);
124 } 124 }
125 }).then((_) => change); 125 }).then((_) => change);
126 } 126 }
127 127
128 String _newPotentialId() { 128 String _newPotentialId() {
129 String id = potentialEditIds.length.toString(); 129 String id = potentialEditIds.length.toString();
130 potentialEditIds.add(id); 130 potentialEditIds.add(id);
131 return id; 131 return id;
132 } 132 }
133 } 133 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 256 }
257 return _prepareElements().then((_) { 257 return _prepareElements().then((_) {
258 return Future.forEach(elements, (Element element) { 258 return Future.forEach(elements, (Element element) {
259 return searchEngine.searchReferences(element).then((references) { 259 return searchEngine.searchReferences(element).then((references) {
260 this.references.addAll(references); 260 this.references.addAll(references);
261 }); 261 });
262 }); 262 });
263 }); 263 });
264 } 264 }
265 } 265 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698