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

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

Issue 1411243010: Adding a not explicit source makes it explicit. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/context.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 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_server.dart' 9 import 'package:analysis_server/src/protocol_server.dart'
10 hide Element, ElementKind; 10 hide Element, ElementKind;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 List<SearchMatch> nameMatches = 95 List<SearchMatch> nameMatches =
96 await searchEngine.searchMemberReferences(oldName); 96 await searchEngine.searchMemberReferences(oldName);
97 List<SourceReference> nameRefs = getSourceReferences(nameMatches); 97 List<SourceReference> nameRefs = getSourceReferences(nameMatches);
98 for (SourceReference reference in nameRefs) { 98 for (SourceReference reference in nameRefs) {
99 // ignore resolved reference, we have already updated it 99 // ignore resolved reference, we have already updated it
100 if (reference.isResolved) { 100 if (reference.isResolved) {
101 continue; 101 continue;
102 } 102 }
103 // ignore references from SDK and pub cache 103 // ignore references from SDK and pub cache
104 if (isElementInSdkOrPubCache(reference.element)) { 104 if (isElementInSdkOrPubCache(reference.element)) {
105 print('ignore: $reference');
106 continue; 105 continue;
107 } 106 }
108 // check the element being renamed is accessible 107 // check the element being renamed is accessible
109 { 108 {
110 LibraryElement whereLibrary = reference.element.library; 109 LibraryElement whereLibrary = reference.element.library;
111 if (!element.isAccessibleIn(whereLibrary)) { 110 if (!element.isAccessibleIn(whereLibrary)) {
112 continue; 111 continue;
113 } 112 }
114 } 113 }
115 // add edit 114 // add edit
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 Element refElement = reference.element; 286 Element refElement = reference.element;
288 LibraryElement refLibrary = refElement.library; 287 LibraryElement refLibrary = refElement.library;
289 if (refLibrary != library) { 288 if (refLibrary != library) {
290 String message = format("Renamed {0} will be invisible in '{1}'.", 289 String message = format("Renamed {0} will be invisible in '{1}'.",
291 getElementKindName(element), getElementQualifiedName(refLibrary)); 290 getElementKindName(element), getElementQualifiedName(refLibrary));
292 result.addError(message, newLocation_fromMatch(reference)); 291 result.addError(message, newLocation_fromMatch(reference));
293 } 292 }
294 } 293 }
295 } 294 }
296 } 295 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698