Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: pkg/analysis_server/lib/src/search/search_domain.dart

Issue 456613004: Integration test search.getTypeHierarchy and make some minor fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/protocol.dart ('k') | pkg/analysis_server/lib/src/search/type_hierarchy.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/search/search_domain.dart
diff --git a/pkg/analysis_server/lib/src/search/search_domain.dart b/pkg/analysis_server/lib/src/search/search_domain.dart
index 9b35b4c71c8d14e657129a78f5335e49bb421cbe..a57cdffbfad8ad2332b5685ebc6aabb4a5c0221f 100644
--- a/pkg/analysis_server/lib/src/search/search_domain.dart
+++ b/pkg/analysis_server/lib/src/search/search_domain.dart
@@ -137,15 +137,20 @@ class SearchDomainHandler implements RequestHandler {
int offset = request.getRequiredParameter(OFFSET).asInt();
// prepare Element
List<Element> elements = server.getElementsAtOffset(file, offset);
+ Response response = new Response(request.id);
if (elements.isEmpty) {
- return new Response(request.id);
+ response.setEmptyResult();
scheglov 2014/08/08 18:40:33 I don't understand why we do this. The field shoul
Paul Berry 2014/08/08 19:23:04 Without this call the response message would be
+ return response;
}
Element element = elements.first;
// prepare type hierarchy
TypeHierarchyComputer computer = new TypeHierarchyComputer(searchEngine);
computer.compute(element).then((List<TypeHierarchyItem> items) {
- Response response = new Response(request.id);
- response.setResult(HIERARCHY_ITEMS, objectToJson(items));
+ if (items != null) {
+ response.setResult(HIERARCHY_ITEMS, objectToJson(items));
+ } else {
+ response.setEmptyResult();
scheglov 2014/08/08 18:40:33 Same here.
+ }
server.sendResponse(response);
});
// delay response
« no previous file with comments | « pkg/analysis_server/lib/src/protocol.dart ('k') | pkg/analysis_server/lib/src/search/type_hierarchy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698