Using Structural Search Replace feature

Hi!
I want to use SSR feature to replace a single statement with multiple statements.

SSR statement I want to use:
assert_eq!(smart_quoter(split_string($s, true)), $m) ==>> let mut a = SplittedString::split($s); smart_quoter(&mut a); assert_eq!(a, $m)

But the inlay hint did not lightened up, so I checked a workaround:
assert_eq!(smart_quoter(split_string($s, true)), $m) ==>> {let mut a = SplittedString::split($s); smart_quoter(&mut a); assert_eq!(a, $m) }

But this was not recognized as an SSR command also.

The code in question:

assert_eq!(smart_quoter(split_string("'Till", true)), ("‘".into(), "Till", "".into()));
assert_eq!(smart_quoter(split_string("\"Hey", true)), ("“".into(), "Hey", "".into()));
assert_eq!(smart_quoter(split_string("'\"Hey", true)), ("‘\"".into(), "Hey", "".into()));

Does rust-analyzer support this use-case or this feature can be extended to support this?

Thanks!

I suspect the macro is blocking ssr in some way. I'm not familiar with how it exactly works though.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.