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

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

Issue 747613002: Issue 21655. Don't import self when add type declaration. (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 | pkg/analysis_server/test/services/correction/assist_test.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' show SourceChange, 9 import 'package:analysis_server/src/protocol.dart' show SourceChange,
10 SourceEdit; 10 SourceEdit;
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 } 939 }
940 // prepare element 940 // prepare element
941 Element element = type.element; 941 Element element = type.element;
942 if (element == null) { 942 if (element == null) {
943 String source = type.toString(); 943 String source = type.toString();
944 source = source.replaceAll('<dynamic>', ''); 944 source = source.replaceAll('<dynamic>', '');
945 source = source.replaceAll('<dynamic, dynamic>', ''); 945 source = source.replaceAll('<dynamic, dynamic>', '');
946 return source; 946 return source;
947 } 947 }
948 // check if imported 948 // check if imported
949 { 949 if (element.library != _library) {
950 ImportElement importElement = _getImportElement(element); 950 ImportElement importElement = _getImportElement(element);
951 if (importElement != null) { 951 if (importElement != null) {
952 if (importElement.prefix != null) { 952 if (importElement.prefix != null) {
953 sb.write(importElement.prefix.displayName); 953 sb.write(importElement.prefix.displayName);
954 sb.write("."); 954 sb.write(".");
955 } 955 }
956 } else { 956 } else {
957 librariesToImport.add(element.library); 957 librariesToImport.add(element.library);
958 } 958 }
959 } 959 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 1450
1451 @override 1451 @override
1452 Object visitExpression(Expression node) { 1452 Object visitExpression(Expression node) {
1453 if (node is BinaryExpression && node.operator.type == groupOperatorType) { 1453 if (node is BinaryExpression && node.operator.type == groupOperatorType) {
1454 return super.visitNode(node); 1454 return super.visitNode(node);
1455 } 1455 }
1456 operands.add(node); 1456 operands.add(node);
1457 return null; 1457 return null;
1458 } 1458 }
1459 } 1459 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/assist_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698