mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 13:33:31 +00:00
Merge #4432
4432: Update features.md r=matklad a=bnjjj Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
This commit is contained in:
commit
6fde7f1b6b
1 changed files with 12 additions and 2 deletions
|
@ -143,9 +143,9 @@ takes arguments, the cursor is positioned inside the parenthesis.
|
||||||
There are postfix completions, which can be triggered by typing something like
|
There are postfix completions, which can be triggered by typing something like
|
||||||
`foo().if`. The word after `.` determines postfix completion. Possible variants are:
|
`foo().if`. The word after `.` determines postfix completion. Possible variants are:
|
||||||
|
|
||||||
- `expr.if` -> `if expr {}`
|
- `expr.if` -> `if expr {}` or `if let ... {}` for `Option` or `Result`
|
||||||
- `expr.match` -> `match expr {}`
|
- `expr.match` -> `match expr {}`
|
||||||
- `expr.while` -> `while expr {}`
|
- `expr.while` -> `while expr {}` or `while let ... {}` for `Option` or `Result`
|
||||||
- `expr.ref` -> `&expr`
|
- `expr.ref` -> `&expr`
|
||||||
- `expr.refm` -> `&mut expr`
|
- `expr.refm` -> `&mut expr`
|
||||||
- `expr.not` -> `!expr`
|
- `expr.not` -> `!expr`
|
||||||
|
@ -161,6 +161,16 @@ There also snippet completions:
|
||||||
#### Inside Modules
|
#### Inside Modules
|
||||||
|
|
||||||
- `tfn` -> `#[test] fn f(){}`
|
- `tfn` -> `#[test] fn f(){}`
|
||||||
|
- `tmod` ->
|
||||||
|
```rust
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_fn() {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Code Highlighting
|
### Code Highlighting
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue