| 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.domain; | 5 library search.domain; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 var computer = new ElementReferencesComputer(searchEngine); | 68 var computer = new ElementReferencesComputer(searchEngine); |
| 69 List<protocol.SearchResult> results = | 69 List<protocol.SearchResult> results = |
| 70 await computer.compute(element, params.includePotential); | 70 await computer.compute(element, params.includePotential); |
| 71 bool isLast = identical(element, elements.last); | 71 bool isLast = identical(element, elements.last); |
| 72 _sendSearchNotification(searchId, isLast, results); | 72 _sendSearchNotification(searchId, isLast, results); |
| 73 }); | 73 }); |
| 74 // respond | 74 // respond |
| 75 var result = new protocol.SearchFindElementReferencesResult(); | 75 var result = new protocol.SearchFindElementReferencesResult(); |
| 76 if (elements.isNotEmpty) { | 76 if (elements.isNotEmpty) { |
| 77 result.id = searchId; | 77 result.id = searchId; |
| 78 result.element = protocol.newElement_fromEngine(elements[0]); | 78 result.element = protocol.convertElement(elements[0]); |
| 79 } | 79 } |
| 80 _sendSearchResult(request, result); | 80 _sendSearchResult(request, result); |
| 81 } | 81 } |
| 82 | 82 |
| 83 Future findMemberDeclarations(protocol.Request request) async { | 83 Future findMemberDeclarations(protocol.Request request) async { |
| 84 var params = | 84 var params = |
| 85 new protocol.SearchFindMemberDeclarationsParams.fromRequest(request); | 85 new protocol.SearchFindMemberDeclarationsParams.fromRequest(request); |
| 86 await server.onAnalysisComplete; | 86 await server.onAnalysisComplete; |
| 87 // respond | 87 // respond |
| 88 String searchId = (_nextSearchId++).toString(); | 88 String searchId = (_nextSearchId++).toString(); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 void _sendTypeHierarchyNull(protocol.Request request) { | 207 void _sendTypeHierarchyNull(protocol.Request request) { |
| 208 protocol.Response response = | 208 protocol.Response response = |
| 209 new protocol.SearchGetTypeHierarchyResult().toResponse(request.id); | 209 new protocol.SearchGetTypeHierarchyResult().toResponse(request.id); |
| 210 server.sendResponse(response); | 210 server.sendResponse(response); |
| 211 } | 211 } |
| 212 | 212 |
| 213 static protocol.SearchResult toResult(SearchMatch match) { | 213 static protocol.SearchResult toResult(SearchMatch match) { |
| 214 return protocol.newSearchResult_fromMatch(match); | 214 return protocol.newSearchResult_fromMatch(match); |
| 215 } | 215 } |
| 216 } | 216 } |
| OLD | NEW |