OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library services.index.indexable_file; | 5 library services.index.indexable_file; |
6 | 6 |
7 import 'package:analysis_server/plugin/index/index_core.dart'; | 7 import 'package:analysis_server/src/provisional/index/index_core.dart'; |
8 import 'package:analyzer/src/generated/engine.dart'; | 8 import 'package:analyzer/src/generated/engine.dart'; |
9 | 9 |
10 /** | 10 /** |
11 * An [IndexableObject] which is used to index references to a file. | 11 * An [IndexableObject] which is used to index references to a file. |
12 */ | 12 */ |
13 class IndexableFile implements IndexableObject { | 13 class IndexableFile implements IndexableObject { |
14 /** | 14 /** |
15 * The path of the file to be indexed. | 15 * The path of the file to be indexed. |
16 */ | 16 */ |
17 @override | 17 @override |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 IndexableFile decode(AnalysisContext context, String filePath, int offset) { | 65 IndexableFile decode(AnalysisContext context, String filePath, int offset) { |
66 return new IndexableFile(filePath); | 66 return new IndexableFile(filePath); |
67 } | 67 } |
68 | 68 |
69 @override | 69 @override |
70 int encodeHash(StringToInt stringToInt, IndexableFile indexable) { | 70 int encodeHash(StringToInt stringToInt, IndexableFile indexable) { |
71 String path = indexable.path; | 71 String path = indexable.path; |
72 return stringToInt(path); | 72 return stringToInt(path); |
73 } | 73 } |
74 } | 74 } |
OLD | NEW |