HomePhabricator

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

Description

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

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".

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20231

Details

Provenance
epriestleyAuthored on Feb 28 2019, 8:54 PM
epriestleyPushed on Mar 1 2019, 3:50 AM
Reviewer
amckinley
Differential Revision
D20231: When highlighting source, catch "python" for the PHP parser
Parents
rPHUa2bd64606d99: Add "phutil_describe_type()" and clean up a few obscure things in "libphutil/"
Branches
Unknown
Tags
Unknown
Build Status
Buildable 22163
Build 30289: Run Core Tests