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

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

Issue 1786013004: Start using the new index in Analysis Server. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 addDeclarationEdit(renameElement); 89 addDeclarationEdit(renameElement);
90 } 90 }
91 } 91 }
92 // update references 92 // update references
93 addReferenceEdits(_validator.references); 93 addReferenceEdits(_validator.references);
94 // potential matches 94 // potential matches
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
100 if (reference.isResolved) {
101 continue;
102 }
103 // ignore references from SDK and pub cache 99 // ignore references from SDK and pub cache
104 if (isElementInSdkOrPubCache(reference.element)) { 100 if (isElementInSdkOrPubCache(reference.element)) {
105 continue; 101 continue;
106 } 102 }
107 // check the element being renamed is accessible 103 // check the element being renamed is accessible
108 { 104 {
109 LibraryElement whereLibrary = reference.element.library; 105 LibraryElement whereLibrary = reference.element.library;
110 if (!element.isAccessibleIn(whereLibrary)) { 106 if (!element.isAccessibleIn(whereLibrary)) {
111 continue; 107 continue;
112 } 108 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 308 }
313 } 309 }
314 } 310 }
315 311
316 class _MatchShadowedByLocal { 312 class _MatchShadowedByLocal {
317 final SearchMatch match; 313 final SearchMatch match;
318 final LocalElement localElement; 314 final LocalElement localElement;
319 315
320 _MatchShadowedByLocal(this.match, this.localElement); 316 _MatchShadowedByLocal(this.match, this.localElement);
321 } 317 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698