-
-
Notifications
You must be signed in to change notification settings - Fork 772
Support for python 3.5 async/await keywords #631
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
Conversation
Highlight them and fix folding of "async def" functions
This should fix issue #616 |
#627 came first, what's the difference in both of your approaches? |
#627 doesn't having the folding regex portion, so this PR makes sense. |
@@ -75,6 +75,7 @@ endif | |||
syn keyword pythonStatement yield | |||
syn keyword pythonLambdaExpr lambda | |||
syn keyword pythonStatement with as | |||
syn keyword pythonStatement async await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice https://github.com/klen/python-mode/pull/627/files is a bit more elaborate than this. What's the difference in how it'd work?
#627 implements |
Amend yours without the async part. Then we can accept both PR’s. I’m working off a branch with that configuration ATM. I can confirm it works for me. |
But on the other hand, |
Good point, I added |
Good point. I’m fine with either approach. Wouldn’t that break highlighting for lower python versions though? |
It will mean that async will be highlighted as a keyword everywhere (not only with |
+1 for thinking ahead. Though I wouldn’t want to break highlighting for older python versions. Most projects are still using Python 2.x at this time. It’s not always the developer’s choice what python version and conventions they use. While it’s probably best practice for developers on lower versions to abstain from using future reserved keywords, highlighting should reflect the python version being used accurately. Have you considered any ways to support all 3 cases, 3.4 and below, 3.5 and 3.6+ |
It's not a big deal to me personally. To people on legacy projects, it's hard to tell. It can be highly annoying to have local variables highlighted as keywords. |
Yep, totally agree: How about adding possibility to disable highlighting for Like this |
Highlight them and fix folding of "async def" functions