Skip to content

Commit cb3050e

Browse files
committed
Changelog #34
1 parent 4c652be commit cb3050e

File tree

4 files changed

+106
-7
lines changed

4 files changed

+106
-7
lines changed

generated_assists.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ fn main() {
633633

634634
[discrete]
635635
=== `make_raw_string`
636-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/raw_string.rs#L12[raw_string.rs]
636+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/raw_string.rs#L13[raw_string.rs]
637637

638638
Adds `r#` to a plain string literal.
639639

generated_features.adoc

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Extends the current selection to the encompassing syntactic construct
2424

2525

2626
=== File Structure
27-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/display/structure.rs#L17[structure.rs]
27+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/file_structure.rs#L17[file_structure.rs]
2828

2929
Provides a tree of the symbols defined in the file. Can be used to
3030

@@ -83,7 +83,7 @@ Focusing is usually hovering with a mouse, but can also be triggered with a shor
8383

8484

8585
=== Inlay Hints
86-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/inlay_hints.rs#L40[inlay_hints.rs]
86+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/inlay_hints.rs#L42[inlay_hints.rs]
8787

8888
rust-analyzer shows additional information inline with the source code.
8989
Editors usually render this using read-only virtual text snippets interspersed with code.
@@ -145,7 +145,7 @@ There are postfix completions, which can be triggered by typing something like
145145
There also snippet completions:
146146

147147
.Expressions
148-
- `pd` -> `eprintln!(" = {:?}", );")`
148+
- `pd` -> `eprintln!(" = {:?}", );`
149149
- `ppd` -> `eprintln!(" = {:#?}", );`
150150

151151
.Items
@@ -188,13 +188,35 @@ Clears rust-analyzer's internal database and prints memory usage statistics.
188188
|===
189189

190190

191+
=== On Enter
192+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/typing/on_enter.rs#L15[on_enter.rs]
193+
194+
rust-analyzer can override kbd:[Enter] key to make it smarter:
195+
196+
- kbd:[Enter] inside triple-slash comments automatically inserts `///`
197+
- kbd:[Enter] in the middle or after a trailing space in `//` inserts `//`
198+
199+
This action needs to be assigned to shortcut explicitly.
200+
201+
VS Code::
202+
203+
Add the following to `keybindings.json`:
204+
[source,json]
205+
----
206+
{
207+
"key": "Enter",
208+
"command": "rust-analyzer.onEnter",
209+
"when": "editorTextFocus && !suggestWidgetVisible && editorLangId == rust"
210+
}
211+
----
212+
213+
191214
=== On Typing Assists
192215
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/typing.rs#L37[typing.rs]
193216

194217
Some features trigger on typing certain characters:
195218

196219
- typing `let =` tries to smartly add `;` if `=` is followed by an existing expression
197-
- Enter inside comments automatically inserts `///`
198220
- typing `.` in a chain method call auto-indents
199221

200222

manual.adoc

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ This manual focuses on a specific usage of the library -- running it as part of
1313
https://microsoft.github.io/language-server-protocol/[Language Server Protocol] (LSP).
1414
The LSP allows various code editors, like VS Code, Emacs or Vim, to implement semantic features like completion or goto definition by talking to an external language server process.
1515

16-
To improve this document, send a pull request against
17-
https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/manual.adoc[this file].
16+
[TIP]
17+
====
18+
[.lead]
19+
To improve this document, send a pull request: +
20+
https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/manual.adoc[https://github.com/rust-analyzer/.../manual.adoc]
21+
====
1822

1923
If you have questions about using rust-analyzer, please ask them in the https://users.rust-lang.org/c/ide/14["`IDEs and Editors`"] topic of Rust users forum.
2024

@@ -369,3 +373,22 @@ Or it is possible to specify vars more granularly:
369373
```
370374

371375
You can use any valid RegExp as a mask. Also note that a full runnable name is something like *run bin_or_example_name*, *test some::mod::test_name* or *test-mod some::mod*, so it is possible to distinguish binaries, single tests, and test modules with this masks: `"^run"`, `"^test "` (the trailing space matters!), and `"^test-mod"` respectively.
376+
377+
==== Compiler feedback from external commands
378+
379+
Instead of relying on the built-in `cargo check`, you can configure Code to run a command in the background and use the `$rustc-watch` problem matcher to generate inline error markers from its output.
380+
381+
To do this you need to create a new https://code.visualstudio.com/docs/editor/tasks[VS Code Task] and set `rust-analyzer.checkOnSave.enable: false` in preferences.
382+
383+
For example, if you want to run https://crates.io/crates/cargo-watch[`cargo watch`] instead, you might add the following to `.vscode/tasks.json`:
384+
385+
```json
386+
{
387+
"label": "Watch",
388+
"group": "build",
389+
"type": "shell",
390+
"command": "cargo watch",
391+
"problemMatcher": "$rustc-watch",
392+
"isBackground": true
393+
}
394+
```
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
= Changelog #34
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:c9c518e5e9761bf35d466c47c57c3a1358b56b3c[] +
6+
Release: release:2020-07-20[]
7+
8+
== Sponsors
9+
10+
**Become a sponsor:** https://opencollective.com/rust-analyzer/[opecollective.com/rust-analyzer]
11+
12+
== New Features
13+
14+
* pr:5378[] support vararg functions.
15+
* pr:5354[] add Cargo feature for enabling mimalloc allocator.
16+
Call for participation: pure Rust version of mimalloc would be really handy as cross-compilable fast allocator.
17+
* pr:5345[] emit mutable modifier for `self` in semantic highlighting.
18+
* pr:5348[] highlight punctuation using `"operator"` tag in semantic highlighting.
19+
* pr:5350[] return only requested assists to the editor.
20+
* pr:5401[] leverage chalk for type checking closures.
21+
* pr:5418[] continue non-doc comments if there's a trailing whitespace:
22+
+
23+
image::https://user-images.githubusercontent.com/1711539/87931694-7d050500-ca8a-11ea-8b3f-c958663795e6.gif[]
24+
* pr:5327[] mark fixes from check on save as preferred.
25+
* pr:5430[] **Add turbofish** assist works after `()`
26+
+
27+
image::https://user-images.githubusercontent.com/1711539/87852942-8f563600-c906-11ea-808b-63e8bf3fc228.gif[]
28+
29+
30+
== Fixes
31+
32+
* pr:4676[] upgrade procmacro ABI for the latest stable.
33+
* pr:5352[], pr:5361[] fix build on powerpc.
34+
* pr:5367[] remove associated type bounds in **Add Missing Members** assist.
35+
* pr:5370[] don't insert duplicate `()` when completing tuple struct pattern.
36+
* pr:5377[] fix goto definition for multi-segment macro paths.
37+
* pr:5379[], pr:5396[] guard against infinite macro expansion.
38+
* pr:5381[] fix macro handling in type position.
39+
* pr:5385[] fix off by one error when determining the active param.
40+
* pr:5390[] fix progress registration error for check on save.
41+
* pr:5394[] fix freeze when processing https://github.com/retep998/winapi-rs[a certain crate] with a lot of glob imports.
42+
* pr:5427[] various fixes for **Add/Remove #** assists.
43+
* pr:5423[] Correctly resolve associated types in path bindings.
44+
45+
== Internal Improvements
46+
47+
* pr:5357[] use relaxed atomic ordering for single location test marks.
48+
* pr:5358[], pr:5373[] cleanup hir diagnostics API.
49+
* pr:5355[], pr:5376[] implement license check.
50+
* pr:5387[] add `--memory-usage` to analysis-bench.
51+
* pr:5405[], pr:5415[], pr:5417[] refactor support fo callables, so that IDE features that work for functions, work for lambdas as well.
52+
* pr:5413[] rewrite call info to use semantic information.
53+
* pr:5422[] use `expect!` for snapshot testing in `ra_hir_def`.
54+
* pr:5433[] simplify file exclusion logic in VFS.

0 commit comments

Comments
 (0)