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

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

Issue 680913002: Remove JavaIterator and MapEntry (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | 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.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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 } 932 }
933 // prepare normalized node source 933 // prepare normalized node source
934 _SourcePattern nodePattern = ref._getSourcePattern(nodeRange); 934 _SourcePattern nodePattern = ref._getSourcePattern(nodeRange);
935 String nodeSource = _getNormalizedSource(nodePattern.patternSource); 935 String nodeSource = _getNormalizedSource(nodePattern.patternSource);
936 // if matches normalized node source, then add as occurrence 936 // if matches normalized node source, then add as occurrence
937 if (nodeSource == selectionSource) { 937 if (nodeSource == selectionSource) {
938 _Occurrence occurrence = 938 _Occurrence occurrence =
939 new _Occurrence(nodeRange, ref.selectionRange.intersects(nodeRange)); 939 new _Occurrence(nodeRange, ref.selectionRange.intersects(nodeRange));
940 ref._occurrences.add(occurrence); 940 ref._occurrences.add(occurrence);
941 // prepare mapping of parameter names to the occurrence variables 941 // prepare mapping of parameter names to the occurrence variables
942 for (MapEntry<String, String> entry in getMapEntrySet( 942 nodePattern.originalToPatternNames.forEach((String patternName, String ori ginalName) {
943 nodePattern.originalToPatternNames)) {
944 String patternName = entry.getValue();
945 String originalName = entry.getKey();
946 String selectionName = patternToSelectionName[patternName]; 943 String selectionName = patternToSelectionName[patternName];
947 occurrence._parameterOldToOccurrenceName[selectionName] = originalName; 944 occurrence._parameterOldToOccurrenceName[selectionName] = originalName;
948 } 945 });
949 // update static 946 // update static
950 if (forceStatic) { 947 if (forceStatic) {
951 ref._staticContext = true; 948 ref._staticContext = true;
952 } 949 }
953 // we have match 950 // we have match
954 return true; 951 return true;
955 } 952 }
956 // no match 953 // no match
957 return false; 954 return false;
958 } 955 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 1095
1099 /** 1096 /**
1100 * Generalized version of some source, in which references to the specific 1097 * Generalized version of some source, in which references to the specific
1101 * variables are replaced with pattern variables, with back mapping from the 1098 * variables are replaced with pattern variables, with back mapping from the
1102 * pattern to the original variable names. 1099 * pattern to the original variable names.
1103 */ 1100 */
1104 class _SourcePattern { 1101 class _SourcePattern {
1105 String patternSource; 1102 String patternSource;
1106 Map<String, String> originalToPatternNames = {}; 1103 Map<String, String> originalToPatternNames = {};
1107 } 1104 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/generated/completion.dart ('k') | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698