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

Side by Side Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 1377623002: Report a fatal error on attempt to rename an element declared in SDK. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/rename.dart » ('j') | 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.correction.util; 5 library services.src.correction.util;
6 6
7 import 'dart:math'; 7 import 'dart:math';
8 8
9 import 'package:analysis_server/src/protocol.dart' 9 import 'package:analysis_server/src/protocol.dart'
10 show SourceChange, SourceEdit; 10 show SourceChange, SourceEdit;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 */ 168 */
169 String getElementKindName(Element element) { 169 String getElementKindName(Element element) {
170 return element.kind.displayName; 170 return element.kind.displayName;
171 } 171 }
172 172
173 /** 173 /**
174 * Returns the name to display in the UI for the given [Element]. 174 * Returns the name to display in the UI for the given [Element].
175 */ 175 */
176 String getElementQualifiedName(Element element) { 176 String getElementQualifiedName(Element element) {
177 ElementKind kind = element.kind; 177 ElementKind kind = element.kind;
178 if (kind == ElementKind.FIELD || kind == ElementKind.METHOD) { 178 if (kind == ElementKind.CONSTRUCTOR ||
179 kind == ElementKind.FIELD ||
180 kind == ElementKind.METHOD) {
179 return '${element.enclosingElement.displayName}.${element.displayName}'; 181 return '${element.enclosingElement.displayName}.${element.displayName}';
180 } else { 182 } else {
181 return element.displayName; 183 return element.displayName;
182 } 184 }
183 } 185 }
184 186
185 /** 187 /**
186 * If the given [AstNode] is in a [ClassDeclaration], returns the 188 * If the given [AstNode] is in a [ClassDeclaration], returns the
187 * [ClassElement]. Otherwise returns `null`. 189 * [ClassElement]. Otherwise returns `null`.
188 */ 190 */
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 1565
1564 @override 1566 @override
1565 Object visitExpression(Expression node) { 1567 Object visitExpression(Expression node) {
1566 if (node is BinaryExpression && node.operator.type == groupOperatorType) { 1568 if (node is BinaryExpression && node.operator.type == groupOperatorType) {
1567 return super.visitNode(node); 1569 return super.visitNode(node);
1568 } 1570 }
1569 operands.add(node); 1571 operands.add(node);
1570 return null; 1572 return null;
1571 } 1573 }
1572 } 1574 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/refactoring/rename.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698