Skip to content

Commit 496c0ea

Browse files
committed
Changelog #81
1 parent c4bb1aa commit 496c0ea

File tree

4 files changed

+109
-52
lines changed

4 files changed

+109
-52
lines changed

generated_assists.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fn main() {
210210

211211
[discrete]
212212
=== `change_visibility`
213-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/change_visibility.rs#L10[change_visibility.rs]
213+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/change_visibility.rs#L12[change_visibility.rs]
214214

215215
Adds or changes existing visibility specifier.
216216

@@ -330,9 +330,9 @@ fn main() {
330330

331331
[discrete]
332332
=== `convert_tuple_struct_to_named_struct`
333-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs#L9[convert_tuple_struct_to_named_struct.rs]
333+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_tuple_struct_to_named_struct.rs#L10[convert_tuple_struct_to_named_struct.rs]
334334

335-
Converts tuple struct to struct with named fields.
335+
Converts tuple struct to struct with named fields, and analogously for tuple enum variants.
336336

337337
.Before
338338
```rust

generated_diagnostic.adoc

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,70 @@
11
//Generated file, do not edit by hand, see `xtask/src/codegen`
22
=== break-outside-of-loop
3-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L250[diagnostics.rs]
3+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/break_outside_of_loop.rs#L3[break_outside_of_loop.rs]
44

55
This diagnostic is triggered if the `break` keyword is used outside of a loop.
66

77

88
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
99

1010
== inactive-code
11-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir/src/diagnostics.rs#L129[diagnostics.rs]
11+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/inactive_code.rs#L9[inactive_code.rs]
1212

1313
This diagnostic is shown for code with inactive `#[cfg]` attributes.
1414

1515

1616
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
1717

1818
== incorrect-ident-case
19-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L381[diagnostics.rs]
19+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/incorrect_case.rs#L12[incorrect_case.rs]
2020

2121
This diagnostic is triggered if an item name doesn't follow https://doc.rust-lang.org/1.0.0/style/style/naming/README.html[Rust naming convention].
2222

2323

2424
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
2525

2626
== macro-error
27-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir/src/diagnostics.rs#L202[diagnostics.rs]
27+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/macro_error.rs#L3[macro_error.rs]
2828

2929
This diagnostic is shown for macro expansion errors.
3030

3131

3232
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
3333

3434
== mismatched-arg-count
35-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L298[diagnostics.rs]
35+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/mismatched_arg_count.rs#L3[mismatched_arg_count.rs]
3636

3737
This diagnostic is triggered if a function is invoked with an incorrect amount of arguments.
3838

3939

40+
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
41+
42+
== missing-fields
43+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/missing_fields.rs#L11[missing_fields.rs]
44+
45+
This diagnostic is triggered if record lacks some fields that exist in the corresponding structure.
46+
47+
Example:
48+
49+
```rust
50+
struct A { a: u8, b: u8 }
51+
52+
let a = A { a: 10 };
53+
```
54+
55+
4056
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
4157

4258
== missing-match-arm
43-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L166[diagnostics.rs]
59+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/missing_match_arms.rs#L5[missing_match_arms.rs]
4460

4561
This diagnostic is triggered if `match` block is missing one or more match arms.
4662

4763

4864
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
4965

5066
== missing-ok-or-some-in-tail-expr
51-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L191[diagnostics.rs]
67+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/missing_ok_or_some_in_tail_expr.rs#L9[missing_ok_or_some_in_tail_expr.rs]
5268

5369
This diagnostic is triggered if a block that should return `Result` returns a value not wrapped in `Ok`,
5470
or if a block that should return `Option` returns a value not wrapped in `Some`.
@@ -64,62 +80,42 @@ fn foo() -> Result<u8, ()> {
6480

6581
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
6682

67-
== missing-pat-fields
68-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L117[diagnostics.rs]
69-
70-
This diagnostic is triggered if pattern lacks some fields that exist in the corresponding structure.
71-
72-
Example:
73-
74-
```rust
75-
struct A { a: u8, b: u8 }
76-
77-
let a = A { a: 10, b: 20 };
83+
== missing-unsafe
84+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/missing_unsafe.rs#L3[missing_unsafe.rs]
7885

79-
if let A { a } = a {
80-
// ...
81-
}
82-
```
86+
This diagnostic is triggered if an operation marked as `unsafe` is used outside of an `unsafe` function or block.
8387

8488

8589
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
8690

87-
== missing-structure-fields
88-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L70[diagnostics.rs]
89-
90-
This diagnostic is triggered if record lacks some fields that exist in the corresponding structure.
91-
92-
Example:
93-
94-
```rust
95-
struct A { a: u8, b: u8 }
91+
== no-such-field
92+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/no_such_field.rs#L14[no_such_field.rs]
9693

97-
let a = A { a: 10 };
98-
```
94+
This diagnostic is triggered if created structure does not have field provided in record.
9995

10096

10197
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
10298

103-
== missing-unsafe
104-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L274[diagnostics.rs]
99+
== remove-this-semicolon
100+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/remove_this_semicolon.rs#L11[remove_this_semicolon.rs]
105101

106-
This diagnostic is triggered if an operation marked as `unsafe` is used outside of an `unsafe` function or block.
102+
This diagnostic is triggered when there's an erroneous `;` at the end of the block.
107103

108104

109105
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
110106

111-
== no-such-field
112-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L43[diagnostics.rs]
107+
== replace-filter-map-next-with-find-map
108+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/replace_filter_map_next_with_find_map.rs#L14[replace_filter_map_next_with_find_map.rs]
113109

114-
This diagnostic is triggered if created structure does not have field provided in record.
110+
This diagnostic is triggered when `.filter_map(..).next()` is used, rather than the more concise `.find_map(..)`.
115111

116112

117113
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
118114

119-
== replace-filter-map-next-with-find-map
120-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_ty/src/diagnostics.rs#L422[diagnostics.rs]
115+
== unimplemented-builtin-macro
116+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unimplemented_builtin_macro.rs#L6[unimplemented_builtin_macro.rs]
121117

122-
This diagnostic is triggered when `.filter_map(..).next()` is used, rather than the more concise `.find_map(..)`.
118+
This diagnostic is shown for builtin macros which are not yet implemented by rust-analyzer
123119

124120

125121
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
@@ -134,32 +130,41 @@ crates rust-analyzer failed to discover. The file will not have IDE features ava
134130
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
135131

136132
== unresolved-extern-crate
137-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir/src/diagnostics.rs#L48[diagnostics.rs]
133+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unresolved_extern_crate.rs#L3[unresolved_extern_crate.rs]
138134

139135
This diagnostic is triggered if rust-analyzer is unable to discover referred extern crate.
140136

141137

138+
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
139+
140+
== unresolved-import
141+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unresolved_import.rs#L3[unresolved_import.rs]
142+
143+
This diagnostic is triggered if rust-analyzer is unable to resolve a path in
144+
a `use` declaration.
145+
146+
142147
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
143148

144149
== unresolved-macro-call
145-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir/src/diagnostics.rs#L100[diagnostics.rs]
150+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unresolved_macro_call.rs#L6[unresolved_macro_call.rs]
146151

147-
This diagnostic is triggered if rust-analyzer is unable to resolve the path to a
148-
macro in a macro invocation.
152+
This diagnostic is triggered if rust-analyzer is unable to resolve the path
153+
to a macro in a macro invocation.
149154

150155

151156
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
152157

153158
== unresolved-module
154-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir/src/diagnostics.rs#L23[diagnostics.rs]
159+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unresolved_module.rs#L8[unresolved_module.rs]
155160

156161
This diagnostic is triggered if rust-analyzer is unable to discover referred module.
157162

158163

159164
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
160165

161166
== unresolved-proc-macro
162-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir/src/diagnostics.rs#L162[diagnostics.rs]
167+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/diagnostics/unresolved_proc_macro.rs#L6[unresolved_proc_macro.rs]
163168

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

generated_features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Displays the ItemTree of the currently open file, for debugging.
8585
// IMPORTANT: master copy of this document lives in the https://github.com/rust-analyzer/rust-analyzer repository
8686

8787
== Expand Macro Recursively
88-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L17[expand_macro.rs]
88+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L14[expand_macro.rs]
8989

9090
Shows the full macro expansion of the macro at current cursor.
9191

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
= Changelog #81
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:f0618a8f06a464840079f30b3e25bcdcca3922a3[] +
6+
Release: release:2021-06-14[]
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:9144[] (first contribution) extend "Convert tuple to named struct" assist to work for enum variants.
16+
* pr:9106[] "Go to definition" on an `impl` function goes to the corresponding function in the trait.
17+
+
18+
image::https://user-images.githubusercontent.com/6652840/120403989-39aa3280-c2fa-11eb-9359-639346878acd.gif[]
19+
* pr:9223[] complete associated types in `dyn` and `impl trait`.
20+
* pr:9202[] make "Memory usage" work on Windows.
21+
* pr:9204[] improve memory usage info accuracy on `glibc` Linux.
22+
* pr:9244[] make block-local trait impls work.
23+
* pr:9153[] show server status when click on the VS Code status bar entry to show the server status.
24+
25+
== Fixes
26+
27+
* pr:9180[] fix some IDE functionality inside attribute macros.
28+
* pr:9239[] fix coercion in match with expected type.
29+
* pr:9182[] don't complete derive macros as function-like macros.
30+
* pr:9187[] fix edge case in import granularity guessing.
31+
* pr:9186[] prefer attr macros in "Expand macro recursively".
32+
* pr:9191[] don't descend into `MacroCall` `TokenTree` delimiters.
33+
* pr:9196[] don't classify attributes on macro-calls as the macro itself.
34+
* pr:9209[] don't suggest "Remove unused param" in trait impls.
35+
* pr:9215[] enable "Change visibility" assist for `use` and `macro` items.
36+
* pr:9216[] don't allow lookup by `self` for unprefixed completions.
37+
* pr:9218[] make item search respect trait impl items.
38+
* pr:9221[] correctly highlight tuple field accesses.
39+
* pr:9161[] fix incorrect config usage in hover references.
40+
41+
== Internal Improvements
42+
43+
* pr:9240[] (first contribution) fix a small typo.
44+
* pr:9169[] steps towards attribute macro token mapping.
45+
* pr:9217[] don't stringify and reparse `cfg_attr`-gated attributes.
46+
* pr:9192[] build test-macros in a build script.
47+
* pr:9238[] upgrade `cov-mark` for cross-crate usage.
48+
* pr:9243[] check that coverage marks are always paired.
49+
* pr:9164[], pr:9170[], pr:9171[] simplify completions some more.
50+
* pr:9242[] fix some `clippy` warnings.
51+
* pr:9166[] clarify issue label documentation.
52+
* pr:9230[], pr:9237[], pr:9233[], pr:9245[], pr:9246[], pr:9247[], pr:9248[], pr:9249[], pr:9250[], pr:9252[], pr:9253[], pr:9255[], pr:9256[], pr:9257[] move diagnostics to a `hir`-based API.

0 commit comments

Comments
 (0)