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
F19936355: D20231.id48291.diff
Sun, Apr 12, 8:40 AM
F19936353: D20231.id48291.diff
Sun, Apr 12, 8:30 AM
F19894906: D20231.id.diff
Sat, Mar 28, 5:48 PM
F19893828: D20231.id48291.diff
Sat, Mar 28, 9:24 AM
F19719183: D20231.diff
Feb 12 2026, 5:29 PM
F19712741: D20231.diff
Feb 11 2026, 9:14 PM
F19543142: D20231.diff
Jan 22 2026, 3:36 PM
F19527697: D20231.diff
Jan 19 2026, 3:36 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable