Skip to content

Commit dcdc973

Browse files
committed
Changelog #67
1 parent 4480c4c commit dcdc973

File tree

5 files changed

+80
-10
lines changed

5 files changed

+80
-10
lines changed

generated_assists.adoc

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ fn main() {
164164

165165
[discrete]
166166
=== `apply_demorgan`
167-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/apply_demorgan.rs#L5[apply_demorgan.rs]
167+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/apply_demorgan.rs#L6[apply_demorgan.rs]
168168

169169
Apply https://en.wikipedia.org/wiki/De_Morgan%27s_laws[De Morgan's law].
170170
This transforms expressions of the form `!l || !r` into `!(l && r)`.
@@ -521,6 +521,41 @@ impl Default for Version {
521521
```
522522

523523

524+
[discrete]
525+
=== `generate_default_from_new`
526+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_default_from_new.rs#L12[generate_default_from_new.rs]
527+
528+
Generates default implementation from new method.
529+
530+
.Before
531+
```rust
532+
struct Example { _inner: () }
533+
534+
impl Example {
535+
pub fn n┃ew() -> Self {
536+
Self { _inner: () }
537+
}
538+
}
539+
```
540+
541+
.After
542+
```rust
543+
struct Example { _inner: () }
544+
545+
impl Example {
546+
pub fn new() -> Self {
547+
Self { _inner: () }
548+
}
549+
}
550+
551+
impl Default for Example {
552+
fn default() -> Self {
553+
Self::new()
554+
}
555+
}
556+
```
557+
558+
524559
[discrete]
525560
=== `generate_derive`
526561
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_derive.rs#L9[generate_derive.rs]
@@ -668,7 +703,7 @@ impl From<u32> for A {
668703

669704
[discrete]
670705
=== `generate_function`
671-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_function.rs#L18[generate_function.rs]
706+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_function.rs#L19[generate_function.rs]
672707

673708
Adds a stub function with a signature matching the function under the cursor.
674709

generated_config.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
The strategy to use when inserting new imports or merging imports.
33
[[rust-analyzer.assist.importPrefix]]rust-analyzer.assist.importPrefix (default: `"plain"`)::
44
The path structure for newly inserted paths to use.
5+
[[rust-analyzer.assist.importGroup]]rust-analyzer.assist.importGroup (default: `true`)::
6+
Group inserted imports by the [following order](https://rust-analyzer.github.io/manual.html#auto-import). Groups are separated by newlines.
57
[[rust-analyzer.callInfo.full]]rust-analyzer.callInfo.full (default: `true`)::
68
Show function name and docs in parameter hints.
79
[[rust-analyzer.cargo.autoreload]]rust-analyzer.cargo.autoreload (default: `true`)::
@@ -10,8 +12,8 @@
1012
Activate all available features (`--all-features`).
1113
[[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`)::
1214
List of features to activate.
13-
[[rust-analyzer.cargo.loadOutDirsFromCheck]]rust-analyzer.cargo.loadOutDirsFromCheck (default: `false`)::
14-
Run `cargo check` on startup to get the correct value for package OUT_DIRs.
15+
[[rust-analyzer.cargo.runBuildScripts]]rust-analyzer.cargo.runBuildScripts (default: `false`)::
16+
Run build scripts (`build.rs`) for more precise code analysis.
1517
[[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`)::
1618
Do not activate the `default` feature.
1719
[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
@@ -97,7 +99,7 @@
9799
[[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`)::
98100
Whether to show `can't find Cargo.toml` error message.
99101
[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `false`)::
100-
Enable Proc macro support, `#rust-analyzer.cargo.loadOutDirsFromCheck#` must be enabled.
102+
Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`.
101103
[[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`)::
102104
Internal config, path to proc-macro server executable (typically, this is rust-analyzer itself, but we override this in tests).
103105
[[rust-analyzer.runnables.overrideCargo]]rust-analyzer.runnables.overrideCargo (default: `null`)::

generated_diagnostic.adoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This diagnostic is triggered if the `break` keyword is used outside of a loop.
66

77

88
=== inactive-code
9-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L98[diagnostics.rs]
9+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L126[diagnostics.rs]
1010

1111
This diagnostic is shown for code with inactive `#[cfg]` attributes.
1212

@@ -18,7 +18,7 @@ This diagnostic is triggered if an item name doesn't follow https://doc.rust-lan
1818

1919

2020
=== macro-error
21-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L171[diagnostics.rs]
21+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L199[diagnostics.rs]
2222

2323
This diagnostic is shown for macro expansion errors.
2424

@@ -112,14 +112,21 @@ This diagnostic is triggered if rust-analyzer is unable to discover referred ext
112112
This diagnostic is triggered if rust-analyzer is unable to discover imported module.
113113

114114

115+
=== unresolved-macro-call
116+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L98[diagnostics.rs]
117+
118+
This diagnostic is triggered if rust-analyzer is unable to resolove path to a
119+
macro in a macro invocation.
120+
121+
115122
=== unresolved-module
116123
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L18[diagnostics.rs]
117124

118125
This diagnostic is triggered if rust-analyzer is unable to discover referred module.
119126

120127

121128
=== unresolved-proc-macro
122-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L131[diagnostics.rs]
129+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L159[diagnostics.rs]
123130

124131
This diagnostic is shown when a procedural macro can not be found. This usually means that
125132
procedural macro support is simply disabled (and hence is only a weak hint instead of an error),

generated_features.adoc

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@ Provides a tree of the symbols defined in the file. Can be used to
106106
|===
107107

108108

109+
=== Find All References
110+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/references.rs#L42[references.rs]
111+
112+
Shows all references of the item at the cursor location
113+
114+
|===
115+
| Editor | Shortcut
116+
117+
| VS Code | kbd:[Shift+Alt+F12]
118+
|===
119+
120+
109121
=== Format String Completion.
110122
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/completions/postfix/format_like.rs#L0[format_like.rs]
111123

@@ -161,7 +173,7 @@ Navigates to the type of an identifier.
161173

162174

163175
=== Hover
164-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L77[hover.rs]
176+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L78[hover.rs]
165177

166178
Shows additional information, like type of an expression or documentation for definition when "focusing" code.
167179
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.
@@ -191,7 +203,7 @@ https://github.com/rust-analyzer/rust-analyzer/issues/1623[1], https://github.co
191203

192204

193205
=== Join Lines
194-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/join_lines.rs#L12[join_lines.rs]
206+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/join_lines.rs#L13[join_lines.rs]
195207

196208
Join selected lines into one, smartly fixing up whitespace, trailing commas, and braces.
197209

@@ -333,6 +345,18 @@ Navigates to the parent module of the current module.
333345
|===
334346

335347

348+
=== Rename
349+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/references/rename.rs#L62[rename.rs]
350+
351+
Renames the item below the cursor and all of its references
352+
353+
|===
354+
| Editor | Shortcut
355+
356+
| VS Code | kbd:[F2]
357+
|===
358+
359+
336360
=== Run
337361
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L86[runnables.rs]
338362

manual.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ The are several LSP client implementations for vim or neovim:
226226
* inlay hints for variables and method chaining, _Neovim Only_
227227
* semantic highlighting is not implemented yet
228228

229+
Note: for code actions, use `coc-codeaction-cursor` and `coc-codeaction-selected`; `coc-codeaction` and `coc-codeaction-line` are unlikely to be useful.
230+
229231
==== LanguageClient-neovim
230232

231233
1. Install LanguageClient-neovim by following the instructions

0 commit comments

Comments
 (0)