Erd*_*ray 1 rust visual-studio-code
考虑如下结构:
struct Foo;
Run Code Online (Sandbox Code Playgroud)
我想为此写一些文档,所以我这样做:
/// whatever
struct Foo;
Run Code Online (Sandbox Code Playgroud)
但是,当我按 Enter 时,它会创建一个空行:
/// whatever
struct Foo;
Run Code Online (Sandbox Code Playgroud)
不是在文档字符串中添加新行,而是///在其前面添加:
/// whatever
///
struct Foo;
Run Code Online (Sandbox Code Playgroud)
我已经六个月没有碰电脑或编程了。我记得六个月前我就能做到。也许是因为 6 个月前我有一个扩展(也许是 RLS?)调用了该行为,但现在没有。
如何在 Rust 和 VSCode 中以换行符继续文档字符串?
VSCode 和扩展
其他
该功能确实存在于 rust-analyzer 中,但需要显式启用。要启用它,您需要将以下内容添加到您的keybindings.json:
{
"key": "Enter",
"command": "rust-analyzer.onEnter",
"when": "editorTextFocus && !suggestWidgetVisible && editorLangId == rust"
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
751 次 |
| 最近记录: |