| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 7 import 'package:analysis_server/src/analysis_server.dart'; | 8 import 'package:analysis_server/src/analysis_server.dart'; |
| 8 import 'package:analysis_server/src/constants.dart'; | |
| 9 import 'package:analysis_server/src/protocol_server.dart' as protocol; | 9 import 'package:analysis_server/src/protocol_server.dart' as protocol; |
| 10 import 'package:analysis_server/src/search/element_references.dart'; | 10 import 'package:analysis_server/src/search/element_references.dart'; |
| 11 import 'package:analysis_server/src/search/type_hierarchy.dart'; | 11 import 'package:analysis_server/src/search/type_hierarchy.dart'; |
| 12 import 'package:analysis_server/src/services/index/index.dart'; | 12 import 'package:analysis_server/src/services/index/index.dart'; |
| 13 import 'package:analysis_server/src/services/search/search_engine.dart'; | 13 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 14 import 'package:analyzer/dart/element/element.dart'; | 14 import 'package:analyzer/dart/element/element.dart'; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Instances of the class [SearchDomainHandler] implement a [RequestHandler] | 17 * Instances of the class [SearchDomainHandler] implement a [RequestHandler] |
| 18 * that handles requests in the search domain. | 18 * that handles requests in the search domain. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 protocol.Response response = | 162 protocol.Response response = |
| 163 new protocol.SearchGetTypeHierarchyResult(hierarchyItems: items) | 163 new protocol.SearchGetTypeHierarchyResult(hierarchyItems: items) |
| 164 .toResponse(request.id); | 164 .toResponse(request.id); |
| 165 server.sendResponse(response); | 165 server.sendResponse(response); |
| 166 } | 166 } |
| 167 | 167 |
| 168 @override | 168 @override |
| 169 protocol.Response handleRequest(protocol.Request request) { | 169 protocol.Response handleRequest(protocol.Request request) { |
| 170 try { | 170 try { |
| 171 String requestName = request.method; | 171 String requestName = request.method; |
| 172 if (requestName == SEARCH_FIND_ELEMENT_REFERENCES) { | 172 if (requestName == SEARCH_REQUEST_FIND_ELEMENT_REFERENCES) { |
| 173 findElementReferences(request); | 173 findElementReferences(request); |
| 174 return protocol.Response.DELAYED_RESPONSE; | 174 return protocol.Response.DELAYED_RESPONSE; |
| 175 } else if (requestName == SEARCH_FIND_MEMBER_DECLARATIONS) { | 175 } else if (requestName == SEARCH_REQUEST_FIND_MEMBER_DECLARATIONS) { |
| 176 findMemberDeclarations(request); | 176 findMemberDeclarations(request); |
| 177 return protocol.Response.DELAYED_RESPONSE; | 177 return protocol.Response.DELAYED_RESPONSE; |
| 178 } else if (requestName == SEARCH_FIND_MEMBER_REFERENCES) { | 178 } else if (requestName == SEARCH_REQUEST_FIND_MEMBER_REFERENCES) { |
| 179 findMemberReferences(request); | 179 findMemberReferences(request); |
| 180 return protocol.Response.DELAYED_RESPONSE; | 180 return protocol.Response.DELAYED_RESPONSE; |
| 181 } else if (requestName == SEARCH_FIND_TOP_LEVEL_DECLARATIONS) { | 181 } else if (requestName == SEARCH_REQUEST_FIND_TOP_LEVEL_DECLARATIONS) { |
| 182 findTopLevelDeclarations(request); | 182 findTopLevelDeclarations(request); |
| 183 return protocol.Response.DELAYED_RESPONSE; | 183 return protocol.Response.DELAYED_RESPONSE; |
| 184 } else if (requestName == SEARCH_GET_TYPE_HIERARCHY) { | 184 } else if (requestName == SEARCH_REQUEST_GET_TYPE_HIERARCHY) { |
| 185 getTypeHierarchy(request); | 185 getTypeHierarchy(request); |
| 186 return protocol.Response.DELAYED_RESPONSE; | 186 return protocol.Response.DELAYED_RESPONSE; |
| 187 } | 187 } |
| 188 } on protocol.RequestFailure catch (exception) { | 188 } on protocol.RequestFailure catch (exception) { |
| 189 return exception.response; | 189 return exception.response; |
| 190 } | 190 } |
| 191 return null; | 191 return null; |
| 192 } | 192 } |
| 193 | 193 |
| 194 void _sendSearchNotification( | 194 void _sendSearchNotification( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 209 void _sendTypeHierarchyNull(protocol.Request request) { | 209 void _sendTypeHierarchyNull(protocol.Request request) { |
| 210 protocol.Response response = | 210 protocol.Response response = |
| 211 new protocol.SearchGetTypeHierarchyResult().toResponse(request.id); | 211 new protocol.SearchGetTypeHierarchyResult().toResponse(request.id); |
| 212 server.sendResponse(response); | 212 server.sendResponse(response); |
| 213 } | 213 } |
| 214 | 214 |
| 215 static protocol.SearchResult toResult(SearchMatch match) { | 215 static protocol.SearchResult toResult(SearchMatch match) { |
| 216 return protocol.newSearchResult_fromMatch(match); | 216 return protocol.newSearchResult_fromMatch(match); |
| 217 } | 217 } |
| 218 } | 218 } |
| OLD | NEW |