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

Side by Side Diff: pkg/analysis_server/lib/src/search/top_level_declarations.dart

Issue 396883002: Implementation for the 'search.findMemberReferences' API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library search.top_level_declarations;
6
7 import 'dart:async';
8
9 import 'package:analysis_server/src/search/search_result.dart';
10 import 'package:analysis_services/search/search_engine.dart';
11
12
13 /**
14 * A computer for `search.findTopLevelDeclarations` request results.
15 */
16 class TopLevelDeclarationsComputer {
17 final SearchEngine searchEngine;
18
19 TopLevelDeclarationsComputer(this.searchEngine);
20
21 /**
22 * Computes [SearchResult]s for top-level [element] declarations.
23 */
24 Future<List<SearchResult>> compute(String pattern) {
25 var matchesFuture = searchEngine.searchTopLevelDeclarations(pattern);
26 return matchesFuture.then((List<SearchMatch> matches) {
27 return matches.map(toResult).toList();
28 });
29 }
30
31 static SearchResult toResult(SearchMatch match) {
32 return new SearchResult.fromMatch(match);
33 }
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698