spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.26k stars 1.61k forks source link

Refactoring with Jedi ? #2388

Open Nodd opened 9 years ago

Nodd commented 9 years ago

I just saw this in gmane.comp.python.code-quality:

Hi!

This is an announcement to make you consider using Jedi as a static analysis library for your own stuff. If you want to build a refactoring or a linter library for Python you should just be using Jedi, it's doing all the work for you.

I have recently released Jedi 0.9.0. This release marks a change in the way how Jedi is structured. In the past Jedi had one objective only: Autocompletion.

Now Jedi is a general purpose, high quality static analysis engine. The static analysis capabilities are really good, but it's hard to describe what it does exactly. It's better than any other static analysis engine out there for sure.

Jedi's parser is built on the lib2to3 and therefore is able to create a "round-trip" representation of source code. After parsing and modifications to the syntax tree, Jedi echos the exact same source tree with the changes included, which is neat for refactoring. The parser also has built-in error recovery as well as support for different Python versions (Python version is a param).

Jedi has become quite powerful. If you're considering Jedi, I'm very happy to get you started. Let's talk!

https://github.com/davidhalter/jedi/

~ Dave

First, we should test that Jedi 0.9 is still coimpatible. Second, the refactoring abilities are very interesting ! I want that !

ccordoba12 commented 9 years ago

@blink1073?

blink1073 commented 9 years ago

I've been following the Jedi refactoring updates.
It supports:

http://jedi.readthedocs.org/en/latest/docs/development.html#module-jedi.refactoring

It does look interesting, but not something I've got the time or inclination to work on any time soon.