Page MenuHomePhabricator

When highlighting source, catch "python" for the PHP parser
ClosedPublic

Authored by epriestley on Feb 28 2019, 8:57 PM.
Tags
None
Referenced Files
F15537402: D20231.diff
Thu, Apr 24, 1:30 PM
F15534697: D20231.id48301.diff
Thu, Apr 24, 1:19 AM
F15481859: D20231.id48301.diff
Tue, Apr 8, 11:54 PM
F15481858: D20231.id48301.diff
Tue, Apr 8, 11:54 PM
F15445953: D20231.id48291.diff
Thu, Mar 27, 4:43 PM
F15439347: D20231.id48301.diff
Wed, Mar 26, 7:06 AM
F15436130: D20231.id.diff
Mar 25 2025, 12:07 PM
F15432025: D20231.diff
Mar 24 2025, 3:54 PM
Subscribers
None

Details

Summary

See PHI1065. Normally, Python files are called ".py" and we end up with the lexer coded as "py" by the time we get here, but if you "Highlight As..." and select "Python" we can end up here with "python". (Probably also if you name a file "something.python", although this is very unusual.)

Catch both "py" and "python" for our highlighter.

T3626 should eventually standardize and moot this, but since this patch is only a quarter of a line long it seems reasonable until then.

Test Plan

Added a phlog(), verified we now hit the first-party highlighter with "Highlight As... > Python".

Diff Detail

Repository
rPHU libphutil
Branch
python1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22153
Build 30275: Run Core Tests
Build 30274: arc lint + arc unit