abingham / traad

An JSON+HTTP server for the rope Python refactoring library
MIT License
107 stars 20 forks source link

Investigate support for multi-project refactorings #15

Closed abingham closed 11 years ago

abingham commented 12 years ago

Just understand the issues a bit more. This is a bit fringe-feeling right now, but I'd like to avoid going too far down one design path that makes multi-project support difficult in the future.

monsanto commented 12 years ago

Perhaps the solution is to allow nested projects? Then you perform the refactor in the context of the larger project.

abingham commented 12 years ago

We would need to map the notion of "nesting" onto rope's notion of projects. I don't know if rope supports nesting in any direct way, but it apparently does support multiple "project roots", at least with respect to certain refactorings. The first phase of this task is just to wrap my head around what rope supports, and then decide how that maps best to traad/emacs.

The notion of project nesting may belong more naturally to a project-management tool like eproject or prosjekt. These could impose a notion of nesting which is then translated to rope's API somehow. Plenty to explore here...thanks for the ideas!

abingham commented 11 years ago

Part of this API might include the ability to "add" and "remove" projects from a running server instance.

tkf commented 11 years ago

Why not run a server for each project? I guess it will be relatively easy. Also you can support Python 3 project this way (although I don't know if rope requires Python 3 executable to refactor Python 3 project).

abingham commented 11 years ago

I assume that rope needs some unified view of a collection of project if it's going to apply a refactoring across several of them at once. I may be wrong, and that's why this task still needs investigation.

abingham commented 11 years ago

Also, FWIW, I believe that rope does need to run under Python3 in order to work with python3 code.

tkf commented 11 years ago

refactoring across several of them

I didn't know that rope can do that. That would be a very cool feature.

abingham commented 11 years ago

Rope mentions "cross-project refactorings" on their main page, and the package includes rope.refactor.muiltiproject which seems to be the key for that. They have a bit of documentation on it, but I haven't really looked through it yet.

abingham commented 11 years ago

This seems to more-or-less work now. Perhaps the API could use some tweaking, but I'll leave time and practice to sort that out.