OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'package:analyzer/dart/ast/ast.dart'; | 5 import 'package:analyzer/dart/ast/ast.dart'; |
6 import 'package:analyzer/dart/ast/token.dart'; | 6 import 'package:analyzer/dart/ast/token.dart'; |
7 import 'package:analyzer/dart/ast/visitor.dart'; | 7 import 'package:analyzer/dart/ast/visitor.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/element/member.dart'; | 10 import 'package:analyzer/src/dart/element/member.dart'; |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 * [offset] and [length]. The flag [isQualified] is `true` if the relation | 419 * [offset] and [length]. The flag [isQualified] is `true` if the relation |
420 * has an explicit or implicit qualifier, so [element] cannot be shadowed by | 420 * has an explicit or implicit qualifier, so [element] cannot be shadowed by |
421 * a local declaration. | 421 * a local declaration. |
422 */ | 422 */ |
423 void recordRelationOffset(Element element, IndexRelationKind kind, int offset, | 423 void recordRelationOffset(Element element, IndexRelationKind kind, int offset, |
424 int length, bool isQualified) { | 424 int length, bool isQualified) { |
425 // Ignore elements that can't be referenced outside of the unit. | 425 // Ignore elements that can't be referenced outside of the unit. |
426 ElementKind elementKind = element?.kind; | 426 ElementKind elementKind = element?.kind; |
427 if (elementKind == null || | 427 if (elementKind == null || |
428 elementKind == ElementKind.DYNAMIC || | 428 elementKind == ElementKind.DYNAMIC || |
| 429 elementKind == ElementKind.ERROR || |
429 elementKind == ElementKind.LABEL || | 430 elementKind == ElementKind.LABEL || |
430 elementKind == ElementKind.LOCAL_VARIABLE || | 431 elementKind == ElementKind.LOCAL_VARIABLE || |
431 elementKind == ElementKind.PREFIX || | 432 elementKind == ElementKind.PREFIX || |
432 elementKind == ElementKind.TYPE_PARAMETER || | 433 elementKind == ElementKind.TYPE_PARAMETER || |
433 elementKind == ElementKind.FUNCTION && | 434 elementKind == ElementKind.FUNCTION && |
434 element is FunctionElement && | 435 element is FunctionElement && |
435 element.enclosingElement is ExecutableElement || | 436 element.enclosingElement is ExecutableElement || |
436 elementKind == ElementKind.PARAMETER && | 437 elementKind == ElementKind.PARAMETER && |
437 element is ParameterElement && | 438 element is ParameterElement && |
438 element.parameterKind != ParameterKind.NAMED || | 439 element.parameterKind != ParameterKind.NAMED || |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 final String value; | 792 final String value; |
792 | 793 |
793 /** | 794 /** |
794 * The unique id of the string. It is set after indexing of the whole | 795 * The unique id of the string. It is set after indexing of the whole |
795 * package is done and we are assembling the full package index. | 796 * package is done and we are assembling the full package index. |
796 */ | 797 */ |
797 int id; | 798 int id; |
798 | 799 |
799 _StringInfo(this.value); | 800 _StringInfo(this.value); |
800 } | 801 } |
OLD | NEW |