Differential D17684 Diff 42532 src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php
| Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | return array( | ||||
| ->setSummary( | ->setSummary( | ||||
| pht('Set the language list which appears in dropdowns.')) | pht('Set the language list which appears in dropdowns.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| 'In places that we display a dropdown to syntax-highlight code, '. | 'In places that we display a dropdown to syntax-highlight code, '. | ||||
| 'this is where that list is defined.')), | 'this is where that list is defined.')), | ||||
| $this->newOption( | $this->newOption( | ||||
| 'syntax.filemap', | 'syntax.filemap', | ||||
| 'wild', | 'custom:PhabricatorConfigRegexOptionType', | ||||
| array( | array( | ||||
| '@\.arcconfig$@' => 'json', | '@\.arcconfig$@' => 'json', | ||||
| '@\.arclint$@' => 'json', | '@\.arclint$@' => 'json', | ||||
| '@\.divinerconfig$@' => 'json', | '@\.divinerconfig$@' => 'json', | ||||
| )) | )) | ||||
| ->setSummary( | ->setSummary( | ||||
| pht('Override what language files (based on filename) highlight as.')) | pht('Override what language files (based on filename) highlight as.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| 'This is an override list of regular expressions which allows '. | 'This is an override list of regular expressions which allows '. | ||||
| 'you to choose what language files are highlighted as. If your '. | 'you to choose what language files are highlighted as. If your '. | ||||
| 'projects have certain rules about filenames or use unusual or '. | 'projects have certain rules about filenames or use unusual or '. | ||||
| 'ambiguous language extensions, you can create a mapping here. '. | 'ambiguous language extensions, you can create a mapping here. '. | ||||
| 'This is an ordered dictionary of regular expressions which will '. | 'This is an ordered dictionary of regular expressions which will '. | ||||
| 'be tested against the filename. They should map to either an '. | 'be tested against the filename. They should map to either an '. | ||||
| 'explicit language as a string value, or a numeric index into '. | 'explicit language as a string value, or a numeric index into '. | ||||
| 'the captured groups as an integer.')) | 'the captured groups as an integer.')) | ||||
| ->addExample('{"@\\.xyz$@": "php"}', pht('Highlight %s as PHP.', '*.xyz')) | |||||
| ->addExample( | ->addExample( | ||||
| '{"@/httpd\\.conf@": "apacheconf"}', | '{"@\\\.xyz$@": "php"}', | ||||
| pht('Highlight %s as PHP.', '*.xyz')) | |||||
| ->addExample( | |||||
| '{"@/httpd\\\.conf@": "apacheconf"}', | |||||
| pht('Highlight httpd.conf as "apacheconf".')) | pht('Highlight httpd.conf as "apacheconf".')) | ||||
| ->addExample( | ->addExample( | ||||
| '{"@\\.([^.]+)\\.bak$@": 1}', | '{"@\\\.([^.]+)\\\.bak$@": 1}', | ||||
| pht( | pht( | ||||
| "Treat all '*.x.bak' file as '.x'. NOTE: We map to capturing group ". | "Treat all '*.x.bak' file as '.x'. NOTE: We map to capturing group ". | ||||
| "1 by specifying the mapping as '1'")), | "1 by specifying the mapping as '1'")), | ||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||