OLD | NEW |
---|---|
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 analyzer.dart.element.element; | 5 library analyzer.dart.element.element; |
6 | 6 |
7 import 'package:analyzer/dart/element/type.dart'; | 7 import 'package:analyzer/dart/element/type.dart'; |
8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/constant.dart' show DartObject; | 9 import 'package:analyzer/src/generated/constant.dart' show DartObject; |
10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 * represent the semantic structure of the program. | 531 * represent the semantic structure of the program. |
532 * | 532 * |
533 * Clients may not extend, implement or mix-in this class. | 533 * Clients may not extend, implement or mix-in this class. |
534 */ | 534 */ |
535 abstract class Element implements AnalysisTarget { | 535 abstract class Element implements AnalysisTarget { |
536 /** | 536 /** |
537 * A comparator that can be used to sort elements by their name offset. | 537 * A comparator that can be used to sort elements by their name offset. |
538 * Elements with a smaller offset will be sorted to be before elements with a | 538 * Elements with a smaller offset will be sorted to be before elements with a |
539 * larger name offset. | 539 * larger name offset. |
540 */ | 540 */ |
541 static final Comparator<Element> SORT_BY_OFFSET = (Element firstElement, | 541 static final Comparator<Element> SORT_BY_OFFSET = |
542 Element secondElement) => | 542 (Element firstElement, Element secondElement) => |
543 firstElement.nameOffset - secondElement.nameOffset; | 543 firstElement.nameOffset - secondElement.nameOffset; |
544 | 544 |
545 /** | 545 /** |
546 * Return the analysis context in which this element is defined. | 546 * Return the analysis context in which this element is defined. |
547 */ | 547 */ |
548 AnalysisContext get context; | 548 AnalysisContext get context; |
549 | 549 |
550 /** | 550 /** |
551 * Return the display name of this element, or `null` if this element does not | 551 * Return the display name of this element, or `null` if this element does not |
552 * have a name. | 552 * have a name. |
553 * | 553 * |
554 * In most cases the name and the display name are the same. Differences | 554 * In most cases the name and the display name are the same. Differences |
555 * though are cases such as setters where the name of some setter `set f(x)` | 555 * though are cases such as setters where the name of some setter `set f(x)` |
556 * is `f=`, instead of `f`. | 556 * is `f=`, instead of `f`. |
557 */ | 557 */ |
558 String get displayName; | 558 String get displayName; |
559 | 559 |
560 /** | 560 /** |
561 * Return the source content of the documentation comment for this element, | |
562 * or `null` if this element does not or cannot have a documentation. | |
Brian Wilkerson
2015/12/17 22:51:17
I know you copied the comment, but...
Not clear w
pquitslund
2015/12/18 04:56:50
Done.
| |
563 */ | |
564 String get documentationComment; | |
565 | |
566 /** | |
561 * Return the source range of the documentation comment for this element, | 567 * Return the source range of the documentation comment for this element, |
562 * or `null` if this element does not or cannot have a documentation. | 568 * or `null` if this element does not or cannot have a documentation. |
569 * | |
570 * Deprecated. Use [documentationComment] instead. | |
Brian Wilkerson
2015/12/17 22:51:17
Not exactly a replacement...
pquitslund
2015/12/18 04:56:50
Acknowledged.
| |
563 */ | 571 */ |
572 @deprecated | |
564 SourceRange get docRange; | 573 SourceRange get docRange; |
565 | 574 |
566 /** | 575 /** |
567 * Return the element that either physically or logically encloses this | 576 * Return the element that either physically or logically encloses this |
568 * element. This will be `null` if this element is a library because libraries | 577 * element. This will be `null` if this element is a library because libraries |
569 * are the top-level elements in the model. | 578 * are the top-level elements in the model. |
570 */ | 579 */ |
571 Element get enclosingElement; | 580 Element get enclosingElement; |
572 | 581 |
573 /** | 582 /** |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
670 | 679 |
671 /** | 680 /** |
672 * Return the documentation comment for this element as it appears in the | 681 * Return the documentation comment for this element as it appears in the |
673 * original source (complete with the beginning and ending delimiters), or | 682 * original source (complete with the beginning and ending delimiters), or |
674 * `null` if this element does not have a documentation comment associated | 683 * `null` if this element does not have a documentation comment associated |
675 * with it. This can be a long-running operation if the information needed to | 684 * with it. This can be a long-running operation if the information needed to |
676 * access the comment is not cached. | 685 * access the comment is not cached. |
677 * | 686 * |
678 * Throws [AnalysisException] if the documentation comment could not be | 687 * Throws [AnalysisException] if the documentation comment could not be |
679 * determined because the analysis could not be performed | 688 * determined because the analysis could not be performed |
689 * | |
690 * Deprecated. Use [documentationComment] instead. | |
680 */ | 691 */ |
692 @deprecated | |
681 String computeDocumentationComment(); | 693 String computeDocumentationComment(); |
682 | 694 |
683 /** | 695 /** |
684 * Return the resolved [AstNode] node that declares this element, or `null` if | 696 * Return the resolved [AstNode] node that declares this element, or `null` if |
685 * this element is synthetic or isn't contained in a compilation unit, such as | 697 * this element is synthetic or isn't contained in a compilation unit, such as |
686 * a [LibraryElement]. | 698 * a [LibraryElement]. |
687 * | 699 * |
688 * This method is expensive, because resolved AST might be evicted from cache, | 700 * This method is expensive, because resolved AST might be evicted from cache, |
689 * so parsing and resolving will be performed. | 701 * so parsing and resolving will be performed. |
690 * | 702 * |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2029 */ | 2041 */ |
2030 bool get isStatic; | 2042 bool get isStatic; |
2031 | 2043 |
2032 /** | 2044 /** |
2033 * Return the declared type of this variable, or `null` if the variable did | 2045 * Return the declared type of this variable, or `null` if the variable did |
2034 * not have a declared type (such as if it was declared using the keyword | 2046 * not have a declared type (such as if it was declared using the keyword |
2035 * 'var'). | 2047 * 'var'). |
2036 */ | 2048 */ |
2037 DartType get type; | 2049 DartType get type; |
2038 } | 2050 } |
OLD | NEW |