rope
rope copied to clipboard
History support for multi-project refactorings?
Is there any support for doing undo/redo for multi-project refactorings? If not, are there plans for this?
I don't think this support exists and is not planned. What is your use case?
I'm writing a HTTP server that exposes rope functionality, and I'd like to let users add cross-projects to do multi-project refactorings. It offers undo/redo support for refactorings, and it seems like it would be odd if undo only worked for the root project.
I might be able to manage the multi-project un/redo support myself, but I'd like to avoid the work if it comes natively from rope.
Oh, I like this idea, I'd like to join this project :)
@sergeyglazyrindev Any help is appreciated! I'm in the middle of making some substantial changes, so it's in a weird state. But hopefully I'll have it back to "normal" soon.
@abingham , https://github.com/python-rope/rope/blob/master/rope/base/history.py
@abingham , what do you mean "for multi-project"?
@emacsway https://github.com/python-rope/rope/blob/master/rope/refactor/multiproject.py
I'm writing a HTTP server that exposes rope functionality,
I like the idea, but wouldn't it be better to support Language Server Protocol? Would it make sense? I believe that creativity around protocols is almost always The Wrong Idea™. This in end, maybe even a good replacement for ropemode
, ropevim
, and ropemacs
. Otherwise apparently the best Python LSP is based on Jedi.
@abingham , as I see, there is a Composite pattern, which simple delegates calls to the Leaves, see:
- https://github.com/python-rope/rope/blob/master/rope/refactor/multiproject.py#L44
- https://github.com/python-rope/rope/blob/master/rope/refactor/multiproject.py#L52
There is only one little problem, the non-polymorphic call for the .do() method, see:
- https://github.com/python-rope/rope/blob/master/rope/refactor/multiproject.py#L78
- https://github.com/python-rope/rope/blob/master/ropetest/refactor/multiprojecttest.py#L30
I think, we can easy fix this issue, thus, the History class will be able to work with the Composite (_MultiRefactoring) as well as with a Leaf.
I like the idea, but wouldn't it be better to support Language Server Protocol?
Maybe so. I started traad because nothing (including ropemacs, since I'm primarily an emacs user) worked for what I needed, and I only really do enough work to make it work for me. If someone wants to put in the effort to create a better refactoring server of some sort, that would be fine with me. FWIW, I definitely feel that an HTTP language server is a better model than pymacs/ropemacs.
If someone wants to put in the effort to create a better refactoring server of some sort, that would be fine with me.
So, it won't be you, do I understand correctly?
Just that you could save yourself work on the Emacs-side of the things (and there are even rumours Emacs will have support for LSP natively, and there are already LSP clients for Emacs in existence).
Also, I would love to see rope-based LSP server. If LSP is the future (and it seems to have a great momentum behind it), it could be very neat way how to make rope relevant again (and we could get rid of all three rope{mode,vim,macs}
projects which feel to me like the worst part of whole endeavour.
So, it won't be you, do I understand correctly?
Currently that's correct. I barely have the bandwidth to keep traad hobbling along.