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

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

Issue 2624283003: Revert "Add support for generic function type syntax, part 1" (TBR) (Closed)
Patch Set: Created 3 years, 11 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.extract_method; 5 library services.src.refactoring.extract_method;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol_server.dart' hide Element; 9 import 'package:analysis_server/src/protocol_server.dart' hide Element;
10 import 'package:analysis_server/src/services/correction/name_suggestion.dart'; 10 import 'package:analysis_server/src/services/correction/name_suggestion.dart';
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 if (identical(node.variables, firstSelectedNode)) { 852 if (identical(node.variables, firstSelectedNode)) {
853 invalidSelection( 853 invalidSelection(
854 "Cannot extract initialization part of a 'for' statement."); 854 "Cannot extract initialization part of a 'for' statement.");
855 } else if (node.updaters.contains(lastSelectedNode)) { 855 } else if (node.updaters.contains(lastSelectedNode)) {
856 invalidSelection("Cannot extract increment part of a 'for' statement."); 856 invalidSelection("Cannot extract increment part of a 'for' statement.");
857 } 857 }
858 return null; 858 return null;
859 } 859 }
860 860
861 @override 861 @override
862 Object visitGenericFunctionType(GenericFunctionType node) {
863 super.visitGenericFunctionType(node);
864 if (_isFirstSelectedNode(node)) {
865 invalidSelection('Cannot extract a single type reference.');
866 }
867 return null;
868 }
869
870 @override
871 Object visitSimpleIdentifier(SimpleIdentifier node) { 862 Object visitSimpleIdentifier(SimpleIdentifier node) {
872 super.visitSimpleIdentifier(node); 863 super.visitSimpleIdentifier(node);
873 if (_isFirstSelectedNode(node)) { 864 if (_isFirstSelectedNode(node)) {
874 // name of declaration 865 // name of declaration
875 if (node.inDeclarationContext()) { 866 if (node.inDeclarationContext()) {
876 invalidSelection('Cannot extract the name part of a declaration.'); 867 invalidSelection('Cannot extract the name part of a declaration.');
877 } 868 }
878 // method name 869 // method name
879 Element element = node.bestElement; 870 Element element = node.bestElement;
880 if (element is FunctionElement || element is MethodElement) { 871 if (element is FunctionElement || element is MethodElement) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 return false; 1243 return false;
1253 } 1244 }
1254 for (int i = 0; i < parameterTypes.length; i++) { 1245 for (int i = 0; i < parameterTypes.length; i++) {
1255 if (other.parameterTypes[i] != parameterTypes[i]) { 1246 if (other.parameterTypes[i] != parameterTypes[i]) {
1256 return false; 1247 return false;
1257 } 1248 }
1258 } 1249 }
1259 return true; 1250 return true;
1260 } 1251 }
1261 } 1252 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | pkg/analysis_server/lib/src/status/ast_writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698