Page MenuHomePhabricator

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

Authored by epriestley on Thu, Feb 28, 8:57 PM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Thu, Feb 28, 8:57 PM
epriestley requested review of this revision.Thu, Feb 28, 8:57 PM
amckinley accepted this revision.Fri, Mar 1, 12:12 AM
This revision is now accepted and ready to land.Fri, Mar 1, 12:12 AM
This revision was automatically updated to reflect the committed changes.