OLD | NEW |
1 part of dartdoc_search_test; | |
2 | |
3 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 // 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 |
5 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
6 | 4 |
7 /** | 5 /** |
8 * [SearchText] represent the search field text. The text is viewed in three | 6 * [SearchText] represent the search field text. The text is viewed in three |
9 * ways: [text] holds the original search text, used for performing | 7 * ways: [text] holds the original search text, used for performing |
10 * case-sensitive matches, [lowerCase] holds the lower-case search text, used | 8 * case-sensitive matches, [lowerCase] holds the lower-case search text, used |
11 * for performing case-insenstive matches, [camelCase] holds a camel-case | 9 * for performing case-insenstive matches, [camelCase] holds a camel-case |
12 * interpretation of the search text, used to order matches in camel-case. | 10 * interpretation of the search text, used to order matches in camel-case. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // Sort type alphabetically. | 215 // Sort type alphabetically. |
218 // TODO(4805): Use [:type.compareToIgnoreCase] when supported. | 216 // TODO(4805): Use [:type.compareToIgnoreCase] when supported. |
219 result = a.type.toLowerCase().compareTo(b.type.toLowerCase()); | 217 result = a.type.toLowerCase().compareTo(b.type.toLowerCase()); |
220 if (result != 0) return result; | 218 if (result != 0) return result; |
221 } | 219 } |
222 | 220 |
223 // Sort match alphabetically. | 221 // Sort match alphabetically. |
224 // TODO(4805): Use [:text.compareToIgnoreCase] when supported. | 222 // TODO(4805): Use [:text.compareToIgnoreCase] when supported. |
225 return a.match.text.toLowerCase().compareTo(b.match.text.toLowerCase()); | 223 return a.match.text.toLowerCase().compareTo(b.match.text.toLowerCase()); |
226 } | 224 } |
OLD | NEW |