Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13979697
D17012.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17012.diff
View Options
diff --git a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
--- a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
+++ b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
@@ -141,7 +141,9 @@
return array();
}
- $tokens = preg_split('/[\s\[\]-]+/u', $string);
+ // NOTE: Splitting on "(" and ")" is important for milestones.
+
+ $tokens = preg_split('/[\s\[\]\(\)-]+/u', $string);
$tokens = array_unique($tokens);
// Make sure we don't return the empty token, as this will boil down to a
diff --git a/src/applications/typeahead/datasource/__tests__/PhabricatorTypeaheadDatasourceTestCase.php b/src/applications/typeahead/datasource/__tests__/PhabricatorTypeaheadDatasourceTestCase.php
--- a/src/applications/typeahead/datasource/__tests__/PhabricatorTypeaheadDatasourceTestCase.php
+++ b/src/applications/typeahead/datasource/__tests__/PhabricatorTypeaheadDatasourceTestCase.php
@@ -27,6 +27,18 @@
$this->assertTokenization(
'[[ brackets ]] [-] ]-[ tie-fighters',
array('brackets', 'tie', 'fighters'));
+
+ $this->assertTokenization(
+ 'viewer()',
+ array('viewer'));
+
+ $this->assertTokenization(
+ 'Work (Done)',
+ array('work', 'done'));
+
+ $this->assertTokenization(
+ 'A (B C D)',
+ array('a', 'b', 'c', 'd'));
}
private function assertTokenization($input, $expect) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 5:56 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6713303
Default Alt Text
D17012.diff (1 KB)
Attached To
Mode
D17012: Tokenize datasource indexes on "(" and ")"
Attached
Detach File
Event Timeline
Log In to Comment