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

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

Issue 1336323003: Issue 24338. Don't propose creating a local class for prefixed identifiers. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_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 analysis_server.src.services.correction.fix_internal; 5 library analysis_server.src.services.correction.fix_internal;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:core' hide Resource; 8 import 'dart:core' hide Resource;
9 9
10 import 'package:analysis_server/edit/fix/fix_core.dart'; 10 import 'package:analysis_server/edit/fix/fix_core.dart';
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 void _addFix_createClass() { 446 void _addFix_createClass() {
447 Element prefixElement = null; 447 Element prefixElement = null;
448 String name = null; 448 String name = null;
449 SimpleIdentifier nameNode; 449 SimpleIdentifier nameNode;
450 if (node is SimpleIdentifier) { 450 if (node is SimpleIdentifier) {
451 AstNode parent = node.parent; 451 AstNode parent = node.parent;
452 if (parent is PrefixedIdentifier) { 452 if (parent is PrefixedIdentifier) {
453 PrefixedIdentifier prefixedIdentifier = parent; 453 PrefixedIdentifier prefixedIdentifier = parent;
454 prefixElement = prefixedIdentifier.prefix.staticElement; 454 prefixElement = prefixedIdentifier.prefix.staticElement;
455 if (prefixElement == null) {
456 return;
457 }
455 parent = prefixedIdentifier.parent; 458 parent = prefixedIdentifier.parent;
456 nameNode = prefixedIdentifier.identifier; 459 nameNode = prefixedIdentifier.identifier;
457 name = prefixedIdentifier.identifier.name; 460 name = prefixedIdentifier.identifier.name;
458 } else { 461 } else {
459 nameNode = node; 462 nameNode = node;
460 name = nameNode.name; 463 name = nameNode.name;
461 } 464 }
462 if (!_mayBeTypeIdentifier(nameNode)) { 465 if (!_mayBeTypeIdentifier(nameNode)) {
463 return; 466 return;
464 } 467 }
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 /** 2750 /**
2748 * Describes the location for a newly created [FieldDeclaration]. 2751 * Describes the location for a newly created [FieldDeclaration].
2749 */ 2752 */
2750 class _FieldLocation { 2753 class _FieldLocation {
2751 final String prefix; 2754 final String prefix;
2752 final int offset; 2755 final int offset;
2753 final String suffix; 2756 final String suffix;
2754 2757
2755 _FieldLocation(this.prefix, this.offset, this.suffix); 2758 _FieldLocation(this.prefix, this.offset, this.suffix);
2756 } 2759 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/fix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698