aboutsummaryrefslogtreecommitdiff
path: root/docs/user
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-31 08:59:38 +0100
committerAleksey Kladov <[email protected]>2020-05-31 08:59:38 +0100
commit8915183d7da07a4b295e5e93a889dea4c15024a0 (patch)
treede6a3d149911cc56e4e962a8276edb135c6e188a /docs/user
parentf593393ebb9bfa515caf168a9f037324eeb6edfe (diff)
Don't require module docs for Features and Assists
Diffstat (limited to 'docs/user')
-rw-r--r--docs/user/assists.md18
-rw-r--r--docs/user/features.md16
-rw-r--r--docs/user/generated_features.adoc55
3 files changed, 73 insertions, 16 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md
index 4ad7ea59d..b5d813b54 100644
--- a/docs/user/assists.md
+++ b/docs/user/assists.md
@@ -56,6 +56,24 @@ fn main() {
56} 56}
57``` 57```
58 58
59## `add_from_impl_for_enum`
60
61Adds a From impl for an enum variant with one tuple field.
62
63```rust
64// BEFORE
65enum A { ┃One(u32) }
66
67// AFTER
68enum A { One(u32) }
69
70impl From<u32> for A {
71 fn from(v: u32) -> Self {
72 A::One(v)
73 }
74}
75```
76
59## `add_function` 77## `add_function`
60 78
61Adds a stub function with a signature matching the function under the cursor. 79Adds a stub function with a signature matching the function under the cursor.
diff --git a/docs/user/features.md b/docs/user/features.md
index df8e73a20..ba7ca15a6 100644
--- a/docs/user/features.md
+++ b/docs/user/features.md
@@ -4,24 +4,8 @@ you can use <kbd>Ctrl+Shift+P</kbd> to search for the corresponding action.
4 4
5### Commands <kbd>ctrl+shift+p</kbd> 5### Commands <kbd>ctrl+shift+p</kbd>
6 6
7#### Parent Module
8 7
9Navigates to the parent module of the current module.
10 8
11#### Matching Brace
12
13If the cursor is on any brace (`<>(){}[]`) which is a part of a brace-pair,
14moves cursor to the matching brace. It uses the actual parser to determine
15braces, so it won't confuse generics with comparisons.
16
17#### Join Lines
18
19Join selected lines into one, smartly fixing up whitespace and trailing commas.
20
21#### Show Syntax Tree
22
23Shows the parse tree of the current file. It exists mostly for debugging
24rust-analyzer itself.
25 9
26#### Expand Macro Recursively 10#### Expand Macro Recursively
27 11
diff --git a/docs/user/generated_features.adoc b/docs/user/generated_features.adoc
index 1f6fcc974..bf0a36d01 100644
--- a/docs/user/generated_features.adoc
+++ b/docs/user/generated_features.adoc
@@ -68,6 +68,34 @@ Navigates to the type of an identifier.
68|=== 68|===
69 69
70 70
71=== Join Lines
72**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/join_lines.rs[join_lines.rs]
73
74
75Join selected lines into one, smartly fixing up whitespace, trailing commas, and braces.
76
77|===
78| Editor | Action Name
79
80| VS Code | **Rust Analyzer: Join lines**
81|===
82
83
84=== Matching Brace
85**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/matching_brace.rs[matching_brace.rs]
86
87
88If the cursor is on any brace (`<>(){}[]`) which is a part of a brace-pair,
89moves cursor to the matching brace. It uses the actual parser to determine
90braces, so it won't confuse generics with comparisons.
91
92|===
93| Editor | Action Name
94
95| VS Code | **Rust Analyzer: Find matching brace**
96|===
97
98
71=== On Typing Assists 99=== On Typing Assists
72**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/typing.rs[typing.rs] 100**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/typing.rs[typing.rs]
73 101
@@ -79,6 +107,19 @@ Some features trigger on typing certain characters:
79- typing `.` in a chain method call auto-indents 107- typing `.` in a chain method call auto-indents
80 108
81 109
110=== Parent Module
111**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/parent_module.rs[parent_module.rs]
112
113
114Navigates to the parent module of the current module.
115
116|===
117| Editor | Action Name
118
119| VS Code | **Rust Analyzer: Locate parent module**
120|===
121
122
82=== Run 123=== Run
83**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/runnables.rs[runnables.rs] 124**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/runnables.rs[runnables.rs]
84 125
@@ -94,6 +135,20 @@ to a shortcut!
94|=== 135|===
95 136
96 137
138=== Show Syntax Tree
139**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/syntax_tree.rs[syntax_tree.rs]
140
141
142Shows the parse tree of the current file. It exists mostly for debugging
143rust-analyzer itself.
144
145|===
146| Editor | Action Name
147
148| VS Code | **Rust Analyzer: Show Syntax Tree**
149|===
150
151
97=== Workspace Symbol 152=== Workspace Symbol
98**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide_db/src/symbol_index.rs[symbol_index.rs] 153**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide_db/src/symbol_index.rs[symbol_index.rs]
99 154