5 ms·
Seems like more work to me. Simple search and replace is usually sufficient for something like what the intro video shows.
by linuxftw 8y ago
Seems like more work to me. Simple search and replace is usually sufficient for something like what the intro video shows.
- SketchySeaBeast 8y agoI'm finding Visual Studio Code does an excellent job with "rename symbol" or "change all occurrences".
- drb91 8y agoFunny, I've found it seems to struggle with any references that cross language boundaries.... except with typescript, for some reason. EDIT: Sorry, I meant 'file' boundary, not 'language' boundary.
- SketchySeaBeast 8y agoMine was in reference to Python projects - I haven't tried it on cross language references.
- pvg 8y agoWhy not, you know, edit the actual sentence instead of adding a thing that says EDIT but leaves the original confusingly unedited?
- yesenadam 8y agoBecause, I guess, it's courteous to the people who already commented on the original, so they don't look like they were talking nonsense.
- pvg 8y agoYou make the edit and then you describe the edit, to avoid that.
- yesenadam 8y agoAh, good point. (I guess I wasn't confused by the edit - though if I'd been here longer I probably would've been - but I was by your comment!)
- pvg 8y agoWait, what? You can't just politely walk away from a from a pointless argument over minutia like that. You are new around here. These must extend to a minimum thread depth of 12. Please review the guidelines.
- yesenadam 8y agoHahaha! Gold. Thanks, you made my day. Sorry you lost mana for it, I'd +100 if I could. Well, I was reading about https://en.wikipedia.org/wiki/Sayre%27s_law https://en.wikipedia.org/wiki/Sayre%27s_law on here recently.
- scrollaway 8y agoRename symbol in the python extension uses Rope, fwiw: https://pypi.org/project/rope/ https://pypi.org/project/rope/
- gh02t 8y agoThis looks tedious to use directly, but it'd be good to build things like editor plugins on top of. The docs also show that it can do stuff that would not be simple to do with search and replace (e.g. transforming function arguments).
- stcredzero 8y agoThe original Smalltalk refactoring engine didn't take off until it was packaged as the Refactoring Browser. But the real utility in it was making arbitrary scripting of meta-level and syntax driven code transformation very accessible. You can literally be an order of magnitude more powerful with refactorings with a tool like that. Python is a good language for for this sort of tool. There is a lot of potential for the power of Python harnessed to rewrite Python.
- nuclear_eclipse 8y agoFor something that simple, I would agree, but the demo is barely scratching the surface. I'd like to make a more in-depth version showing a more complicated transform, such as changing a function signature and having it update the callers across multiple files.
- linuxftw 8y agoYeah, maybe some other example would be more convincing. I think this case would still be a good job for search and replace, you'll need to investigate the surrounding code to get the new data to pass to the function or modify the existing data to support the new format. It's unlikely that you add or remove an argument from a function and nothing else needs to change.