mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
40009e07d0
11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields before: ```rust pub enum Other { One, Two, } pub struct Test { text: String, num: usize, other: Other, } fn t_test() { let test = Test {<|>}; } ``` after: ```rust pub enum Other { One, Two, } pub struct Test { text: String, num: usize, other: Other, } fn t_test() { let test = Test { text: String::new(), num: 0, other: todo!(), }; } ``` Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com> |
||
---|---|---|
.. | ||
src | ||
tests | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.vscodeignore | ||
icon.png | ||
language-configuration.json | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
ra_syntax_tree.tmGrammar.json | ||
README.md | ||
tsconfig.json |
rust-analyzer
Provides support for rust-analyzer: novel LSP server for the Rust programming language.
Note the extension may cause conflicts with the official Rust extension. It is recommended to disable the Rust extension when using the rust-analyzer extension.
Sponsor
Work on rust-analyzer is sponsored by
If you want to sponsor:
Features
- code completion, imports insertion
- go to definition, implementation, type definition
- find all references, workspace symbol search, rename
- types and documentation on hover
- inlay hints
- semantic syntax highlighting
- a lot of assist(code actions)
- apply suggestions from errors
- ... and many more, checkout the manual to see them all
Quick start
- Install rustup
- Install the rust-analyzer extension
Configuration
This extension provides configurations through VSCode's configuration settings. All the configurations are under rust-analyzer.*
.
See https://rust-analyzer.github.io/manual.html#vs-code-2 for more information on VSCode specific configurations.
Communication
For usage and troubleshooting requests, please use "IDEs and Editors" category of the Rust forum:
https://users.rust-lang.org/c/ide/14
Documentation
See https://rust-analyzer.github.io/ for more information.