Page MenuHomePhabricator

D17012.diff
No OneTemporary

D17012.diff

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

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)

Event Timeline