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

Side by Side Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 854363005: Remove Element.users support. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element; 8 library engine.element;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after
2386 * Return the resolved [CompilationUnit] that declares this [Element]. 2386 * Return the resolved [CompilationUnit] that declares this [Element].
2387 * 2387 *
2388 * This method is expensive, because resolved AST might have been already evic ted from cache, so 2388 * This method is expensive, because resolved AST might have been already evic ted from cache, so
2389 * parsing and resolving will be performed. 2389 * parsing and resolving will be performed.
2390 * 2390 *
2391 * @return the resolved [CompilationUnit], maybe `null` if synthetic [Element] . 2391 * @return the resolved [CompilationUnit], maybe `null` if synthetic [Element] .
2392 */ 2392 */
2393 CompilationUnit get unit; 2393 CompilationUnit get unit;
2394 2394
2395 /** 2395 /**
2396 * Identifiers of the elements that use this elements.
2397 */
2398 IntSet get users;
2399
2400 /**
2401 * Use the given visitor to visit this element. 2396 * Use the given visitor to visit this element.
2402 * 2397 *
2403 * @param visitor the visitor that will visit this element 2398 * @param visitor the visitor that will visit this element
2404 * @return the value returned by the visitor as a result of visiting this elem ent 2399 * @return the value returned by the visitor as a result of visiting this elem ent
2405 */ 2400 */
2406 accept(ElementVisitor visitor); 2401 accept(ElementVisitor visitor);
2407 2402
2408 /** 2403 /**
2409 * Remember the given [element] as a user of this element.
2410 */
2411 void addUser(Element element);
2412
2413 /**
2414 * Return the documentation comment for this element as it appears in the orig inal source 2404 * Return the documentation comment for this element as it appears in the orig inal source
2415 * (complete with the beginning and ending delimiters), or `null` if this elem ent does not 2405 * (complete with the beginning and ending delimiters), or `null` if this elem ent does not
2416 * have a documentation comment associated with it. This can be a long-running operation if the 2406 * have a documentation comment associated with it. This can be a long-running operation if the
2417 * information needed to access the comment is not cached. 2407 * information needed to access the comment is not cached.
2418 * 2408 *
2419 * @return this element's documentation comment 2409 * @return this element's documentation comment
2420 * @throws AnalysisException if the documentation comment could not be determi ned because the 2410 * @throws AnalysisException if the documentation comment could not be determi ned because the
2421 * analysis could not be performed 2411 * analysis could not be performed
2422 */ 2412 */
2423 String computeDocumentationComment(); 2413 String computeDocumentationComment();
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2643 * A cached copy of the calculated hashCode for this element. 2633 * A cached copy of the calculated hashCode for this element.
2644 */ 2634 */
2645 int _cachedHashCode; 2635 int _cachedHashCode;
2646 2636
2647 /** 2637 /**
2648 * A cached copy of the calculated location for this element. 2638 * A cached copy of the calculated location for this element.
2649 */ 2639 */
2650 ElementLocation _cachedLocation; 2640 ElementLocation _cachedLocation;
2651 2641
2652 /** 2642 /**
2653 * Identifiers of the elements that use this elements.
2654 *
2655 * TODO(scheglov) consider this field lazily
2656 */
2657 final IntSet users = new IntSet();
2658
2659 /**
2660 * Initialize a newly created element to have the given name. 2643 * Initialize a newly created element to have the given name.
2661 * 2644 *
2662 * @param name the name of this element 2645 * @param name the name of this element
2663 * @param nameOffset the offset of the name of this element in the file that c ontains the 2646 * @param nameOffset the offset of the name of this element in the file that c ontains the
2664 * declaration of this element 2647 * declaration of this element
2665 */ 2648 */
2666 ElementImpl(String name, this._nameOffset) { 2649 ElementImpl(String name, this._nameOffset) {
2667 this._name = StringUtilities.intern(name); 2650 this._name = StringUtilities.intern(name);
2668 } 2651 }
2669 2652
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2825 return true; 2808 return true;
2826 } 2809 }
2827 if (object == null || hashCode != object.hashCode) { 2810 if (object == null || hashCode != object.hashCode) {
2828 return false; 2811 return false;
2829 } 2812 }
2830 return object.runtimeType == runtimeType && 2813 return object.runtimeType == runtimeType &&
2831 (object as Element).location == location; 2814 (object as Element).location == location;
2832 } 2815 }
2833 2816
2834 /** 2817 /**
2835 * Remember the given [element] as a user of this element.
2836 */
2837 @override
2838 void addUser(Element element) {
2839 if (element != null) {
2840 users.add(element.id);
2841 }
2842 }
2843
2844 /**
2845 * Append a textual representation of this element to the given [buffer]. 2818 * Append a textual representation of this element to the given [buffer].
2846 */ 2819 */
2847 void appendTo(StringBuffer buffer) { 2820 void appendTo(StringBuffer buffer) {
2848 if (_name == null) { 2821 if (_name == null) {
2849 buffer.write("<unnamed "); 2822 buffer.write("<unnamed ");
2850 buffer.write(runtimeType.toString()); 2823 buffer.write(runtimeType.toString());
2851 buffer.write(">"); 2824 buffer.write(">");
2852 } else { 2825 } else {
2853 buffer.write(_name); 2826 buffer.write(_name);
2854 } 2827 }
(...skipping 5102 matching lines...) Expand 10 before | Expand all | Expand 10 after
7957 7930
7958 @override 7931 @override
7959 AstNode get node => _baseElement.node; 7932 AstNode get node => _baseElement.node;
7960 7933
7961 @override 7934 @override
7962 Source get source => _baseElement.source; 7935 Source get source => _baseElement.source;
7963 7936
7964 @override 7937 @override
7965 CompilationUnit get unit => _baseElement.unit; 7938 CompilationUnit get unit => _baseElement.unit;
7966 7939
7967 /**
7968 * Identifiers of the elements that use this elements.
7969 */
7970 @override
7971 IntSet get users => _baseElement.users;
7972
7973 /**
7974 * Remember the given [element] as a user of this element.
7975 */
7976 @override
7977 void addUser(Element element) {
7978 _baseElement.addUser(element);
7979 }
7980
7981 @override 7940 @override
7982 String computeDocumentationComment() => 7941 String computeDocumentationComment() =>
7983 _baseElement.computeDocumentationComment(); 7942 _baseElement.computeDocumentationComment();
7984 7943
7985 @override 7944 @override
7986 Element getAncestor(Predicate<Element> predicate) => 7945 Element getAncestor(Predicate<Element> predicate) =>
7987 baseElement.getAncestor(predicate); 7946 baseElement.getAncestor(predicate);
7988 7947
7989 @override 7948 @override
7990 String getExtendedDisplayName(String shortName) => 7949 String getExtendedDisplayName(String shortName) =>
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
8515 8474
8516 @override 8475 @override
8517 Source get source => null; 8476 Source get source => null;
8518 8477
8519 @override 8478 @override
8520 DartType get type => DynamicTypeImpl.instance; 8479 DartType get type => DynamicTypeImpl.instance;
8521 8480
8522 @override 8481 @override
8523 CompilationUnit get unit => null; 8482 CompilationUnit get unit => null;
8524 8483
8525 /**
8526 * Identifiers of the elements that use this elements.
8527 */
8528 @override
8529 IntSet get users => new IntSet();
8530
8531 @override 8484 @override
8532 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this); 8485 accept(ElementVisitor visitor) => visitor.visitMultiplyDefinedElement(this);
8533 8486
8534 /**
8535 * Remember the given [element] as a user of this element.
8536 */
8537 void addUser(Element element) {
8538 }
8539
8540 @override 8487 @override
8541 String computeDocumentationComment() => null; 8488 String computeDocumentationComment() => null;
8542 8489
8543 @override 8490 @override
8544 Element getAncestor(Predicate<Element> predicate) => null; 8491 Element getAncestor(Predicate<Element> predicate) => null;
8545 8492
8546 @override 8493 @override
8547 String getExtendedDisplayName(String shortName) { 8494 String getExtendedDisplayName(String shortName) {
8548 if (shortName != null) { 8495 if (shortName != null) {
8549 return shortName; 8496 return shortName;
(...skipping 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after
11166 // bottom <: void (as bottom is a subtype of all types). 11113 // bottom <: void (as bottom is a subtype of all types).
11167 // void <: dynamic (as dynamic is a supertype of all types) 11114 // void <: dynamic (as dynamic is a supertype of all types)
11168 return identical(type, this) || type.isDynamic; 11115 return identical(type, this) || type.isDynamic;
11169 } 11116 }
11170 11117
11171 @override 11118 @override
11172 VoidTypeImpl substitute2(List<DartType> argumentTypes, 11119 VoidTypeImpl substitute2(List<DartType> argumentTypes,
11173 List<DartType> parameterTypes) => 11120 List<DartType> parameterTypes) =>
11174 this; 11121 this;
11175 } 11122 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/element_handle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698