| 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 'package:analysis_server/src/analysis_server.dart'; | 7 import 'package:analysis_server/src/analysis_server.dart'; |
| 8 import 'package:analysis_server/src/constants.dart'; | 8 import 'package:analysis_server/src/constants.dart'; |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol; | 9 import 'package:analysis_server/src/protocol.dart' as protocol; |
| 10 import 'package:analysis_server/src/search/element_references.dart'; | 10 import 'package:analysis_server/src/search/element_references.dart'; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * The analysis server that is using this handler to process requests. | 21 * The analysis server that is using this handler to process requests. |
| 22 */ | 22 */ |
| 23 final AnalysisServer server; | 23 final AnalysisServer server; |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * The [SearchEngine] for this server. | 26 * The [SearchEngine] for this server. |
| 27 */ | 27 */ |
| 28 SearchEngine searchEngine; | 28 SearchEngine searchEngine; |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * The next searc response id. | 31 * The next search response id. |
| 32 */ | 32 */ |
| 33 int _nextSearchId = 0; | 33 int _nextSearchId = 0; |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * Initialize a newly created handler to handle requests for the given [server
]. | 36 * Initialize a newly created handler to handle requests for the given [server
]. |
| 37 */ | 37 */ |
| 38 SearchDomainHandler(this.server) { | 38 SearchDomainHandler(this.server) { |
| 39 searchEngine = server.searchEngine; | 39 searchEngine = server.searchEngine; |
| 40 } | 40 } |
| 41 | 41 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void _sendSearchNotification(String searchId, bool isLast, | 167 void _sendSearchNotification(String searchId, bool isLast, |
| 168 Iterable<protocol.SearchResult> results) { | 168 Iterable<protocol.SearchResult> results) { |
| 169 server.sendNotification(new protocol.SearchResultsParams(searchId, | 169 server.sendNotification(new protocol.SearchResultsParams(searchId, |
| 170 results.toList(), isLast).toNotification()); | 170 results.toList(), isLast).toNotification()); |
| 171 } | 171 } |
| 172 | 172 |
| 173 static protocol.SearchResult toResult(SearchMatch match) { | 173 static protocol.SearchResult toResult(SearchMatch match) { |
| 174 return new protocol.SearchResult.fromMatch(match); | 174 return new protocol.SearchResult.fromMatch(match); |
| 175 } | 175 } |
| 176 } | 176 } |
| OLD | NEW |