I wanted check on the feasibility of using rust-analyzer's SSR functionality as a standalone
cargo fix-style refactoring tool for breaking changes in crates. is that feasible/a good idea at this time?
I think @pksunkara was also interested in that, for porting code to
gotcha. I know that portions of rust-analyzer are published to crates.io, but i'm not sure if _this_ portion is.
Thanks for the mention @Laurențiu Nicola
@David Barsky I have a minimum viable code at https://github.com/pksunkara/cargo-up. And the related code that describes the breaking changes is at https://github.com/clap-rs/clap/blob/master/clap_up/src/lib.rs. We can have a call if you are interested in working on this.
In fact, I was the one who did the work to publish rust-analyzer on crates.io so that I can use those deps in this tool.
Thanks for offer for the call, but I think I'm good for now. what sort of work is remaining on this thing?
ah, my response was to an incorrect read of a now-edited comment. nevermind!
As I said, there's almost nothing else needed from rust-analyzer side. The only main thing left to do in the tool is https://github.com/pksunkara/cargo-up/blob/541e7b0e83dbb733e29ae4980c1b6fd7a7b6bc21/cargo-up/src/cli/dep.rs#L88.
Everything else can be added later. I am slowly trying to get it working for
clap 3.0 release, so that all people have to do is
cargo up dep clap. And then we can try to add more features once people start to use it for their deps too
I think we already expose this as a CLI?
λ rust-analyzer --help ^| tail -n 8 ssr [RULE...] <RULE> A structured search replace rule (`$a.foo($b) ==> bar($a, $b)`) search [PATTERN..] <PATTERN> A structured search replace pattern (`$a.foo($b)`) --debug <snippet> Prints debug information for any nodes with source exactly equal to <snippet>