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

Side by Side Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 571523002: Issue 20894. Rename 'Class' when rename refactoring is activated on 'Class' in 'new Class.name()'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
« no previous file with comments | « pkg/analysis_server/test/edit/refactoring_test.dart ('k') | pkg/analyzer/pubspec.yaml » ('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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast; 8 library engine.ast;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 6003 matching lines...) Expand 10 before | Expand all | Expand 10 after
6014 @override 6014 @override
6015 Element visitIdentifier(Identifier node) { 6015 Element visitIdentifier(Identifier node) {
6016 AstNode parent = node.parent; 6016 AstNode parent = node.parent;
6017 // Type name in Annotation 6017 // Type name in Annotation
6018 if (parent is Annotation) { 6018 if (parent is Annotation) {
6019 Annotation annotation = parent; 6019 Annotation annotation = parent;
6020 if (identical(annotation.name, node) && annotation.constructorName == null ) { 6020 if (identical(annotation.name, node) && annotation.constructorName == null ) {
6021 return annotation.element; 6021 return annotation.element;
6022 } 6022 }
6023 } 6023 }
6024 // Type name in InstanceCreationExpression
6025 {
6026 AstNode typeNameCandidate = parent;
6027 // new prefix.node[.constructorName]()
6028 if (typeNameCandidate is PrefixedIdentifier) {
6029 PrefixedIdentifier prefixedIdentifier = typeNameCandidate as PrefixedIde ntifier;
6030 if (identical(prefixedIdentifier.identifier, node)) {
6031 typeNameCandidate = prefixedIdentifier.parent;
6032 }
6033 }
6034 // new typeName[.constructorName]()
6035 if (typeNameCandidate is TypeName) {
6036 TypeName typeName = typeNameCandidate as TypeName;
6037 if (typeName.parent is ConstructorName) {
6038 ConstructorName constructorName = typeName.parent as ConstructorName;
6039 return constructorName.staticElement;
6040 }
6041 }
6042 }
6043 // Extra work to map Constructor Declarations to their associated Constructo r Elements 6024 // Extra work to map Constructor Declarations to their associated Constructo r Elements
6044 if (parent is ConstructorDeclaration) { 6025 if (parent is ConstructorDeclaration) {
6045 ConstructorDeclaration decl = parent; 6026 ConstructorDeclaration decl = parent;
6046 Identifier returnType = decl.returnType; 6027 Identifier returnType = decl.returnType;
6047 if (identical(returnType, node)) { 6028 if (identical(returnType, node)) {
6048 SimpleIdentifier name = decl.name; 6029 SimpleIdentifier name = decl.name;
6049 if (name != null) { 6030 if (name != null) {
6050 return name.bestElement; 6031 return name.bestElement;
6051 } 6032 }
6052 Element element = node.bestElement; 6033 Element element = node.bestElement;
(...skipping 13531 matching lines...) Expand 10 before | Expand all | Expand 10 after
19584 _elements[index] = node; 19565 _elements[index] = node;
19585 } 19566 }
19586 void clear() { 19567 void clear() {
19587 _elements = <E> []; 19568 _elements = <E> [];
19588 } 19569 }
19589 int get length => _elements.length; 19570 int get length => _elements.length;
19590 void set length(int value) { 19571 void set length(int value) {
19591 throw new UnsupportedError("Cannot resize NodeList."); 19572 throw new UnsupportedError("Cannot resize NodeList.");
19592 } 19573 }
19593 } 19574 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/edit/refactoring_test.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698