Skip to content

Commit e00bcdb

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

File tree

6 files changed

+161
-10
lines changed

6 files changed

+161
-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
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
= Changelog #67
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:d54e1157b66017e4aae38328cd213286e39ca130[] +
6+
Release: release:2021-03-08[]
7+
8+
== Sponsors
9+
10+
**Become a sponsor:** On https://opencollective.com/rust-analyzer/[OpenCollective] or
11+
https://github.com/sponsors/rust-analyzer[GitHub Sponsors].
12+
13+
== New Features
14+
15+
* pr:7777[] add line to block and back comment conversion assist:
16+
+
17+
image::https://user-images.githubusercontent.com/308347/110304890-c8155d80-8004-11eb-8a4a-89a90e059d92.gif[]
18+
19+
* pr:7335[] (first contribution) add region folding support:
20+
+
21+
image::https://user-images.githubusercontent.com/308347/110306982-19bee780-8007-11eb-8b8c-be5e46330586.gif[]
22+
23+
* pr:7691[] suggest name in "extract variable" assist:
24+
+
25+
image::https://user-images.githubusercontent.com/4218373/108013304-72105400-701c-11eb-9f13-eec52e74d0cc.gif[]
26+
+
27+
image::https://user-images.githubusercontent.com/4218373/108013305-72a8ea80-701c-11eb-957e-2214f7f005de.gif[]
28+
29+
* pr:7795[] show docs on hover for keywords and primitives:
30+
+
31+
image::https://user-images.githubusercontent.com/3757771/109369534-eeb4f500-789c-11eb-8f2b-2f9c4e129de3.gif[]
32+
33+
* pr:7824[] (first contribution) "add type ascription" assist:
34+
+
35+
image::https://user-images.githubusercontent.com/308347/110307658-d7e27100-8007-11eb-965b-2e9a294e7d22.gif[]
36+
37+
* pr:7894[] generate_function assist: convert arg names to lower snake case:
38+
+
39+
image::https://user-images.githubusercontent.com/308347/110308337-a9b16100-8008-11eb-8aa7-bf58be48d089.gif[]
40+
41+
* pr:7800[] add "generate `default()`" assist:
42+
+
43+
image::https://user-images.githubusercontent.com/308347/110308811-3f4cf080-8009-11eb-9e0f-a87c36aaec09.gif[]
44+
45+
* pr:7866[] add `while let` completion.
46+
* pr:7889[] make imports grouping configurable via `rust-analyzer.assist.importGroup`.
47+
* pr:7868[] rename `rust-analyzer.cargo.loadOutDirsFromCheck` to `rust-analyzer.cargo.runBuildScripts`.
48+
49+
== Fixes
50+
51+
* pr:7778[] fix lowering trailing `self` paths in `UseTree`s
52+
* pr:7834[] fix `find_path` when inner items are present.
53+
* pr:7827[] (first contribution) fix proc macro `TokenStream::from_str` token ids.
54+
* pr:7844[] fix `ProcMacroClient` being dropped too early in CLI.
55+
* pr:7513[] implement an NFA parser for macro-by-example.
56+
* pr:7884[] simplify `TokenStream::from_str`.
57+
* pr:7850[] don't add space when joining line to opening quote.
58+
* pr:7861[] special-case parenthesized and negated expressions in De Morgan's Law assist.
59+
* pr:7863[] prevent renaming `SelfType` and `BuiltinType`.
60+
* pr:7880[] honor snippet capability in the "extract function" assist.
61+
* pr:7869[] add support for deref assignments to "pull assignment up" assist.
62+
* pr:7887[] fix path parsing when using `meta` in MBE.
63+
* pr:7888[] add a note about code action commands to the `coc.nvim` section of the docs.
64+
* pr:7865[] preserve escape sequences when replacing string with char.
65+
* pr:7896[] fix raw string handling in "replace string with char" assist.
66+
* pr:7892[] fix `TokenStream::from_str` for input consisting of a single group with delimiter.
67+
68+
== Internal Improvements
69+
70+
* pr:7819[] speed up heavy tests.
71+
* pr:7820[], pr:7837[] Improve VS Code extension README.
72+
* pr:7823[] bring `Ty::InferenceVar` closer to `chalk` equivalent.
73+
* pr:7826[] introduce `Ty::Alias`.
74+
* pr:7833[] use `chalk_ir::Mutability`.
75+
* pr:7870[] use `chalk_ir::AdtId`.
76+
* pr:7828[], pr:7836[] lint against versioned dev dependencies to fix automatic publishing.
77+
* pr:7832[] drop pre-commit `git` hook.
78+
* pr:7835[], pr:7847[], pr:7876[], pr:7881[], pr:7849[] migrate to a CLI parser with auto-generated help.
79+
* pr:7899[] rename a few `crate_def_map`s to `def_map`.
80+
* pr:7851[] compress tests.
81+
* pr:7858[] clarify comparison rule in the style docs.

0 commit comments

Comments
 (0)