Skip to content

Commit d4e00d0

Browse files
committed
Changelog #187
1 parent 6f39ad6 commit d4e00d0

File tree

3 files changed

+107
-5
lines changed

3 files changed

+107
-5
lines changed

generated_assists.adoc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,73 @@ impl Person {
11861186
```
11871187

11881188

1189+
[discrete]
1190+
=== `generate_delegate_trait`
1191+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_trait.rs#L23[generate_delegate_trait.rs]
1192+
1193+
Generate delegate trait implementation for `StructField`s.
1194+
1195+
.Before
1196+
```rust
1197+
trait SomeTrait {
1198+
type T;
1199+
fn fn_(arg: u32) -> u32;
1200+
fn method_(&mut self) -> bool;
1201+
}
1202+
struct A;
1203+
impl SomeTrait for A {
1204+
type T = u32;
1205+
1206+
fn fn_(arg: u32) -> u32 {
1207+
42
1208+
}
1209+
1210+
fn method_(&mut self) -> bool {
1211+
false
1212+
}
1213+
}
1214+
struct B {
1215+
a┃: A,
1216+
}
1217+
```
1218+
1219+
.After
1220+
```rust
1221+
trait SomeTrait {
1222+
type T;
1223+
fn fn_(arg: u32) -> u32;
1224+
fn method_(&mut self) -> bool;
1225+
}
1226+
struct A;
1227+
impl SomeTrait for A {
1228+
type T = u32;
1229+
1230+
fn fn_(arg: u32) -> u32 {
1231+
42
1232+
}
1233+
1234+
fn method_(&mut self) -> bool {
1235+
false
1236+
}
1237+
}
1238+
struct B {
1239+
a: A,
1240+
}
1241+
1242+
impl SomeTrait for B {
1243+
type T = <A as SomeTrait>::T;
1244+
1245+
fn fn_(arg: u32) -> u32 {
1246+
<A as SomeTrait>::fn_(arg)
1247+
}
1248+
1249+
fn method_(&mut self) -> bool {
1250+
<A as SomeTrait>::method_( &mut self.a )
1251+
}
1252+
}
1253+
```
1254+
1255+
11891256
[discrete]
11901257
=== `generate_deref`
11911258
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_deref.rs#L16[generate_deref.rs]

manual.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ Also see the https://emacs-lsp.github.io/lsp-mode/page/lsp-rust-analyzer/[rust-a
280280

281281
Note the excellent https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/[guide] from https://github.com/rksm[@rksm] on how to set-up Emacs for Rust development with LSP mode and several other packages.
282282

283-
=== Vim/NeoVim
283+
=== Vim/Neovim
284284

285285
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
286286
Not needed if the extension can install/update it on its own, coc-rust-analyzer is one example.
287287

288-
There are several LSP client implementations for vim or neovim:
288+
There are several LSP client implementations for Vim or Neovim:
289289

290290
==== coc-rust-analyzer
291291

@@ -308,7 +308,7 @@ Note: for code actions, use `coc-codeaction-cursor` and `coc-codeaction-selected
308308
https://github.com/autozimu/LanguageClient-neovim[here]
309309
* The GitHub project wiki has extra tips on configuration
310310

311-
2. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists):
311+
2. Configure by adding this to your Vim/Neovim config file (replacing the existing Rust-specific line if it exists):
312312
+
313313
[source,vim]
314314
----
@@ -335,7 +335,7 @@ let g:ale_linters = {'rust': ['analyzer']}
335335

336336
==== nvim-lsp
337337

338-
NeoVim 0.5 has built-in language server support.
338+
Neovim 0.5 has built-in language server support.
339339
For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lspconfig#rust_analyzer[neovim/nvim-lspconfig].
340340
Once `neovim/nvim-lspconfig` is installed, use `+lua require'lspconfig'.rust_analyzer.setup({})+` in your `init.vim`.
341341

@@ -376,7 +376,7 @@ EOF
376376

377377
See https://sharksforarms.dev/posts/neovim-rust/ for more tips on getting started.
378378

379-
Check out https://github.com/simrat39/rust-tools.nvim for a batteries included rust-analyzer setup for neovim.
379+
Check out https://github.com/simrat39/rust-tools.nvim for a batteries included rust-analyzer setup for Neovim.
380380

381381
==== vim-lsp
382382

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
= Changelog #187
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:4a2ceeff0fb53de168691b0f55d9808d221b867e[] +
7+
Release: release:2023-06-26[] (`v0.3.1566`)
8+
9+
== New Features
10+
11+
* pr:14948[] add "generate delegate impl" assist:
12+
+
13+
image::https://user-images.githubusercontent.com/20956650/242857423-22114959-caa6-45ec-a154-b4b2f458f6b1.gif["Screen recording showing the assist generating code that delegates a trait implementation to a field."]
14+
* pr:15116[] remove Markdown injection grammar.
15+
16+
== Fixes
17+
18+
* pr:15105[] (first contribution) fix display of negative integers.
19+
* pr:15074[] fix inlining of async functions.
20+
* pr:15112[] support manual implementation of `Fn` traits in the MIR interpreter.
21+
* pr:15119[] support more intrinsics in the MIR interpreter.
22+
* pr:15135[] fix some unsizing problems in MIR.
23+
* pr:15085[] include project path in workspace loading errors.
24+
* pr:15104[] skip mutability diagnostics on synthetic bindings.
25+
26+
== Internal Improvements
27+
28+
* pr:15093[] use `ArgumentV1` instead of `Argument`.
29+
* pr:15071[], pr:15089[] remove spurious `regex` dependency.
30+
* pr:15087[], pr:15097[], pr:15100[] use consistent style for error handling.
31+
* pr:15086[] intern use and extern crate items like other items.
32+
* pr:15095[] change in-tree libs to workspace dependencies and bump versions.
33+
* pr:15098[] use lib crates from crates.io.
34+
* pr:15070[] report metric timings for file item trees and crate def map creation.
35+
* pr:15110[] add run-tests CLI command.

0 commit comments

Comments
 (0)