Skip to content

Commit fbcbb1c

Browse files
committed
Changelog 28
1 parent 965fdfa commit fbcbb1c

File tree

4 files changed

+147
-30
lines changed

4 files changed

+147
-30
lines changed

generated_assists.adoc

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -337,35 +337,6 @@ fn main() {
337337
```
338338

339339

340-
[discrete]
341-
=== `change_lifetime_anon_to_named`
342-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/change_lifetime_anon_to_named.rs#L9[change_lifetime_anon_to_named.rs]
343-
344-
Change an anonymous lifetime to a named lifetime.
345-
346-
.Before
347-
```rust
348-
impl Cursor<'_┃> {
349-
fn node(self) -> &SyntaxNode {
350-
match self {
351-
Cursor::Replace(node) | Cursor::Before(node) => node,
352-
}
353-
}
354-
}
355-
```
356-
357-
.After
358-
```rust
359-
impl<'a> Cursor<'a> {
360-
fn node(self) -> &SyntaxNode {
361-
match self {
362-
Cursor::Replace(node) | Cursor::Before(node) => node,
363-
}
364-
}
365-
}
366-
```
367-
368-
369340
[discrete]
370341
=== `change_return_type_to_result`
371342
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/change_return_type_to_result.rs#L8[change_return_type_to_result.rs]
@@ -566,6 +537,35 @@ fn main() {
566537
```
567538

568539

540+
[discrete]
541+
=== `introduce_named_lifetime`
542+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/introduce_named_lifetime.rs#L12[introduce_named_lifetime.rs]
543+
544+
Change an anonymous lifetime to a named lifetime.
545+
546+
.Before
547+
```rust
548+
impl Cursor<'_┃> {
549+
fn node(self) -> &SyntaxNode {
550+
match self {
551+
Cursor::Replace(node) | Cursor::Before(node) => node,
552+
}
553+
}
554+
}
555+
```
556+
557+
.After
558+
```rust
559+
impl<'a> Cursor<'a> {
560+
fn node(self) -> &SyntaxNode {
561+
match self {
562+
Cursor::Replace(node) | Cursor::Before(node) => node,
563+
}
564+
}
565+
}
566+
```
567+
568+
569569
[discrete]
570570
=== `introduce_variable`
571571
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/introduce_variable.rs#L14[introduce_variable.rs]

generated_features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Navigates to the type of an identifier.
7676

7777

7878
=== Hover
79-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/hover.rs#L63[hover.rs]
79+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/hover.rs#L97[hover.rs]
8080

8181
Shows additional information, like type of an expression or documentation for definition when "focusing" code.
8282
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.

manual.adoc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,57 @@ Gnome Builder currently has support for RLS, and there's no way to configure the
269269
1. Rename, symlink or copy the `rust-analyzer` binary to `rls` and place it somewhere Builder can find (in `PATH`, or under `~/.cargo/bin`).
270270
2. Enable the Rust Builder plugin.
271271

272+
== Non-Cargo Based Projects
273+
274+
rust-analyzer does not require Cargo.
275+
However, if you use some other build system, you'll have to describe the structure of your project for rust-analyzer in the `rust-project.json` format:
276+
277+
[source,TypeScript]
278+
----
279+
interface JsonProject {
280+
/// The set of paths containing the crates for this project.
281+
/// Any `Crate` must be nested inside some `root`.
282+
roots: string[];
283+
/// The set of crates comprising the current project.
284+
/// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such).
285+
crates: Crate[];
286+
}
287+
288+
interface Crate {
289+
/// Path to the root module of the crate.
290+
root_module: string;
291+
/// Edition of the crate.
292+
edition: "2015" | "2018";
293+
/// Dependencies
294+
deps: Dep[];
295+
/// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`.
296+
cfg: string[];
297+
298+
/// value of the OUT_DIR env variable.
299+
out_dir?: string;
300+
/// For proc-macro crates, path to compiles proc-macro (.so file).
301+
proc_macro_dylib_path?: string;
302+
}
303+
304+
interface Dep {
305+
/// Index of a crate in the `crates` array.
306+
crate: number,
307+
/// Name as should appear in the (implicit) `extern crate name` declaration.
308+
name: string,
309+
}
310+
----
311+
312+
This format is provisional and subject to change.
313+
Specifically, the `roots` setup will be different eventually.
314+
315+
There are tree ways to feed `rust-project.json` to rust-analyzer:
316+
317+
* Place `rust-project.json` file at the root of the project, and rust-anlayzer will discover it.
318+
* Specify `"rust-analyzer.linkedProjects": [ "path/to/rust-project.json" ]` in the settings (and make sure that your LSP client sends settings as a part of initialize request).
319+
* Specify `"rust-analyzer.linkedProjects": [ { "roots": [...], "crates": [...] }]` inline.
320+
321+
See https://github.com/rust-analyzer/rust-project.json-example for a small example.
322+
272323
== Features
273324

