-
Notifications
You must be signed in to change notification settings - Fork 69
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
Consider using Python AST #99
Comments
Via #71:
Yay! \o/
Depends on what you mean with "paragraph" .. ;)
Not the whole file necessarily, but it uses This indent plugin is certainly not very well optimized for performance though indeed.
Yes. Fortunately there are a lot of tests already - and although they are clumsy by themselves it helps to avoid regressions. |
Please let me know if you are missing features in parso. |
@davidhalter Can you provide us any pointers already to get to the information that is needed for getting the indent of a line? |
I don't think that you can easily determine what the indentation of a line is, if you think about newlines and other empty space or multi line statements. However once you have a node in parso you can just use What you could always do is scan for |
btw: I've found this https://github.com/sillybun/autoformatpythonstatement. It uses cpp code to get the indent (called via Python): https://github.com/sillybun/autoformatpythonstatement/blob/master/ftplugin/python/afpython.cpp. |
Via #71 (comment).
It might make sense to use a library like https://github.com/ambv/black/
However, this would likely involve quite some overhead if the whole text would need to be sent/used/tokenized everytime.
/cc @purpleP
The text was updated successfully, but these errors were encountered: