Hi. Been using the rust-analyzer extensions for VS Code (with OSS build) it's amazing how far the dev experience has improved over the years.
I have an idea for a Refactor. I have a module allocator.rs and I want to covert it to a folder: ie allocator/mod.rs.
However I'm not sure how the whole code<->lsp<->Analyzer thing all ties together so where would I want to try and contribute this in a way that's usable by the most people. I would like to get Rust's refactoring tools to be at least as good as VS+C# at some point. So every little bit helps.
User Manual, which contains links to the source code for every feature.
This specific refactoring shouldn't be hard to implement, but is non-trivial in terms of user-experience we can provide.
Generally, in rust 2018 most of the folks don't use mod.rs at all. So they'd have allocator.rs file with mod submodulue; in it, and allocator/submodule.rs. This layout is supported in rust-analyzer today: if you type mod submodule;, the red squiggly contains a quick fix for creating a corresponding file.
That being said, mod.rs is not deprecated and some people use this old style instead. (I also happen to prefer the old style, but I use new style for consistency). I think a good change to the above quick fix would be to check if all modules in the current crate happen to use mod.rs pattern, and, if that's the case, rename allocator.rs to allocator/mod.rs as well. Here's the relevant source code: