| 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 search.element_references; | 5 library search.element_references; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/collections.dart'; | 9 import 'package:analysis_server/src/collections.dart'; |
| 10 import 'package:analysis_server/src/protocol_server.dart' | 10 import 'package:analysis_server/src/protocol_server.dart' |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 */ | 83 */ |
| 84 Future<Iterable<Element>> _getRefElements(Element element) { | 84 Future<Iterable<Element>> _getRefElements(Element element) { |
| 85 if (element is ClassMemberElement) { | 85 if (element is ClassMemberElement) { |
| 86 return getHierarchyMembers(searchEngine, element); | 86 return getHierarchyMembers(searchEngine, element); |
| 87 } | 87 } |
| 88 return new Future.value([element]); | 88 return new Future.value([element]); |
| 89 } | 89 } |
| 90 | 90 |
| 91 SearchResult _newDeclarationResult(Element refElement) { | 91 SearchResult _newDeclarationResult(Element refElement) { |
| 92 int nameOffset = refElement.nameOffset; | 92 int nameOffset = refElement.nameOffset; |
| 93 int nameLength = refElement.name.length; | 93 int nameLength = refElement.nameLength; |
| 94 SearchMatch searchMatch = new SearchMatch(MatchKind.DECLARATION, refElement, | 94 SearchMatch searchMatch = new SearchMatch(MatchKind.DECLARATION, refElement, |
| 95 new SourceRange(nameOffset, nameLength), true, false); | 95 new SourceRange(nameOffset, nameLength), true, false); |
| 96 return newSearchResult_fromMatch(searchMatch); | 96 return newSearchResult_fromMatch(searchMatch); |
| 97 } | 97 } |
| 98 | 98 |
| 99 static SearchResult toResult(SearchMatch match) { | 99 static SearchResult toResult(SearchMatch match) { |
| 100 return newSearchResult_fromMatch(match); | 100 return newSearchResult_fromMatch(match); |
| 101 } | 101 } |
| 102 | 102 |
| 103 static bool _isDeclarationInteresting(Element element) { | 103 static bool _isDeclarationInteresting(Element element) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 * Adds a [Future] or an [E] value to results. | 142 * Adds a [Future] or an [E] value to results. |
| 143 */ | 143 */ |
| 144 void add(value) { | 144 void add(value) { |
| 145 if (value is Future) { | 145 if (value is Future) { |
| 146 _futures.add(value); | 146 _futures.add(value); |
| 147 } else { | 147 } else { |
| 148 _futures.add(new Future.value(<E>[value])); | 148 _futures.add(new Future.value(<E>[value])); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 } | 151 } |
| OLD | NEW |