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

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

Issue 1855643002: More strong mode changes to analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Backout changes to options file Created 4 years, 8 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 new _ClassMemberValidator.forRename(searchEngine, element, newName); 56 new _ClassMemberValidator.forRename(searchEngine, element, newName);
57 return _validator.validate(); 57 return _validator.validate();
58 } 58 }
59 59
60 @override 60 @override
61 Future<RefactoringStatus> checkInitialConditions() async { 61 Future<RefactoringStatus> checkInitialConditions() async {
62 RefactoringStatus result = await super.checkInitialConditions(); 62 RefactoringStatus result = await super.checkInitialConditions();
63 if (element is MethodElement && (element as MethodElement).isOperator) { 63 if (element is MethodElement && (element as MethodElement).isOperator) {
64 result.addFatalError('Cannot rename operator.'); 64 result.addFatalError('Cannot rename operator.');
65 } 65 }
66 return new Future.value(result); 66 return new Future<RefactoringStatus>.value(result);
67 } 67 }
68 68
69 @override 69 @override
70 RefactoringStatus checkNewName() { 70 RefactoringStatus checkNewName() {
71 RefactoringStatus result = super.checkNewName(); 71 RefactoringStatus result = super.checkNewName();
72 if (element is FieldElement) { 72 if (element is FieldElement) {
73 result.addStatus(validateFieldName(newName)); 73 result.addStatus(validateFieldName(newName));
74 } 74 }
75 if (element is MethodElement) { 75 if (element is MethodElement) {
76 result.addStatus(validateMethodName(newName)); 76 result.addStatus(validateMethodName(newName));
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 308 }
309 } 309 }
310 } 310 }
311 311
312 class _MatchShadowedByLocal { 312 class _MatchShadowedByLocal {
313 final SearchMatch match; 313 final SearchMatch match;
314 final LocalElement localElement; 314 final LocalElement localElement;
315 315
316 _MatchShadowedByLocal(this.match, this.localElement); 316 _MatchShadowedByLocal(this.match, this.localElement);
317 } 317 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/inline_method.dart ('k') | pkg/analysis_server/lib/src/status/validator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698