Skip to content

Commit 9f675d2

Browse files
committed
Changelog #69
1 parent b762ddb commit 9f675d2

File tree

5 files changed

+49
-18
lines changed

5 files changed

+49
-18
lines changed

generated_assists.adoc

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ fn qux(bar: Bar, baz: Baz) {}
331331

332332
[discrete]
333333
=== `extract_function`
334-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L29[extract_function.rs]
334+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L28[extract_function.rs]
335335

336336
Extracts selected statements into new function.
337337

@@ -840,6 +840,39 @@ impl<T: Clone> Ctx<T> {
840840
```
841841

842842

843+
[discrete]
844+
=== `generate_is_empty_from_len`
845+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_is_empty_from_len.rs#L12[generate_is_empty_from_len.rs]
846+
847+
Generates is_empty implementation from the len method.
848+
849+
.Before
850+
```rust
851+
struct MyStruct { data: Vec<String> }
852+
853+
impl MyStruct {
854+
p┃ub fn len(&self) -> usize {
855+
self.data.len()
856+
}
857+
}
858+
```
859+
860+
.After
861+
```rust
862+
struct MyStruct { data: Vec<String> }
863+
864+
impl MyStruct {
865+
pub fn len(&self) -> usize {
866+
self.data.len()
867+
}
868+
869+
pub fn is_empty(&self) -> bool {
870+
self.len() == 0
871+
}
872+
}
873+
```
874+
875+
843876
[discrete]
844877
=== `generate_new`
845878
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_new.rs#L11[generate_new.rs]
@@ -1136,7 +1169,7 @@ fn handle(action: Action) {
11361169

11371170
[discrete]
11381171
=== `move_bounds_to_where_clause`
1139-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_bounds.rs#L10[move_bounds.rs]
1172+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_bounds.rs#L8[move_bounds.rs]
11401173

11411174
Moves inline type bounds to a where clause.
11421175

@@ -1242,7 +1275,7 @@ fn main() {
12421275

12431276
[discrete]
12441277
=== `qualify_path`
1245-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/qualify_path.rs#L22[qualify_path.rs]
1278+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/qualify_path.rs#L21[qualify_path.rs]
12461279

12471280
If the name is unresolved, provides all possible qualified paths for it.
12481281

generated_config.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
276276
--
277277
Whether to show `can't find Cargo.toml` error message.
278278
--
279-
[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `false`)::
279+
[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`)::
280280
+
281281
--
282282
Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`.

generated_diagnostic.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ This diagnostic is triggered if rust-analyzer is unable to discover imported mod
115115
=== unresolved-macro-call
116116
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/hir_def/src/diagnostics.rs#L98[diagnostics.rs]
117117

118-
This diagnostic is triggered if rust-analyzer is unable to resolove path to a
118+
This diagnostic is triggered if rust-analyzer is unable to resolve the path to a
119119
macro in a macro invocation.
120120

121121

generated_features.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//Generated file, do not edit by hand, see `xtask/src/codegen`
22
=== Annotations
3-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/annotations.rs#L17[annotations.rs]
3+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/annotations.rs#L18[annotations.rs]
44

55
Provides user with annotations above items for looking up references or impl blocks
66
and running/debugging binaries.
@@ -91,7 +91,7 @@ This is a standard LSP feature and not a protocol extension.
9191

9292

9393
=== File Structure
94-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/file_structure.rs#L18[file_structure.rs]
94+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/file_structure.rs#L25[file_structure.rs]
9595

9696
Provides a tree of the symbols defined in the file. Can be used to
9797

@@ -137,7 +137,7 @@ The following postfix snippets are available:
137137

138138

139139
=== Go to Definition
140-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L16[goto_definition.rs]
140+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L19[goto_definition.rs]
141141

142142
Navigates to the definition of an identifier.
143143

@@ -149,7 +149,7 @@ Navigates to the definition of an identifier.
149149

150150

151151
=== Go to Implementation
152-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_implementation.rs#L7[goto_implementation.rs]
152+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_implementation.rs#L10[goto_implementation.rs]
153153

154154
Navigates to the impl block of structs, enums or traits. Also implemented as a code lens.
155155

@@ -215,7 +215,7 @@ Join selected lines into one, smartly fixing up whitespace, trailing commas, and
215215

216216

217217
=== Magic Completions
218-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/lib.rs#L31[lib.rs]
218+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/lib.rs#L34[lib.rs]
219219

220220
In addition to usual reference completion, rust-analyzer provides some ✨magic✨
221221
completions as well:
@@ -334,7 +334,7 @@ Add the following to `settings.json`:
334334

335335

336336
=== Parent Module
337-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/parent_module.rs#L11[parent_module.rs]
337+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/parent_module.rs#L12[parent_module.rs]
338338

339339
Navigates to the parent module of the current module.
340340

@@ -346,7 +346,7 @@ Navigates to the parent module of the current module.
346346

347347

348348
=== Related Tests
349-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L115[runnables.rs]
349+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L131[runnables.rs]
350350

351351
Provides a sneak peek of all tests where the current item is used.
352352

@@ -374,7 +374,7 @@ Renames the item below the cursor and all of its references
374374

375375

376376
=== Run
377-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L92[runnables.rs]
377+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L94[runnables.rs]
378378

379379
Shows a popup suggesting to run a test/benchmark/binary **at the current cursor
380380
location**. Super useful for repeatedly running just a single test. Do bind this
@@ -501,7 +501,7 @@ be parsed as a valid structural search and replace rule.
501501

502502

503503
=== Workspace Symbol
504-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/symbol_index.rs#L142[symbol_index.rs]
504+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/symbol_index.rs#L148[symbol_index.rs]
505505

506506
Uses fuzzy-search to find types, modules and functions by name across your
507507
project and dependencies. This is **the** most useful feature, which improves code

manual.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,9 @@ If the LSP binary is not available, GNOME Builder can install it when opening a
384384

385385
=== Eclipse IDE
386386

387-
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
388-
389387
Support for Rust development in the Eclipse IDE is provided by link:https://github.com/eclipse/corrosion[Eclipse Corrosion].
390-
While it currently uses RLS as default, you can successfully configure it so the IDE will use `rust-analyzer` instead.
391-
To do so, with an Eclipse IDE where Corrosion is installed, just go to __Window > Preferences > Rust__ and edit the __Path to Rust Language Server__ entry to reference the path to `rust-analyzer`.
388+
If available in PATH or in some standard location, `rust-analyzer` is detected and powers editing of Rust files without further configuration.
389+
If `rust-analyzer` is not detected, Corrosion will prompt you for configuration of your Rust toolchain and language server with a link to the __Window > Preferences > Rust__ preference page; from here a button allows to download and configure `rust-analyzer`, but you can also reference another installation.
392390
You'll need to close and reopen all .rs and Cargo files, or to restart the IDE, for this change to take effect.
393391

394392
== Configuration

0 commit comments

Comments
 (0)