274325
include::./generated_features.adoc[]
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
= Changelog #28
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:d6967762dd1fff3cfb65d481ba5a169143205c0e[] +
6+
Release: release:2020-06-08[]
7+
8+
== New Features
9+
10+
* pr:4711[] don't pass `--all-features` by default, use Cargo's default features instead.
11+
* pr:4720[] highlight unsafe operations inside unsafe blocks. In VS Code, you can use `editor.semanticTokenColorCustomizations` to customize the actual coloring
12+
+
13+
[source,json]
14+
----
15+
"editor.semanticTokenColorCustomizations": {
16+
"[Theme Name]": {
17+
"rules": {
18+
"operator.unsafe": "#f00",
19+
"function.unsafe": "#f00"
20+
},
21+
}
22+
}
23+
----
24+
+
25+
image::https://user-images.githubusercontent.com/1711539/84034187-48d1fb00-a99a-11ea-960b-e6b3f73e7db1.png[]
26+
* pr:4382[] allow specifying key-value cfg options in JsonProject.
27+
* pr:4726[] allow to override build-in project discovery with explicit list of `Cargo.toml`s to import:
28+
+
29+
[source,json]
30+
----
31+
{ "rust-analyzer.linkedProjects": ["/home/projects/rust-analyzer/Cargo.toml"] }
32+
----
33+
* pr:4730[] document `rust-project.json` file format, which can be used with non-Cargo based build systems.
34+
Docs: https://rust-analyzer.github.io/manual.html#non-cargo-based-projects[#non-cargo-based-projects].
35+
* pr:4660[] enable hover and autocomplete docs on macro generated items.
36+
* pr:4748[] implement hover actions, as an alternative UI for code lenses.
37+
+
38+
image::https://user-images.githubusercontent.com/1711539/84036613-b6cbf180-a99d-11ea-81e3-f3ecd9142937.gif[]
39+
* pr:4689[] implement return position impl trait.
40+
41+
42+
== Fixes
43+
44+
* pr:4750[] fix **Introduce Named Lifetime** assist to work in more cases.
45+
+
46+
image::https://user-images.githubusercontent.com/1711539/84036167-22fa2580-a99d-11ea-8fec-493520297c3d.gif[]
47+
* pr:4580[] invoke correct cargo for `run` action in VS Code.
48+
* pr:4658[] fix lexing of format strings.
49+
* pr:4721[] use correct modifier for unused code.
50+
* pr:4502[] mark fixes from diagnostics as quick fixes.
51+
* pr:4737[] parse default unsafe & default const.
52+
* pr:4765[] fix type parameter defaults.
53+
54+
== Internal Improvements
55+
56+
* pr:4761[] use Chalk from crates.io.
57+
* pr:4748[] build specialized index to improve auto-import performance.
58+
* pr:4717[] compute assists text edits lazily.
59+
* pr:4703[] document review process and contribution guidelines.
60+
* pr:4772[] document certain high-level internal architecture invariants.
61+
* pr:4688[] document initilizationOptions used by rust-analyzer.
62+
* pr:4710[] make LSP extension for running tests & binaries less rust-specific.
63+
* pr:4723[] derive local roots from workspace configuration.
64+
* pr:4724[] rename WorldState -> GlobalState.
65+
* pr:4758[] actually test `include!(concant!(env!()))` pattern.
66+
* pr:4760[] preliminary refactorings in preparation for new VFS.

0 commit comments

Comments
 (0)