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

Unified Diff: pkg/analysis_server/lib/src/search/element_references.dart

Issue 576443002: Search for LabelElement and icon for LABEL in Editor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/search/element_references.dart
diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart
index 9117014ff3287e0db641155d26d5a944b1bd84bf..77f46b677019083bc1b4fb4849764a7a3720de68 100644
--- a/pkg/analysis_server/lib/src/search/element_references.dart
+++ b/pkg/analysis_server/lib/src/search/element_references.dart
@@ -50,8 +50,8 @@ class ElementReferencesComputer {
return _getRefElements(element).then((Iterable<Element> refElements) {
var futureGroup = new _ConcatFutureGroup<SearchResult>();
for (Element refElement in refElements) {
- // add variable declaration
- if (_isVariableLikeElement(refElement)) {
+ // add declaration
+ if (_isDeclarationInteresting(refElement)) {
SearchResult searchResult = _newDeclarationResult(refElement);
futureGroup.add(searchResult);
}
@@ -112,7 +112,10 @@ class ElementReferencesComputer {
return element.enclosingElement is ClassElement;
}
- static bool _isVariableLikeElement(Element element) {
+ static bool _isDeclarationInteresting(Element element) {
+ if (element is LabelElement) {
+ return true;
+ }
if (element is LocalVariableElement) {
return true;
}

Powered by Google App Engine
This is Rietveld 408576698