Skip to content

Commit c906b80

Browse files
committed
Changelog #270
1 parent 3a817dd commit c906b80

File tree

5 files changed

+148
-13
lines changed

5 files changed

+148
-13
lines changed

generated_assists.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ enum TheEnum {
10851085

10861086
[discrete]
10871087
=== `extract_constant`
1088-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L34[extract_variable.rs]
1088+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L35[extract_variable.rs]
10891089

10901090
Extracts subexpression into a constant.
10911091

@@ -1193,7 +1193,7 @@ fn bar(name: i32) -> i32 {
11931193

11941194
[discrete]
11951195
=== `extract_static`
1196-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L51[extract_variable.rs]
1196+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L52[extract_variable.rs]
11971197

11981198
Extracts subexpression into a static.
11991199

@@ -1257,7 +1257,7 @@ struct S {
12571257

12581258
[discrete]
12591259
=== `extract_variable`
1260-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L17[extract_variable.rs]
1260+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L18[extract_variable.rs]
12611261

12621262
Extracts subexpression into a variable.
12631263

generated_config.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,16 @@ Whether to automatically add a semicolon when completing unit-returning function
274274

275275
In `match` arms it completes a comma instead.
276276
--
277+
[[rust-analyzer.completion.autoAwait.enable]]rust-analyzer.completion.autoAwait.enable (default: `true`)::
278+
+
279+
--
280+
Toggles the additional completions that automatically show method calls and field accesses with `await` prefixed to them when completing on a future.
281+
--
282+
[[rust-analyzer.completion.autoIter.enable]]rust-analyzer.completion.autoIter.enable (default: `true`)::
283+
+
284+
--
285+
Toggles the additional completions that automatically show method calls with `iter()` or `into_iter()` prefixed to them when completing on a type that has them.
286+
--
277287
[[rust-analyzer.completion.autoimport.enable]]rust-analyzer.completion.autoimport.enable (default: `true`)::
278288
+
279289
--

generated_features.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ This is the same as `Go to Definition` with the following exceptions:
275275

276276

277277
=== Go to Definition
278-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L24[goto_definition.rs]
278+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L28[goto_definition.rs]
279279

280280
Navigates to the definition of an identifier.
281281

@@ -411,7 +411,7 @@ image::https://user-images.githubusercontent.com/48062697/113020661-b6922200-917
411411

412412

413413
=== Magic Completions
414-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/lib.rs#L82[lib.rs]
414+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/lib.rs#L78[lib.rs]
415415

416416
In addition to usual reference completion, rust-analyzer provides some ✨magic✨
417417
completions as well:
@@ -1024,7 +1024,7 @@ Displays the recursive memory layout of a datatype.
10241024

10251025

10261026
=== Workspace Symbol
1027-
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-db/src/symbol_index.rs#L176[symbol_index.rs]
1027+
**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-db/src/symbol_index.rs#L174[symbol_index.rs]
10281028

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

manual.adoc

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,32 @@ interface JsonProject {
716716
/// dependencies as well as sysroot crate (libstd,
717717
/// libcore and such).
718718
crates: Crate[];
719+
/// Configuration for CLI commands.
720+
///
721+
/// These are used for running and debugging binaries
722+
/// and tests without encoding build system-specific
723+
/// knowledge into rust-analyzer.
724+
///
725+
/// # Example
726+
///
727+
/// Below is an example of a test runnable. `{label}` and `{test_id}`
728+
/// are explained in `Runnable::args`'s documentation below.
729+
///
730+
/// ```json
731+
/// {
732+
/// "program": "buck",
733+
/// "args": [
734+
/// "test",
735+
/// "{label}",
736+
/// "--",
737+
/// "{test_id}",
738+
/// "--print-passing-details"
739+
/// ],
740+
/// "cwd": "/home/user/repo-root/",
741+
/// "kind": "testOne"
742+
/// }
743+
/// ```
744+
runnables?: Runnable[];
719745
}
720746
721747
interface Crate {
@@ -726,7 +752,10 @@ interface Crate {
726752
/// Path to the root module of the crate.
727753
root_module: string;
728754
/// Edition of the crate.
729-
edition: "2015" | "2018" | "2021";
755+
edition: '2015' | '2018' | '2021' | '2024';
756+
/// The version of the crate. Used for calculating
757+
/// the correct docs.rs URL.
758+
version?: string;
730759
/// Dependencies
731760
deps: Dep[];
732761
/// Should this crate be treated as a member of
@@ -757,9 +786,9 @@ interface Crate {
757786
/// rust-analyzer assumes that files from one
758787
/// source can't refer to files in another source.
759788
source?: {
760-
include_dirs: string[],
761-
exclude_dirs: string[],
762-
},
789+
include_dirs: string[];
790+
exclude_dirs: string[];
791+
};
763792
/// List of cfg groups this crate inherits.
764793
///
765794
/// All cfg in these groups will be concatenated to
@@ -776,21 +805,68 @@ interface Crate {
776805
target?: string;
777806
/// Environment variables, used for
778807
/// the `env!` macro
779-
env: { [key: string]: string; },
808+
env: { [key: string]: string; };
780809
781810
/// Whether the crate is a proc-macro crate.
782811
is_proc_macro: boolean;
783812
/// For proc-macro crates, path to compiled
784813
/// proc-macro (.so file).
785814
proc_macro_dylib_path?: string;
815+
816+
/// Repository, matching the URL that would be used
817+
/// in Cargo.toml.
818+
repository?: string;
819+
820+
/// Build-specific data about this crate.
821+
build?: BuildInfo;
786822
}
787823
788824
interface Dep {
789825
/// Index of a crate in the `crates` array.
790-
crate: number,
826+
crate: number;
791827
/// Name as should appear in the (implicit)
792828
/// `extern crate name` declaration.
793-
name: string,
829+
name: string;
830+
}
831+
832+
interface BuildInfo {
833+
/// The name associated with this crate.
834+
///
835+
/// This is determined by the build system that produced
836+
/// the `rust-project.json` in question. For instance, if buck were used,
837+
/// the label might be something like `//ide/rust/rust-analyzer:rust-analyzer`.
838+
///
839+
/// Do not attempt to parse the contents of this string; it is a build system-specific
840+
/// identifier similar to `Crate::display_name`.
841+
label: string;
842+
/// Path corresponding to the build system-specific file defining the crate.
843+
build_file: string;
844+
/// The kind of target.
845+
///
846+
/// This information is used to determine what sort
847+
/// of runnable codelens to provide, if any.
848+
target_kind: 'bin' | 'lib' | 'test';
849+
}
850+
851+
interface Runnable {
852+
/// The program invoked by the runnable.
853+
///
854+
/// For example, this might be `cargo`, `buck`, or `bazel`.
855+
program: string;
856+
/// The arguments passed to `program`.
857+
args: string[];
858+
/// The current working directory of the runnable.
859+
cwd: string;
860+
/// Used to decide what code lens to offer.
861+
///
862+
/// `testOne`: This runnable will be used when the user clicks the 'Run Test'
863+
/// CodeLens above a test.
864+
///
865+
/// The args for testOne can contain two template strings:
866+
/// `{label}` and `{test_id}`. `{label}` will be replaced
867+
/// with the `Build::label` and `{test_id}` will be replaced
868+
/// with the test name.
869+
kind: 'testOne' | string;
794870
}
795871
----
796872

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
= Changelog #270
2+
:sectanchors:
3+
:experimental:
4+
:page-layout: post
5+
6+
Commit: commit:2df4ecfc74bbadf1281e13d73f8424f7b5c1514b[] +
7+
Release: release:2025-01-27[] (`v0.3.2282`)
8+
9+
== New Features
10+
11+
* pr:18934[] add the ability to jump from `into` to `from` definitions.
12+
* pr:18993[] make auto-insertion of `await` and `iter()` in completions configurable.
13+
* pr:19012[] implement `arbitrary_self_types`.
14+
15+
== Fixes
16+
17+
* pr:19004[] (first contribution) increase `AUTODEREF_RECURSION_LIMIT` to 20.
18+
* pr:18973[] make niches into nices (improve niche count rendering).
19+
+
20+
image::https://github.com/user-attachments/assets/3389dd73-5fb5-4d9e-af73-46d503b6aa6f["a type with nicely-formatted 2⁶³ niches"]
21+
* pr:19034[] don't complete `#[doc(hidden)]` enum variants and use trees.
22+
* pr:18976[] consider enum variants in type ns resolution.
23+
* pr:18988[] de-prioritize completions that add `await` and `iter()`.
24+
* pr:19016[], pr:19018[] record glob imports in `ItemScope`.
25+
* pr:19028[] filter by path stability in flyimport.
26+
* pr:19030[] fix markdown horizontal ruler sometimes being treated as a heading.
27+
* pr:19020[] prevent infinite recursion when formatting bounds.
28+
* pr:19017[] fix flycheck panic with `once` invocation strategy.
29+
* pr:18977[] fix missing upmapping in trait impl completion.
30+
* pr:18982[] reduce "Extract variable" range.
31+
* pr:18967[] properly record meaningful imports as re-exports in symbol index.
32+
* pr:18986[] go to `Display::fmt` when invoked on `to_string`.
33+
* pr:19014[] check ``cfg``s when collecting macro defs.
34+
* pr:19026[] only collect implicit visibile use symbols if they have renames.
35+
* pr:19033[] make `proc-macro-srv` spans lines and columns 1-indexed (but always 1).
36+
* pr:19019[] explicitly add buildfiles when constructing `ProjectFolders`.
37+
* pr:18989[] only refresh syntax tree view when the active document changes.
38+
39+
== Internal Improvements
40+
41+
* pr:18981[] (first contribution) make usage of `RTLD_DEEPBIND` in proc macro server portable.
42+
* pr:18991[] keep already computed inlay hint properties instead of late resolving them.
43+
* pr:19029[] skip redundant path search in `resolve_completion_edits`.
44+
* pr:18909[] use `strict_provenance` in symbol interner.
45+
* pr:18984[] move dual blanket `impl` logic from `source_analyzer` to `goto_def`.
46+
* pr:18990[] clean up `Name` string rendering.
47+
* pr:18994[] treat cfg fetching failures as a warning, not error.
48+
* pr:18878[] document all `rust-project.json` fields.
49+
* pr:18972[] drop outgoing `lsp-server` messages on a background thread.

0 commit comments

Comments
 (0)