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

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

Issue 1131423002: Clean up many generated constructors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment change Created 5 years, 7 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 | 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.rename_import; 5 library services.src.refactoring.rename_import;
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 import 'package:analysis_server/src/services/correction/source_range.dart'; 10 import 'package:analysis_server/src/services/correction/source_range.dart';
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 /** 96 /**
97 * If the given [reference] is before an interpolated [SimpleIdentifier] in 97 * If the given [reference] is before an interpolated [SimpleIdentifier] in
98 * an [InterpolationExpression] without surrounding curly brackets, return it. 98 * an [InterpolationExpression] without surrounding curly brackets, return it.
99 * Otherwise return `null`. 99 * Otherwise return `null`.
100 */ 100 */
101 SimpleIdentifier _getInterpolationIdentifier(SourceReference reference) { 101 SimpleIdentifier _getInterpolationIdentifier(SourceReference reference) {
102 Source source = reference.element.source; 102 Source source = reference.element.source;
103 CompilationUnit unit = context.parseCompilationUnit(source); 103 CompilationUnit unit = context.parseCompilationUnit(source);
104 NodeLocator nodeLocator = new NodeLocator.con1(reference.range.offset); 104 NodeLocator nodeLocator = new NodeLocator(reference.range.offset);
105 AstNode node = nodeLocator.searchWithin(unit); 105 AstNode node = nodeLocator.searchWithin(unit);
106 if (node is SimpleIdentifier) { 106 if (node is SimpleIdentifier) {
107 AstNode parent = node.parent; 107 AstNode parent = node.parent;
108 if (parent is InterpolationExpression && parent.rightBracket == null) { 108 if (parent is InterpolationExpression && parent.rightBracket == null) {
109 return node; 109 return node;
110 } 110 }
111 } 111 }
112 return null; 112 return null;
113 } 113 }
114 } 114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698