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

Unified Diff: pkg/analysis_server/lib/analysis/index_core.dart

Issue 1378843003: Remove the 'name' and 'length' getters from IndexableObject. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/lib/src/services/index/index.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/analysis/index_core.dart
diff --git a/pkg/analysis_server/lib/analysis/index_core.dart b/pkg/analysis_server/lib/analysis/index_core.dart
index aac9d8a303bc800df776a0c824d761cdeccde080..a79c4147fc809b9d6a64439273bce4f8979a9cbc 100644
--- a/pkg/analysis_server/lib/analysis/index_core.dart
+++ b/pkg/analysis_server/lib/analysis/index_core.dart
@@ -12,6 +12,11 @@ import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
/**
+ * Return the integer value that corresponds to the given [str].
+ */
+typedef int StringToInt(String str);
+
+/**
* An object that can have a [Relationship] with various [Location]s in a code
* base. The object is abstractly represented by a [kind] and an [offset] within
* a [source].
@@ -29,17 +34,6 @@ abstract class IndexableObject {
IndexableObjectKind get kind;
/**
- * Return the length of the indexable object within its source.
- */
- int get length;
-
- /**
- * Return the name of this element.
- */
- // TODO(brianwilkerson) Remove the need for this getter.
- String get name;
-
- /**
* Return the offset of the indexable object within its source.
*/
int get offset;
@@ -88,6 +82,11 @@ abstract class IndexableObjectKind {
IndexableObject decode(AnalysisContext context, String filePath, int offset);
/**
+ * Returns an integer that corresponds to the name of [indexable].
Brian Wilkerson 2015/10/05 14:01:02 This needs to be more complete. What should it ret
scheglov 2015/10/05 14:28:16 Done.
+ */
+ int encodeHash(StringToInt stringToInt, IndexableObject indexable);
+
+ /**
* Return the object kind with the given [index].
*/
static IndexableObjectKind getKind(int index) {
@@ -108,19 +107,6 @@ abstract class IndexableObjectKind {
}
}
-/**
- * An object used to add relationships to the index.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class IndexContributor {
- /**
- * Contribute relationships existing in the given [object] to the given
- * index [store] in the given [context].
- */
- void contributeTo(IndexStore store, AnalysisContext context, Object object);
-}
-
// A sketch of what the driver routine might look like:
//
//void buildIndexForSource(AnalysisContext context, Source source) {
@@ -136,6 +122,19 @@ abstract class IndexContributor {
//}
/**
+ * An object used to add relationships to the index.
+ *
+ * Clients are expected to subtype this class when implementing plugins.
+ */
+abstract class IndexContributor {
+ /**
+ * Contribute relationships existing in the given [object] to the given
+ * index [store] in the given [context].
+ */
+ void contributeTo(IndexStore store, AnalysisContext context, Object object);
+}
+
+/**
* An object that stores information about the relationships between locations
* in a code base.
*
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/index/index.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698