-
Notifications
You must be signed in to change notification settings - Fork 236
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
Update language_python.lua #1723
Conversation
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.
Would you mind also posting some "before" screenshots?
data/plugins/language_python.lua
Outdated
{ pattern = ":%s*[%a_][%w_]*[:%]]", type = "normal" }, | ||
{ pattern = "lambda().*:[%s%a_]", type = {"keyword, normal"} }, | ||
{ pattern = { ":", "[,%)\n]"}, type = "normal", syntax = python_type }, | ||
{ pattern = { "->()", ":" }, type = {"operator", "normal"}, syntax = python_type }, |
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.
{ pattern = { "->()", ":" }, type = {"operator", "normal"}, syntax = python_type }, | |
{ pattern = { "->", ":" }, type = "operator", syntax = python_type }, |
… it a value at the same time
Dictionaries appear now normally
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
So, in this last commit, I fixed the one-liner syntax bug (see before and after pictures) I also made some changes to how the minus sign registers as a Note: While testing the syntax, I noticed that it was becoming a bit too complicated and that some python files took several seconds to open. I will welcome any advice to optimize this mess. After: |
Syntax more optimized but a tiny bit more complex...
Do you have example files for us to confirm if this is the case? I cannot replicate this when opening https://github.com/emscripten-core/emscripten/blob/main/tools/file_packager.py |
I actually fixed this problem by reducing to the maximum any cyclic sub-syntax reference (and especially removed the cyclic reference to the main syntax table) in the last few commits. The performances are much better now |
* Update language_python.lua * Update language_python.lua * Update language_python.lua * implemented a better `python_type` subsyntax * Update language_python.lua * fixed a small error where you couldn't hint a type at a var and guive it a value at the same time * Update language_python.lua * Update language_python.lua Dictionaries appear now normally * Update language_python.lua * added suggestions concerning strings * commited suggestion Co-authored-by: Guldoman <giulio.lettieri@gmail.com> * Various changes * Update language_python.lua Syntax more optimized but a tiny bit more complex... * Simplified everything --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* Update language_python.lua * Update language_python.lua * Update language_python.lua * implemented a better `python_type` subsyntax * Update language_python.lua * fixed a small error where you couldn't hint a type at a var and guive it a value at the same time * Update language_python.lua * Update language_python.lua Dictionaries appear now normally * Update language_python.lua * added suggestions concerning strings * commited suggestion Co-authored-by: Guldoman <giulio.lettieri@gmail.com> * Various changes * Update language_python.lua Syntax more optimized but a tiny bit more complex... * Simplified everything --------- Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
Added highlighting for type declarations (set them as
keyword 2
(both for functions and variables))Added f-string support
Will break the syntax highlighting of some one-liners