Chromium Code Reviews| 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. |
| * |