Implement Structural Search And Replace
lucypero opened this issue · comments
RA has a great feature for refactoring that I'd like to use in ST. How much work would it take to make an interface for this functionality? I believe you can only use this on VS Code for now. I'd love to make a PR if someone can give me some pointers.
There are various examples of custom commands in plugin.py
. For example this one:
Lines 467 to 501 in 0e9264f
One for this feature would likely need to trigger an input (or two) to ask for a specific input but it shouldn't be that hard. You can check ST API at http://www.sublimetext.com/docs/api_reference.html .
BTW. It seems like RA also supports this feature through a custom comment:
Also available as an assist, by writing a comment containing the structural search and replace rule. You will only see the assist if the comment can be parsed as a valid structural search and replace rule.
I feel like this could work already in ST but haven't tried.
I feel like this could work already in ST but haven't tried.
Yes, you are right. I just tried it. It already works by writing the query in a comment. It would still be great to have another interface for it. I might take a look later. Thanks.