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

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

Issue 536563002: Test for 'search.findElementReferences' for the case when there is no element. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « no previous file | pkg/analysis_server/test/search/element_references_test.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 8262efd62b8e99be1a4d53ee99a203b29bfed908..e2ba682215d8929f55f2cd80f7c35919985b1f77 100644
--- a/pkg/analysis_server/lib/src/search/search_domain.dart
+++ b/pkg/analysis_server/lib/src/search/search_domain.dart
@@ -64,14 +64,12 @@ class SearchDomainHandler implements protocol.RequestHandler {
});
});
// respond
- if (elements.isEmpty) {
- return new protocol.SearchFindElementReferencesResult().toResponse(
- request.id);
- } else {
- protocol.Element element = new protocol.Element.fromEngine(elements[0]);
- return new protocol.SearchFindElementReferencesResult(id: searchId,
- element: element).toResponse(request.id);
+ var result = new protocol.SearchFindElementReferencesResult();
+ if (elements.isNotEmpty) {
+ result.id = searchId;
+ result.element = new protocol.Element.fromEngine(elements[0]);
}
+ return result.toResponse(request.id);
}
protocol.Response findMemberDeclarations(protocol.Request request) {
« no previous file with comments | « no previous file | pkg/analysis_server/test/search/element_references_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698