Is there a way to configure VSCode so that I can write multi line comments.
In Rust comments start with //
or ///
. If I write such a comment then it would be nice when I hit Enter that the editor auto insert ///
in the beginning of the new line.
If you select a block of code and use the key sequence Ctrl+K+C, you'll comment out the section of code. Ctrl+K+U will uncomment the code.
To comment out multiple code lines right-click and select Source > Add Block Comment. ( CTRL+SHIFT+/ ) To uncomment multiple code lines right-click and select Source > Remove Block Comment. ( CTRL+SHIFT+\ )
Windows: Ctrl + Alt + Arrow Keys. Linux: Shift + Alt + Arrow Keys. Mac: Opt + Cmd + Arrow Keys.
Update from 2020: The rust-analyzer
extension now has support for comment continuation on pressing Enter, although it is not enabled by default.
As an alternative, the Auto Comment Blocks extension seems to provide this for multiple languages, Rust included.
There is no setting in VSCode to do this. It's a Language feature, and must be developed by the extension that gives support to the language.
I looked at two Rust extensions (Rust and Rust Code) but none of them presents this feature. You should fill an issue on your extension's repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With