OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.search_engine; | 5 library services.search_engine; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/visitor.dart'; | 10 import 'package:analyzer/dart/element/visitor.dart'; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 return _element; | 173 return _element; |
174 } | 174 } |
175 | 175 |
176 /** | 176 /** |
177 * The absolute path of the file containing the match. | 177 * The absolute path of the file containing the match. |
178 */ | 178 */ |
179 String get file => unitSource.fullName; | 179 String get file => unitSource.fullName; |
180 | 180 |
181 @override | 181 @override |
182 int get hashCode { | 182 int get hashCode { |
183 return JenkinsSmiHash.hash4(libraryUri, unitUri, kind, sourceRange); | 183 return JenkinsSmiHash.hash4(libraryUri.hashCode, unitUri.hashCode, |
| 184 kind.hashCode, sourceRange.hashCode); |
184 } | 185 } |
185 | 186 |
186 /** | 187 /** |
187 * Return the [LibraryElement] for the [libraryUri] in the [context]. | 188 * Return the [LibraryElement] for the [libraryUri] in the [context]. |
188 */ | 189 */ |
189 LibraryElement get libraryElement { | 190 LibraryElement get libraryElement { |
190 _libraryElement ??= context.getLibraryElement(librarySource); | 191 _libraryElement ??= context.getLibraryElement(librarySource); |
191 return _libraryElement; | 192 return _libraryElement; |
192 } | 193 } |
193 | 194 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 if (element is ElementImpl) { | 267 if (element is ElementImpl) { |
267 if (element.codeOffset != null && | 268 if (element.codeOffset != null && |
268 element.codeOffset <= offset && | 269 element.codeOffset <= offset && |
269 offset <= element.codeOffset + element.codeLength) { | 270 offset <= element.codeOffset + element.codeLength) { |
270 containingElement = element; | 271 containingElement = element; |
271 super.visitElement(element); | 272 super.visitElement(element); |
272 } | 273 } |
273 } | 274 } |
274 } | 275 } |
275 } | 276 } |
OLD | NEW |