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

Unified Diff: pkg/analysis_server/lib/src/services/index/local_index.dart

Issue 1156493004: Move index closer to the plugin API (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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/analysis_server/lib/src/services/index/local_index.dart
diff --git a/pkg/analysis_server/lib/src/services/index/local_index.dart b/pkg/analysis_server/lib/src/services/index/local_index.dart
index a11db6d90d51a5d5cd2fabef5fe79fa452767e0f..887a003af9af4b500e9ab3e61c224f69b75dc09a 100644
--- a/pkg/analysis_server/lib/src/services/index/local_index.dart
+++ b/pkg/analysis_server/lib/src/services/index/local_index.dart
@@ -6,9 +6,10 @@ library services.src.index.local_index;
import 'dart:async';
+import 'package:analysis_server/analysis/index/index_core.dart';
import 'package:analysis_server/src/services/index/index.dart';
import 'package:analysis_server/src/services/index/index_contributor.dart'
- as contributors;
+ as oldContributors;
import 'package:analysis_server/src/services/index/store/split_store.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
@@ -20,6 +21,11 @@ import 'package:analyzer/src/generated/source.dart';
* A local implementation of [Index].
*/
class LocalIndex extends Index {
+ /**
+ * The index contributors used by this index.
+ */
+ List<IndexContributor> contributors;
+
SplitIndexStore _store;
LocalIndex(NodeManager nodeManager) {
@@ -52,8 +58,8 @@ class LocalIndex extends Index {
*/
@override
Future<List<LocationImpl>> getRelationships(
- Element element, RelationshipImpl relationship) {
- return _store.getRelationships(element, relationship);
+ IndexableObject indexable, RelationshipImpl relationship) {
+ return _store.getRelationships(indexable, relationship);
}
@override
@@ -63,12 +69,18 @@ class LocalIndex extends Index {
@override
void indexHtmlUnit(AnalysisContext context, HtmlUnit unit) {
- contributors.indexHtmlUnit(_store, context, unit);
+ oldContributors.indexHtmlUnit(_store, context, unit);
}
@override
void indexUnit(AnalysisContext context, CompilationUnit unit) {
- contributors.indexDartUnit(_store, context, unit);
+ oldContributors.indexDartUnit(_store, context, unit);
+ }
+
+ @override
+ void recordRelationship(
+ IndexableObject indexable, Relationship relationship, Location location) {
+ _store.recordRelationship(indexable, relationship, location);
}
@override

Powered by Google App Engine
This is Rietveld 408576698