Hello, quick question, is regex allowed in the rust-analyzer codebase ? For example if we want to reformat something like
( a: i32, b: i32 )
(a: i32, b: i32)
We pull in
tracing-subscriber, but we don't use them to parse or rewrite source code. I'm a bit confused by your example, would that plug into a LSP formatting request, or is it more of a custom command that you end up needing often?
There's also SSR, but I don't know if it preserves output whitespace
Sounds more like something that
ra_fmt should handle once it exists
And that's not valid syntax, is it? We don't handle it very well.
Sorry for delay, in fact it's to fix this issue https://github.com/rust-analyzer/rust-analyzer/issues/6002
Shouldn't it be enough to reconstruct the function signature with just your usual expected whitespaces between the parameters? Regex seems a bit too much for this in my eyes, though that might be personal preference :sweat_smile:
Yes maybe it could be an idea, I will think about that and try to find better solution. IMO regex is clearly too much, due to this question and to have some other solutions. Thanks for your help :)