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) {