| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/services/search/search_engine.dart'; | 7 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/src/dart/analysis/driver.dart'; | 9 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 10 import 'package:analyzer/src/dart/analysis/search.dart'; | 10 import 'package:analyzer/src/dart/analysis/search.dart'; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 RegExp regExp = new RegExp('^$name\$'); | 42 RegExp regExp = new RegExp('^$name\$'); |
| 43 for (AnalysisDriver driver in _drivers) { | 43 for (AnalysisDriver driver in _drivers) { |
| 44 List<Element> elements = await driver.search.classMembers(regExp); | 44 List<Element> elements = await driver.search.classMembers(regExp); |
| 45 allDeclarations.addAll(elements.map(_SearchMatch.forElement)); | 45 allDeclarations.addAll(elements.map(_SearchMatch.forElement)); |
| 46 } | 46 } |
| 47 return allDeclarations; | 47 return allDeclarations; |
| 48 } | 48 } |
| 49 | 49 |
| 50 @override | 50 @override |
| 51 Future<List<SearchMatch>> searchMemberReferences(String name) async { | 51 Future<List<SearchMatch>> searchMemberReferences(String name) async { |
| 52 // TODO(scheglov) implement | 52 List<SearchResult> allResults = []; |
| 53 return []; | 53 for (AnalysisDriver driver in _drivers) { |
| 54 List<SearchResult> results = |
| 55 await driver.search.unresolvedMemberReferences(name); |
| 56 allResults.addAll(results); |
| 57 } |
| 58 return allResults.map(_SearchMatch.forSearchResult).toList(); |
| 54 } | 59 } |
| 55 | 60 |
| 56 @override | 61 @override |
| 57 Future<List<SearchMatch>> searchReferences(Element element) async { | 62 Future<List<SearchMatch>> searchReferences(Element element) async { |
| 58 List<SearchResult> allResults = []; | 63 List<SearchResult> allResults = []; |
| 59 for (AnalysisDriver driver in _drivers) { | 64 for (AnalysisDriver driver in _drivers) { |
| 60 List<SearchResult> results = await driver.search.references(element); | 65 List<SearchResult> results = await driver.search.references(element); |
| 61 allResults.addAll(results); | 66 allResults.addAll(results); |
| 62 } | 67 } |
| 63 return allResults.map(_SearchMatch.forSearchResult).toList(); | 68 return allResults.map(_SearchMatch.forSearchResult).toList(); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 189 } |
| 185 if (kind == SearchResultKind.WRITE) { | 190 if (kind == SearchResultKind.WRITE) { |
| 186 return MatchKind.WRITE; | 191 return MatchKind.WRITE; |
| 187 } | 192 } |
| 188 if (kind == SearchResultKind.INVOCATION) { | 193 if (kind == SearchResultKind.INVOCATION) { |
| 189 return MatchKind.INVOCATION; | 194 return MatchKind.INVOCATION; |
| 190 } | 195 } |
| 191 return MatchKind.REFERENCE; | 196 return MatchKind.REFERENCE; |
| 192 } | 197 } |
| 193 } | 198 } |
| OLD | NEW |