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

Unified Diff: pkg/analysis_server/lib/plugin/index/index_core.dart

Issue 1413563004: Make IndexableObjectKind parameterized. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Clean up IndexableElementKind. 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/plugin/index/index_core.dart
diff --git a/pkg/analysis_server/lib/plugin/index/index_core.dart b/pkg/analysis_server/lib/plugin/index/index_core.dart
index 10fc335c469f5454cd70063ccd55200c57b90d59..f13ebee8d252c4d58e22e5beb65e9d17bf402039 100644
--- a/pkg/analysis_server/lib/plugin/index/index_core.dart
+++ b/pkg/analysis_server/lib/plugin/index/index_core.dart
@@ -24,7 +24,7 @@ typedef int StringToInt(String string);
/**
* 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].
+ * a file with the [filePath].
*
* Clients must ensure that two distinct objects in the same source cannot have
* the same kind and offset. Failure to do so will make it impossible for
@@ -44,7 +44,7 @@ abstract class IndexableObject {
IndexableObjectKind get kind;
/**
- * Return the offset of the indexable object within its source.
+ * Return the offset of the indexable object within its file.
*/
int get offset;
}
@@ -54,7 +54,7 @@ abstract class IndexableObject {
*
* Clients are expected to implement this class when implementing plugins.
*/
-abstract class IndexableObjectKind {
+abstract class IndexableObjectKind<T extends IndexableObject> {
/**
* The next available index for a newly created kind of indexable object.
*/
@@ -84,7 +84,7 @@ abstract class IndexableObjectKind {
* [context], in the source with the given [filePath], and at the given
* [offset].
*/
- IndexableObject decode(AnalysisContext context, String filePath, int offset);
+ T decode(AnalysisContext context, String filePath, int offset);
/**
* Returns the hash value that corresponds to the given [indexable].
@@ -105,7 +105,7 @@ abstract class IndexableObjectKind {
* object does not have a name, some other value may be returned, but it still
* must be always the same for the same object and have good selectivity.
*/
- int encodeHash(StringToInt stringToInt, IndexableObject indexable);
+ int encodeHash(StringToInt stringToInt, T indexable);
/**
* Return the object kind with the given [index].
« 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