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

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

Issue 680953002: Fix broken tests (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
« no previous file with comments | « no previous file | no next file » | 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.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 nodePattern.originalToPatternNames.forEach((String patternName, String ori ginalName) { 942 nodePattern.originalToPatternNames.forEach((String originalName, String pa tternName) {
943 String selectionName = patternToSelectionName[patternName]; 943 String selectionName = patternToSelectionName[patternName];
944 occurrence._parameterOldToOccurrenceName[selectionName] = originalName; 944 occurrence._parameterOldToOccurrenceName[selectionName] = originalName;
945 }); 945 });
946 // update static 946 // update static
947 if (forceStatic) { 947 if (forceStatic) {
948 ref._staticContext = true; 948 ref._staticContext = true;
949 } 949 }
950 // we have match 950 // we have match
951 return true; 951 return true;
952 } 952 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 1095
1096 /** 1096 /**
1097 * Generalized version of some source, in which references to the specific 1097 * Generalized version of some source, in which references to the specific
1098 * variables are replaced with pattern variables, with back mapping from the 1098 * variables are replaced with pattern variables, with back mapping from the
1099 * pattern to the original variable names. 1099 * pattern to the original variable names.
1100 */ 1100 */
1101 class _SourcePattern { 1101 class _SourcePattern {
1102 String patternSource; 1102 String patternSource;
1103 Map<String, String> originalToPatternNames = {}; 1103 Map<String, String> originalToPatternNames = {};
1104 } 1104 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698