| 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 // 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.index; | 8 library engine.index; |
| 9 | 9 |
| 10 import 'dart:collection' show Queue; | 10 import 'dart:collection' show Queue; |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 return super.visitMethodDeclaration(node); | 1073 return super.visitMethodDeclaration(node); |
| 1074 } finally { | 1074 } finally { |
| 1075 _exitScope(); | 1075 _exitScope(); |
| 1076 } | 1076 } |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 @override | 1079 @override |
| 1080 Object visitMethodInvocation(MethodInvocation node) { | 1080 Object visitMethodInvocation(MethodInvocation node) { |
| 1081 SimpleIdentifier name = node.methodName; | 1081 SimpleIdentifier name = node.methodName; |
| 1082 Element element = name.bestElement; | 1082 Element element = name.bestElement; |
| 1083 if (element is MethodElement) { | 1083 if (element is MethodElement || element is PropertyAccessorElement) { |
| 1084 Location location = _createLocationFromNode(name); | 1084 Location location = _createLocationFromNode(name); |
| 1085 Relationship relationship; | 1085 Relationship relationship; |
| 1086 if (node.target != null) { | 1086 if (node.target != null) { |
| 1087 relationship = IndexConstants.IS_INVOKED_BY_QUALIFIED; | 1087 relationship = IndexConstants.IS_INVOKED_BY_QUALIFIED; |
| 1088 } else { | 1088 } else { |
| 1089 relationship = IndexConstants.IS_INVOKED_BY_UNQUALIFIED; | 1089 relationship = IndexConstants.IS_INVOKED_BY_UNQUALIFIED; |
| 1090 } | 1090 } |
| 1091 recordRelationship(element, relationship, location); | 1091 recordRelationship(element, relationship, location); |
| 1092 } | 1092 } |
| 1093 if (element is FunctionElement || element is VariableElement) { | 1093 if (element is FunctionElement || element is VariableElement) { |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 | 1519 |
| 1520 @override | 1520 @override |
| 1521 void performOperation() { | 1521 void performOperation() { |
| 1522 try { | 1522 try { |
| 1523 bool mayIndex = _indexStore.aboutToIndexHtml(_context, _htmlElement); | 1523 bool mayIndex = _indexStore.aboutToIndexHtml(_context, _htmlElement); |
| 1524 if (!mayIndex) { | 1524 if (!mayIndex) { |
| 1525 return; | 1525 return; |
| 1526 } | 1526 } |
| 1527 AngularHtmlIndexContributor contributor = new AngularHtmlIndexContributor(
_indexStore); | 1527 AngularHtmlIndexContributor contributor = new AngularHtmlIndexContributor(
_indexStore); |
| 1528 unit.accept(contributor); | 1528 unit.accept(contributor); |
| 1529 _indexStore.doneIndex(); |
| 1529 } catch (exception) { | 1530 } catch (exception) { |
| 1530 AnalysisEngine.instance.logger.logError2("Could not index ${unit.element.l
ocation}", exception); | 1531 AnalysisEngine.instance.logger.logError2("Could not index ${unit.element.l
ocation}", exception); |
| 1531 } | 1532 } |
| 1532 } | 1533 } |
| 1533 | 1534 |
| 1534 @override | 1535 @override |
| 1535 bool removeWhenSourceRemoved(Source source) => this._source == source; | 1536 bool removeWhenSourceRemoved(Source source) => this._source == source; |
| 1536 | 1537 |
| 1537 @override | 1538 @override |
| 1538 String toString() => "IndexHtmlUnitOperation(${_source.fullName})"; | 1539 String toString() => "IndexHtmlUnitOperation(${_source.fullName})"; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 * removed before, so no any unit may be indexed with it | 1594 * removed before, so no any unit may be indexed with it |
| 1594 */ | 1595 */ |
| 1595 bool aboutToIndexHtml(AnalysisContext context, HtmlElement htmlElement); | 1596 bool aboutToIndexHtml(AnalysisContext context, HtmlElement htmlElement); |
| 1596 | 1597 |
| 1597 /** | 1598 /** |
| 1598 * Removes all of the information. | 1599 * Removes all of the information. |
| 1599 */ | 1600 */ |
| 1600 void clear(); | 1601 void clear(); |
| 1601 | 1602 |
| 1602 /** | 1603 /** |
| 1604 * Notifies that index store that the current Dart or HTML unit indexing is do
ne. |
| 1605 * |
| 1606 * If this method is not invoked after corresponding "aboutToIndex*" invocatio
n, all recorded |
| 1607 * information may be lost. |
| 1608 */ |
| 1609 void doneIndex(); |
| 1610 |
| 1611 /** |
| 1603 * Return the locations of the elements that have the given relationship with
the given element. | 1612 * Return the locations of the elements that have the given relationship with
the given element. |
| 1604 * For example, if the element represents a method and the relationship is the
is-referenced-by | 1613 * For example, if the element represents a method and the relationship is the
is-referenced-by |
| 1605 * relationship, then the returned locations will be all of the places where t
he method is | 1614 * relationship, then the returned locations will be all of the places where t
he method is |
| 1606 * invoked. | 1615 * invoked. |
| 1607 * | 1616 * |
| 1608 * @param element the the element that has the relationship with the locations
to be returned | 1617 * @param element the the element that has the relationship with the locations
to be returned |
| 1609 * @param relationship the [Relationship] between the given element and the lo
cations to be | 1618 * @param relationship the [Relationship] between the given element and the lo
cations to be |
| 1610 * returned | 1619 * returned |
| 1611 * @return the locations that have the given relationship with the given eleme
nt | 1620 * @return the locations that have the given relationship with the given eleme
nt |
| 1612 */ | 1621 */ |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1729 | 1738 |
| 1730 @override | 1739 @override |
| 1731 void performOperation() { | 1740 void performOperation() { |
| 1732 try { | 1741 try { |
| 1733 bool mayIndex = _indexStore.aboutToIndexDart(_context, _unitElement); | 1742 bool mayIndex = _indexStore.aboutToIndexDart(_context, _unitElement); |
| 1734 if (!mayIndex) { | 1743 if (!mayIndex) { |
| 1735 return; | 1744 return; |
| 1736 } | 1745 } |
| 1737 unit.accept(new IndexContributor(_indexStore)); | 1746 unit.accept(new IndexContributor(_indexStore)); |
| 1738 unit.accept(new AngularDartIndexContributor(_indexStore)); | 1747 unit.accept(new AngularDartIndexContributor(_indexStore)); |
| 1748 _indexStore.doneIndex(); |
| 1739 } catch (exception) { | 1749 } catch (exception) { |
| 1740 AnalysisEngine.instance.logger.logError2("Could not index ${unit.element.l
ocation}", exception); | 1750 AnalysisEngine.instance.logger.logError2("Could not index ${unit.element.l
ocation}", exception); |
| 1741 } | 1751 } |
| 1742 } | 1752 } |
| 1743 | 1753 |
| 1744 @override | 1754 @override |
| 1745 bool removeWhenSourceRemoved(Source source) => this._source == source; | 1755 bool removeWhenSourceRemoved(Source source) => this._source == source; |
| 1746 | 1756 |
| 1747 @override | 1757 @override |
| 1748 String toString() => "IndexUnitOperation(${_source.fullName})"; | 1758 String toString() => "IndexUnitOperation(${_source.fullName})"; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1990 void clear() { | 2000 void clear() { |
| 1991 _canonicalKeys.clear(); | 2001 _canonicalKeys.clear(); |
| 1992 _keyToLocations.clear(); | 2002 _keyToLocations.clear(); |
| 1993 _contextToSourceToKeys.clear(); | 2003 _contextToSourceToKeys.clear(); |
| 1994 _contextToSourceToLocations.clear(); | 2004 _contextToSourceToLocations.clear(); |
| 1995 _contextToLibraryToUnits.clear(); | 2005 _contextToLibraryToUnits.clear(); |
| 1996 _contextToUnitToLibraries.clear(); | 2006 _contextToUnitToLibraries.clear(); |
| 1997 } | 2007 } |
| 1998 | 2008 |
| 1999 @override | 2009 @override |
| 2010 void doneIndex() { |
| 2011 } |
| 2012 |
| 2013 @override |
| 2000 List<Location> getRelationships(Element element, Relationship relationship) { | 2014 List<Location> getRelationships(Element element, Relationship relationship) { |
| 2001 MemoryIndexStoreImpl_ElementRelationKey key = new MemoryIndexStoreImpl_Eleme
ntRelationKey(element, relationship); | 2015 MemoryIndexStoreImpl_ElementRelationKey key = new MemoryIndexStoreImpl_Eleme
ntRelationKey(element, relationship); |
| 2002 Set<Location> locations = _keyToLocations[key]; | 2016 Set<Location> locations = _keyToLocations[key]; |
| 2003 if (locations != null) { | 2017 if (locations != null) { |
| 2004 return new List.from(locations); | 2018 return new List.from(locations); |
| 2005 } | 2019 } |
| 2006 return Location.EMPTY_ARRAY; | 2020 return Location.EMPTY_ARRAY; |
| 2007 } | 2021 } |
| 2008 | 2022 |
| 2009 @override | 2023 @override |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2582 static UniverseElementImpl INSTANCE = new UniverseElementImpl(); | 2596 static UniverseElementImpl INSTANCE = new UniverseElementImpl(); |
| 2583 | 2597 |
| 2584 UniverseElementImpl() : super("--universe--", -1); | 2598 UniverseElementImpl() : super("--universe--", -1); |
| 2585 | 2599 |
| 2586 @override | 2600 @override |
| 2587 accept(ElementVisitor visitor) => null; | 2601 accept(ElementVisitor visitor) => null; |
| 2588 | 2602 |
| 2589 @override | 2603 @override |
| 2590 ElementKind get kind => ElementKind.UNIVERSE; | 2604 ElementKind get kind => ElementKind.UNIVERSE; |
| 2591 } | 2605 } |
| OLD | NEW |