Open kootenpv opened 8 years ago
Hello, and thanks for the suggestion! This looks like an interesting tool. I'd have to see how much code it actually handles – it would probably be a better idea if this would use Python to parse Python instead of a homegrown parser, though.
use Python to parse Python
I think so too, - compiler.parse()
AST also can be parsed by elisp similar to js2-mode, but it's more difficult.
Btw, rope works great for me.
Also emacs has parser for python in builtin sematic. But native compiler.parse() maybe a better solution.
@emacsway Does rope handle list comprehension/decomprehension?
I mean, that rope works great for me (for refactoring, autocomplete). Even if @jorgenschaefer will exclude rope from elpy (I hope this will never happen), - I'll use rope with ropemacs in this case (sometimes I use ropemacs today, for example for rope-find-occurrences).
Does rope handle list comprehension/decomprehension?
@kootenpv maybe does, but not explicitly, by Restructuring. But rope has clean code, stable interfaces, and excellent codebase, it's easy to extend rope. You can use rope's parsed syntax tree (based on AST) to create explicit refactoring method for comprehension/decomprehension.
Also see source code of lib2to3, it also does refactoring by AST (yapf uses it). But I think, pull request to rope will be better (it's not good to have a lot of dependencies). Btw, author of yapf has did commits to rope.
Also see wisent-python-lex-buffer in emacs-src/lisp/cedet/semantic/wisent/python.el (if you prefer elisp rather than python)
I will not include a Python parser written in Emacs Lisp in Elpy.
It's builtin in emacs since 2010-01-10, see log history of emacs source code http://git.savannah.gnu.org/cgit/emacs.git/log/lisp/cedet/semantic/wisent/python.el We don't need to include it, it's already included.
I'm interested in adding support for refactoring to Emacs / Python.
I remember refactoring was discontinued for elpy, and I was wondering if this could be an addition to
elpy
at some point:https://github.com/kootenpv/python-comprehension