New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokenize function and parameter annotations #228

Merged
merged 6 commits into from Jan 25, 2018

Conversation

Projects
None yet
3 participants
@50Wliu
Member

50Wliu commented Jan 22, 2018

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Tokenizes optional function and parameter annotations in accordance with PEP-3107.

Alternate Designs

I looked at the three prior attempts.
#84 did not add support for function return-value annotations
#88 did not add highlighting for annotations
#95 when I was testing it didn't appear to support function return-value annotations

Benefits

Fully supports PEP-3107, which has been in effect since Python 3.0 was released.

Possible Drawbacks

This PR does include some minor relaxations in function definition syntax in order to more easily accommodate annotations. These changes also don't apply at all to Python 2 files.

Applicable Issues

Fixes #68
Supersedes and closes #84
Supersedes and closes #88
Supersedes and closes #95

@corylation @berdario @pchaigno many thanks for your PRs.

@corylation @berdario @pchaigno @MaximSokolov I'd like to merge this soon (probably by Tuesday/Wednesday), but if you have any issues with the scope names I'm using please tell me!

corylation and others added some commits Aug 4, 2015

@50Wliu 50Wliu added the needs-review label Jan 22, 2018

@50Wliu

This comment has been minimized.

Member

50Wliu commented Jan 22, 2018

Oh yeah, here's a picture.
python-annotations

50Wliu added some commits Jan 23, 2018

Remove highlighting of missing parameters
It's a bit too complicated to do now with annotations in the mix.

@50Wliu 50Wliu merged commit f86791c into master Jan 25, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@50Wliu 50Wliu deleted the wl-function-annotations branch Jan 25, 2018

@50Wliu 50Wliu referenced this pull request Mar 5, 2018

Closed

Syntax highlighting breaks down #237

1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment