Skip to content

Commit d9be500

Browse files
committed
Changelog #35
1 parent 2b701ef commit d9be500

File tree

4 files changed

+91
-9
lines changed

4 files changed

+91
-9
lines changed

generated_assists.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ enum A { One(One) }
291291

292292
[discrete]
293293
=== `extract_variable`
294-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/extract_variable.rs#L14[extract_variable.rs]
294+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/extract_variable.rs#L13[extract_variable.rs]
295295

296296
Extracts subexpression into a variable.
297297

@@ -343,7 +343,7 @@ fn handle(action: Action) {
343343

344344
[discrete]
345345
=== `fix_visibility`
346-
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/fix_visibility.rs#L9[fix_visibility.rs]
346+
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_assists/src/handlers/fix_visibility.rs#L10[fix_visibility.rs]
347347

348348
Makes inaccessible item public.
349349

generated_features.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,19 @@ The syntax for a structural search replace command is `<search_pattern> ==>> <re
291291
A `$<name>` placeholder in the search pattern will match any AST node and `$<name>` will reference it in the replacement.
292292
Within a macro call, a placeholder will match up until whatever token follows the placeholder.
293293

294+
All paths in both the search pattern and the replacement template must resolve in the context
295+
in which this command is invoked. Paths in the search pattern will then match the code if they
296+
resolve to the same item, even if they're written differently. For example if we invoke the
297+
command in the module `foo` with a pattern of `Bar`, then code in the parent module that refers
298+
to `foo::Bar` will match.
299+
300+
Paths in the replacement template will be rendered appropriately for the context in which the
301+
replacement occurs. For example if our replacement template is `foo::Bar` and we match some
302+
code in the `foo` module, we'll insert just `Bar`.
303+
304+
Method calls should generally be written in UFCS form. e.g. `foo::Bar::baz($s, $a)` will match
305+
`$s.baz($a)`, provided the method call `baz` resolves to the method `foo::Bar::baz`.
306+
294307
Placeholders may be given constraints by writing them as `${<name>:<constraint1>:<constraint2>...}`.
295308

296309
Supported constraints:

manual.adoc

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ Here are some useful self-diagnostic commands:
110110
* **Rust Analyzer: Show RA Version** shows the version of `rust-analyzer` binary
111111
* **Rust Analyzer: Status** prints some statistics about the server, like the few latest LSP requests
112112
* To enable server-side logging, run with `env RA_LOG=info` and see `Output > Rust Analyzer Language Server` in VS Code's panel.
113-
* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Server Trace` in the panel.
114-
* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open the `Console` tab of VS Code developer tools.
113+
* To log all LSP requests, add `"rust-analyzer.trace.server": "verbose"` to the settings and look for `Rust Analyzer Language Server Trace` in the panel.
114+
* To enable client-side logging, add `"rust-analyzer.trace.extension": true` to the settings and open `Output > Rust Analyzer Client` in the panel.
115115

116116
=== rust-analyzer Language Server Binary
117117

@@ -273,9 +273,6 @@ However, if you use some other build system, you'll have to describe the structu
273273
[source,TypeScript]
274274
----
275275
interface JsonProject {
276-
/// The set of paths containing the crates for this project.
277-
/// Any `Crate` must be nested inside some `root`.
278-
roots: string[];
279276
/// The set of crates comprising the current project.
280277
/// Must include all transitive dependencies as well as sysroot crate (libstd, libcore and such).
281278
crates: Crate[];
@@ -288,11 +285,37 @@ interface Crate {
288285
edition: "2015" | "2018";
289286
/// Dependencies
290287
deps: Dep[];
288+
/// Should this crate be treated as a member of current "workspace".
289+
///
290+
/// By default, inferred from the `root_module` (members are the crates which reside
291+
/// inside the directory opened in the editor).
292+
///
293+
/// Set this to `false` for things like standard library and 3rd party crates to
294+
/// enable performance optimizations (rust-analyzer assumes that non-member crates
295+
/// don't change).
296+
is_workspace_member?: boolean;
297+
/// Optionally specify the (super)set of `.rs` files comprising this crate.
298+
///
299+
/// By default, rust-analyzer assumes that only files under `root_module.parent` can belong to a crate.
300+
/// `include_dirs` are included recursively, unless a subdirectory is in `exclude_dirs`.
301+
///
302+
/// Different crates can share the same `source`.
303+
///
304+
/// If two crates share an `.rs` file in common, they *must* have the same `source`.
305+
/// rust-analyzer assumes that files from one source can't refer to files in another source.
306+
source?: {
307+
include_dirs: string[],
308+
exclude_dirs: string[],
309+
},
291310
/// The set of cfgs activated for a given crate, like `["unix", "feature=foo", "feature=bar"]`.
292311
cfg: string[];
312+
/// Target triple for this Crate.
313+
///
314+
/// Used when running `rustc --print cfg` to get target-specific cfgs.
315+
target?: string;
316+
/// Environment variables, used for the `env!` macro
317+
env: : { [key: string]: string; },
293318
294-
/// value of the OUT_DIR env variable.
295-
out_dir?: string;
296319
/// For proc-macro crates, path to compiles proc-macro (.so file).
297320
proc_macro_dylib_path?: string;
298321
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
= Changelog #35
2+
:sectanchors:
3+
:page-layout: post
4+
5+
Commit: commit:8ff40af7286b66294d8b64f0c8fdb3179a84be76[] +
6+
Release: release:2020-07-27[]
7+
8+
== Sponsors
9+
10+
**Become a sponsor:** https://opencollective.com/rust-analyzer/[opencollective.com/rust-analyzer]
11+
12+
== New Features
13+
14+
* pr:5524[] allow opting out of experimental diagnostics like MismatchedArgCount.
15+
* pr:5518[] use resolved paths in SSR rules. The main user-visible changes are:
16+
** SSR now matches paths based on whether they resolve to the same thing instead of whether they're written the same.
17+
*** So `foo()` won't match `foo()` if it's a different function `foo()`, but will match `bar::foo()` if it's the same `foo`.
18+
** Paths in the replacement will now be rendered with appropriate qualification for their context.
19+
*** For example `foo::Bar` will render as just `Bar` inside the module `foo`, but might render as `baz::foo::Bar` from elsewhere.
20+
** This means that all paths in the search pattern and replacement template must be able to be resolved.
21+
** It now also matters where you invoke SSR from, since paths are resolved relative to wherever that is.
22+
** Search now uses find-uses on paths to locate places to try matching. This means that when a path is present in the pattern, search will generally be pretty fast.
23+
** Function calls can now match method calls again, but this time only if they resolve to the same function.
24+
* pr:5527[] track internal metrics: https://rust-analyzer.github.io/metrics/.
25+
* pr:5470[] use `cargo.target` for `checkOnSave`.
26+
* pr:5451[] highlight more cases punctuation characters.
27+
* pr:5475[] support `Trait as _` imports.
28+
* pr:5492[] use symbol tags.
29+
* pr:5500[] problem matcher auto detects relative/absolute paths and matches VSCode LSP's owner and source.
30+
* pr:5473[] new format of `rust-project.json` -- configuration file for non Cargo-based projects.
31+
32+
== Fixes
33+
34+
* pr:5467[] allow null or empty values for configuration.
35+
* pr:5466[] do not show default types in function and closure return values.
36+
* pr:5478[] replace existing visibility modifier in **Fix Visibility** assist.
37+
* pr:5480[] fix snippetTextEdits applying to other files.
38+
39+
== Internal Improvements
40+
41+
* pr:5458[], pr:5472[] fully switch from `insta` to `expect`.
42+
* pr:5479[] allow gathering memory stats on non-jemalloc Linux.
43+
* pr:5481[] track document versions in the server.
44+
* pr:5497[] store macro invocation parameters green trees instead of token
45+
trees, which improves memory usage.
46+
* pr:5519[] cache macro expansion in semantics.

0 commit comments

Comments
 (0)