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

Side by Side Diff: pkg/analysis_server/lib/analysis/index/index_dart.dart

Issue 1060063008: Add API for contributing to the index (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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) 2015, 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 analysis_server.analysis.index.index_core;
6
7 import 'package:analysis_server/analysis/index/index_core.dart';
8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/source.dart';
11
12 /**
13 * An [IndexContributor] that can be used to contribute relationships for Dart
14 * files.
15 *
16 * Clients are expected to subtype this class when implementing plugins.
17 */
18 abstract class DartIndexContributor extends IndexContributor {
19 @override
20 void contributeTo(IndexStore store, AnalysisContext context, Source source) {
21 if (!AnalysisEngine.isDartFileName(source.fullName)) {
22 return;
23 }
24 List<Source> libraries = context.getLibrariesContaining(source);
25 if (libraries.isEmpty) {
26 return;
27 }
28 libraries.forEach((Source library) {
29 CompilationUnit unit = context.resolveCompilationUnit2(source, library);
30 if (unit != null) {
31 internalContributeTo(store, unit);
32 }
33 });
34 }
35
36 /**
37 * Contribute relationships to the given index [store] based on the given
38 * fully resolved compilation[unit].
39 */
40 void internalContributeTo(IndexStore store, CompilationUnit unit);
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698