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

Side by Side Diff: pkg/analyzer_plugin/lib/utilities/change_builder/change_builder_dart.dart

Issue 2972463003: Use DartEditBuilder to write types and remove dead code (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/dart/element/type.dart'; 9 import 'package:analyzer/dart/element/type.dart';
10 import 'package:analyzer/src/dart/analysis/driver.dart'; 10 import 'package:analyzer/src/dart/analysis/driver.dart';
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 * 219 *
220 * If the [groupName] is not `null`, then the name of the type (including type 220 * If the [groupName] is not `null`, then the name of the type (including type
221 * parameters) will be included as a region in the linked edit group with that 221 * parameters) will be included as a region in the linked edit group with that
222 * name. If the [groupName] is not `null` and [addSupertypeProposals] is 222 * name. If the [groupName] is not `null` and [addSupertypeProposals] is
223 * `true`, then all of the supertypes of the [type] will be added as 223 * `true`, then all of the supertypes of the [type] will be added as
224 * suggestions for alternatives to the type name. 224 * suggestions for alternatives to the type name.
225 * 225 *
226 * If a [methodBeingCopied] is provided, then type parameters defined by that 226 * If a [methodBeingCopied] is provided, then type parameters defined by that
227 * method are assumed to be part of what is being written and hence valid 227 * method are assumed to be part of what is being written and hence valid
228 * types. 228 * types.
229 *
230 * Return `true` if some text was written.
229 */ 231 */
230 bool writeType(DartType type, 232 bool writeType(DartType type,
231 {bool addSupertypeProposals: false, 233 {bool addSupertypeProposals: false,
232 String groupName, 234 String groupName,
233 ExecutableElement methodBeingCopied, 235 ExecutableElement methodBeingCopied,
234 bool required: false}); 236 bool required: false});
235 237
236 /** 238 /**
237 * Write the code to declare the given [typeParameter]. The enclosing angle 239 * Write the code to declare the given [typeParameter]. The enclosing angle
238 * brackets are not automatically written. 240 * brackets are not automatically written.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 * 296 *
295 * Clients may not extend, implement or mix-in this class. 297 * Clients may not extend, implement or mix-in this class.
296 */ 298 */
297 abstract class DartLinkedEditBuilder implements LinkedEditBuilder { 299 abstract class DartLinkedEditBuilder implements LinkedEditBuilder {
298 /** 300 /**
299 * Add the given [type] and all of its supertypes (other than mixins) as 301 * Add the given [type] and all of its supertypes (other than mixins) as
300 * suggestions for the current linked edit group. 302 * suggestions for the current linked edit group.
301 */ 303 */
302 void addSuperTypesAsSuggestions(DartType type); 304 void addSuperTypesAsSuggestions(DartType type);
303 } 305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698