| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.completion.contributor.dart.constructor; | 5 library services.completion.contributor.dart.constructor; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol | 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol |
| 10 show Element, ElementKind; | 10 show Element, ElementKind; |
| 11 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 11 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
| 12 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart' | 12 import 'package:analysis_server/src/services/completion/dart/completion_manager.
dart' |
| 13 show DartCompletionRequestImpl; | 13 show DartCompletionRequestImpl; |
| 14 import 'package:analysis_server/src/services/completion/dart/local_declaration_v
isitor.dart' | 14 import 'package:analysis_server/src/services/completion/dart/local_declaration_v
isitor.dart' |
| 15 show LocalDeclarationVisitor; | 15 show LocalDeclarationVisitor; |
| 16 import 'package:analysis_server/src/services/completion/dart/optype.dart'; | 16 import 'package:analysis_server/src/services/completion/dart/optype.dart'; |
| 17 import 'package:analysis_server/src/services/completion/dart/suggestion_builder.
dart'; | 17 import 'package:analysis_server/src/services/completion/dart/suggestion_builder.
dart'; |
| 18 import 'package:analyzer/dart/ast/ast.dart'; | 18 import 'package:analyzer/dart/ast/ast.dart'; |
| 19 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| 19 import 'package:analyzer/dart/ast/token.dart'; | 20 import 'package:analyzer/dart/ast/token.dart'; |
| 20 import 'package:analyzer/dart/element/element.dart'; | 21 import 'package:analyzer/dart/element/element.dart'; |
| 21 import 'package:analyzer/src/dart/ast/token.dart'; | 22 import 'package:analyzer/src/dart/ast/token.dart'; |
| 22 import 'package:analyzer/src/generated/source.dart'; | 23 import 'package:analyzer/src/generated/source.dart'; |
| 23 | 24 |
| 24 import '../../../protocol_server.dart' | 25 import '../../../protocol_server.dart' |
| 25 show CompletionSuggestion, CompletionSuggestionKind, Location; | 26 show CompletionSuggestion, CompletionSuggestionKind, Location; |
| 26 | 27 |
| 27 const DYNAMIC = 'dynamic'; | 28 const DYNAMIC = 'dynamic'; |
| 28 | 29 |
| 29 final TypeName NO_RETURN_TYPE = new TypeName( | 30 final TypeName NO_RETURN_TYPE = astFactory.typeName( |
| 30 new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, '', 0)), null); | 31 astFactory.simpleIdentifier(new StringToken(TokenType.IDENTIFIER, '', 0)), |
| 32 null); |
| 31 | 33 |
| 32 /** | 34 /** |
| 33 * Create a new protocol Element for inclusion in a completion suggestion. | 35 * Create a new protocol Element for inclusion in a completion suggestion. |
| 34 */ | 36 */ |
| 35 protocol.Element createLocalElement( | 37 protocol.Element createLocalElement( |
| 36 Source source, protocol.ElementKind kind, SimpleIdentifier id, | 38 Source source, protocol.ElementKind kind, SimpleIdentifier id, |
| 37 {String parameters, | 39 {String parameters, |
| 38 TypeName returnType, | 40 TypeName returnType, |
| 39 bool isAbstract: false, | 41 bool isAbstract: false, |
| 40 bool isDeprecated: false}) { | 42 bool isDeprecated: false}) { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 declaringType: classDecl.name.name, | 290 declaringType: classDecl.name.name, |
| 289 element: element, | 291 element: element, |
| 290 parameterNames: [], | 292 parameterNames: [], |
| 291 parameterTypes: [], | 293 parameterTypes: [], |
| 292 requiredParameterCount: 0, | 294 requiredParameterCount: 0, |
| 293 hasNamedParameters: false); | 295 hasNamedParameters: false); |
| 294 suggestions.add(suggestion); | 296 suggestions.add(suggestion); |
| 295 } | 297 } |
| 296 } | 298 } |
| 297 } | 299 } |
| OLD | NEW |