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 analysis_server.src.provisional.completion.dart.completion_target; | 5 library analysis_server.src.provisional.completion.dart.completion_target; |
6 | 6 |
| 7 import 'package:analyzer/dart/element/element.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart'; |
7 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | |
9 import 'package:analyzer/src/generated/scanner.dart'; | 10 import 'package:analyzer/src/generated/scanner.dart'; |
10 import 'package:analyzer/src/generated/utilities_dart.dart'; | 11 import 'package:analyzer/src/generated/utilities_dart.dart'; |
11 | 12 |
12 int _computeArgIndex(AstNode containingNode, Object entity) { | 13 int _computeArgIndex(AstNode containingNode, Object entity) { |
13 var argList = containingNode; | 14 var argList = containingNode; |
14 if (argList is ArgumentList) { | 15 if (argList is ArgumentList) { |
15 NodeList<Expression> args = argList.arguments; | 16 NodeList<Expression> args = argList.arguments; |
16 for (int index = 0; index < args.length; ++index) { | 17 for (int index = 0; index < args.length; ++index) { |
17 if (entity == args[index]) { | 18 if (entity == args[index]) { |
18 return index; | 19 return index; |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 if (param.parameterKind == ParameterKind.NAMED) { | 414 if (param.parameterKind == ParameterKind.NAMED) { |
414 // TODO(danrubel) handle named parameters | 415 // TODO(danrubel) handle named parameters |
415 return false; | 416 return false; |
416 } else { | 417 } else { |
417 return paramType is FunctionType || paramType is FunctionTypeAlias; | 418 return paramType is FunctionType || paramType is FunctionTypeAlias; |
418 } | 419 } |
419 } | 420 } |
420 return false; | 421 return false; |
421 } | 422 } |
422 } | 423 } |
OLD | NEW |