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
F19505117: D20231.id48291.diff
Fri, Jan 9, 9:16 AM
F19440503: D20231.id48301.diff
Sun, Dec 28, 8:14 PM
F19082936: D20231.id48301.diff
Dec 2 2025, 12:27 PM
F18985056: D20231.id48291.diff
Nov 17 2025, 12:52 PM
F18789053: D20231.id48301.diff
Oct 15 2025, 7:43 AM
F18788052: D20231.id.diff
Oct 15 2025, 2:38 AM
F18787531: D20231.id.diff
Oct 15 2025, 12:11 AM
F18787132: D20231.id48291.diff
Oct 14 2025, 10:02 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable