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

Unified Diff: pkg/analyzer/lib/src/index/index_contributor.dart

Issue 365193004: Move Index and IndexStore implementations into Engine. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
Index: pkg/analyzer/lib/src/index/index_contributor.dart
diff --git a/pkg/analyzer/lib/src/index/index.dart b/pkg/analyzer/lib/src/index/index_contributor.dart
similarity index 99%
rename from pkg/analyzer/lib/src/index/index.dart
rename to pkg/analyzer/lib/src/index/index_contributor.dart
index db0e350b52bf7cbf94bc70ecd3dc267247434dd1..4020293ce09a654e97c4aaab4746bc35013910ca 100644
--- a/pkg/analyzer/lib/src/index/index.dart
+++ b/pkg/analyzer/lib/src/index/index_contributor.dart
@@ -5,7 +5,7 @@
// This code was auto-generated, is not intended to be edited, and is subject to
// significant change. Please see the README file for more information.
-library engine.src.index;
+library engine.src.index_contributor;
import 'dart:collection' show Queue;
@@ -27,11 +27,21 @@ import 'package:analyzer/src/generated/source.dart';
*/
void indexDartUnit(IndexStore store, AnalysisContext context,
CompilationUnit unit) {
+ // check unit
+ if (unit == null) {
+ return;
+ }
+ // prepare unit element
CompilationUnitElement unitElement = unit.element;
+ if (unitElement == null) {
+ return;
+ }
+ // about to index
bool mayIndex = store.aboutToIndexDart(context, unitElement);
if (!mayIndex) {
return;
}
+ // do index
unit.accept(new _IndexContributor(store));
unit.accept(new _AngularDartIndexContributor(store));
store.doneIndex();
@@ -43,11 +53,21 @@ void indexDartUnit(IndexStore store, AnalysisContext context,
*/
void indexHtmlUnit(IndexStore store, AnalysisContext context, ht.HtmlUnit unit)
{
+ // check unit
+ if (unit == null) {
+ return;
+ }
+ // prepare unit element
HtmlElement unitElement = unit.element;
+ if (unitElement == null) {
+ return;
+ }
+ // about to index
bool mayIndex = store.aboutToIndexHtml(context, unitElement);
if (!mayIndex) {
return;
}
+ // do index
unit.accept(new _AngularHtmlIndexContributor(store));
store.doneIndex();
}

Powered by Google App Engine
This is Rietveld 408576698