Thanks. Make sure to look at the latest main branch; I just removed some dead code. Also, one thing I might add in the next release is an `eol_cycle` command, which will cycle through those endings. This might be a good alternative binding to `cmd + ;` for some. By the way, if you are making a public extension for neovim for Rust, I am more than happy to add a link in the readme.
Wouldn't it make more sense to have it cycle through the options? Maybe have one keybind to toggle the await and one to toggle the questionmark. Or one command that cycles through all four.
i believe it is possible to make it just use one single key press e.g. cmd + ; then properly parse the method signature , so if it is a async with result then it would have .await?;
Yes, that would be cool, but in practice, it might be tricky, especially to find the function. 1) We could do it the "cheap way," like a text/regex way, but this will become computationally heavy as the code grows. 2) We could piggyback on rust-analyzer if they have an API for that, but this could also be quite complex. And at the end, we still have to toggle the ? on/off, as sometimes users might want the Result for some matching.
JC IS A LEGEND! I don't use vscode but I'll turn this into neovim mappings. Great idea!
Thanks. Make sure to look at the latest main branch; I just removed some dead code.
Also, one thing I might add in the next release is an `eol_cycle` command, which will cycle through those endings. This might be a good alternative binding to `cmd + ;` for some.
By the way, if you are making a public extension for neovim for Rust, I am more than happy to add a link in the readme.
just one of the best rust content creator! really like your content.
Wouldn't it make more sense to have it cycle through the options? Maybe have one keybind to toggle the await and one to toggle the questionmark. Or one command that cycles through all four.
Funny, this was my next feature I was going to add the ‘eol_cycle’ for the ones that prefer to bind this one.
Btw, I like your idea of some ‘eol_toggle_question’ and similar for await. I might add those as well.
i believe it is possible to make it just use one single key press e.g. cmd + ; then properly parse the method signature , so if it is a async with result then it would have .await?;
Yes, that would be cool, but in practice, it might be tricky, especially to find the function.
1) We could do it the "cheap way," like a text/regex way, but this will become computationally heavy as the code grows.
2) We could piggyback on rust-analyzer if they have an API for that, but this could also be quite complex.
And at the end, we still have to toggle the ? on/off, as sometimes users might want the Result for some matching.
thx for all hard work
Nice extension, greatly appreciated!
Oh my gosh, that’s so nice!
I just added a eol_comma as well.