Comments (5)
The whole writing to the filesystem situation makes me a bit uneasy. It goes completely against what I would expect an emacs plugin to do.
Would it be possible to load the whole project into buffers in emacs, and make rope do the entire refactoring in-buffer. Traad could then provide some nice interface to see what files are then "modified", or even to automatically save them if you want. Or is reading/writing from the filesystem hard-coded into rope's APIs?
from traad.
It's possible to ask rope what files will change, and I think even to find out how they will change. So in principle we could get this information over to emacs, open all of the files that need to be changed, and do them in emacs. I don't like this approach for a number of reasons, though.
First, it means potentially opening thousands of buffer for a really large refactoring. This isn't terrible, but it would take time.
Second, if we decide that this is how traad works, i.e. that clients have to the actual refactoring application, then we substantially complicate client development. This is something I want to avoid...simple client development is a goal of traad.
Finally - related to the second point - the approach you mention strikes me as the wrong separation of concerns. Rope is already able to make the changes to the files, and emacs is already able to detect changed files and revert buffers automatically. Asking emacs to also make the changes feels like extra work for no benefit except expectation violation.
So obviously I'm pretty hesitant to make a change like this. With that said, I've been wrong enough times that I like to keep an open mind, so try to convince me if you think there's a strong reason to do things differently!
from traad.
We could also consider parallel functionality. I'm already thinking about adding a sort of "preview mode" for refactorings whereby the server would ship the calculated changes over to the client without actually making them. Once this is in place it's not too hard to see how clients could - if they chose - perform the refactorings themselves. It seems that this would make it relatively easy to create an extension to traad which does the refactorings locally.
from traad.
I guess I'm just still unused to the idea of an editor command changing other files from the one I am currently editing.
from traad.
Those kinds of "distant changes" are in the very nature of certain refactorings, so I don't see how we could realistically avoid doing them. For example, if you rename a class at its definition without also updating all of the places where that class name is used, then you haven't really done a refactoring...you've just broken your program.
from traad.
Related Issues (20)
- Three undefined names HOT 1
- Depends on bind-map HOT 1
- traad does not work with conda environments
- Can not install server and need to make it with pyenv
- rename-resource doesn't seem to work HOT 1
- Connecting to traad server seems broken in emacs HOT 4
- Split emacs client code out HOT 1
- "Error (error) while connecting" and "task-id is nil" HOT 1
- stop_app is not defined in server.py HOT 3
- Multiple projects - multiple traad servers? HOT 4
- Company-mode plugin HOT 1
- RuntimeError: Request context not initialized [python 3] HOT 7
- Support rope.refactor.change_signature ArgumentAdd to add an argument
- Consider using an asyncio-based http server HOT 1
- Consider using pytest for the tests HOT 2
- Support for inlining of variables HOT 7
- AttributeError: 'Call' object has no attribute 'starargs' HOT 4
- Iterator / context manager extraction HOT 1
- Refresh/revalidate server when necessary HOT 1
- Implement auto-termination HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traad.