Skip to content

Releases: rust-lang/rust-analyzer

2024-06-17

17 Jun 04:43
Compare
Choose a tag to compare

Commit: 6b8b8ff
Release: 2024-06-17 (v0.3.2002)

New Features

  • #17372 compute native diagnostics in parallel.
  • #17364 show type bounds from containers when hovering on functions.
  • #17374 allow choosing logical cores for cache priming threads.
  • #16840 allow arbitrary commands for runnables in rust-project.json.

Fixes

  • #17412 (first contribution) add a breaker to avoid infinite loops with source root cycles.
  • #17381 ensure that a SourceRoot cannot be its own parent.
  • #17380 remove again extra parse cache from Semantics.
  • #17394 fix HirDisplay stack overflow for Self parameter defaults.
  • #17407 avoid doubling Cargo args in runnables.

Internal Improvements

  • #17405, #17406 avoid unnecessary ModPath clones.
  • #17377 improve HIR formatting.
  • #17392 rename ${length()} to ${len()} in MBE.
  • #17398 remove FileId::BOGUS.
  • #17418 fix rustdoc warnings.
  • #17417 prefer a trait over the impl_intern_value_trivial macro.

See also the changelog post.

2024-06-11

11 Jun 07:52
Compare
Choose a tag to compare
Auto merge of #17381 - roife:fix-issue-17378, r=Veykril

fix: ensure that the parent of a SourceRoot cannot be itself

fix #17378.

In `FileSetConfig.map`, different roots might be mapped to the same `root_id` due to deduplication in `ProjectFolders::new`:

```rust
// Example from rustup
/Users/roife/code/rustup/target/debug/build/rustup-863a063426b56c51/out
/Users/roife/code/rustup
```

In `source_root_parent_map`, r-a might encounter paths where their SourceRootId (i.e. `root_id`) is identical, yet one the them is the parent of the another. This situation can cause the `root_id` to be its own parent, potentially leading to an infinite loop.

This PR resolves such cases by adding a check.

2024-06-10

10 Jun 03:44
Compare
Choose a tag to compare

Changelog #237

Commit: b427d46
Release: 2024-06-10 (v0.3.1992)

New Features

  • #17282 (first contribution) hide items starting with __ from symbol search.
  • #17058 add basic, unstable support for rust-analyzer.toml.

IMPORTANT: We don't promise any stability with this feature yet, any configs exposed may be removed again, the ordering may change etc.

Fixes

  • #17352 do not resolve prelude within block modules.
  • #17350 highlight unlinked files more proeminently.
  • #17360 don't touch foreign sources when renaming imports.
  • #17333 check for snippet support in extract_expressions_from_format_string.
  • #17329 don't mark #[rustc_deprecated_safe_2024] functions as unsafe.
  • #17353 fix hover action formatting.
  • #17308 prioritize local crates in auto-import.

Internal Improvements

  • #17346, #17368 (first contribution) add submenus to GUI VS Code extension settings.
  • #17340 improve find_path performance.
  • #17004 cache macro calls more aggressively in Semantics.
  • #17312 add Function::fn_ptr_type(…) for obtaining name-erased function types.
  • #17348 use fallible indexing in TypeOrConstParam::source(…) and LifetimeParam::source(…).
  • #17365 expose snippet capability to diagnostic quickfixes.
  • #17375 don't intern attribute inputs, as their spans make them unique.
  • #17341 clean up inert attribute handling.
  • #17356 prefer shorthand tracing::span macros.
  • #17315 use string interpolation in more places.
  • #17359 add version info to VS Code status bar item.

See also the changelog post.

2024-06-03

03 Jun 05:35
Compare
Choose a tag to compare

Changelog #236

Commit: 7852a4c
Release: 2024-06-03 (v0.3.1983)

New Features

  • #17253 (first contribution) add assist to toggle between normal and doc-comments.
  • #17258 (first contribution) add assist to toggle async sugar.
  • #17328 enable completions within derive helper attributes.

Fixes

  • #17302 fix diagnostics clearing when flycheck runs per-workspace.
  • #17326 fix container search for tokens originating within derive attributes.
  • #17291 handle generics in type constructor term search tactic.

Internal Improvements

  • #17278 (first contribution) replace command-group with process-wrap.
  • #17337 include path info in AbsPathBuf::assert panic message.

See also the changelog post.

2024-05-27

27 May 06:30
Compare
Choose a tag to compare

Changelog #235

Commit: 71a816a
Release: 2024-05-27 (v0.3.1975)

New Features

  • #17268 retain more information about callables.

Fixes

  • #17248 (first contribution) only clear diagnostics after new ones were received.
  • #17140 (first contribution) handle {self} when removing unused imports.
  • #17295 (first contribution) use correct key for environment variables with the C/C++ extension.
  • #17270 consider implied bounds from associated types in completion.
  • #17174 infer type of async blocks with tail return.
  • #17251 resolve extern prelude for modules nested in blocks.
  • #17277 fix various find_path issues.
  • #17279 fix format_args lowering.
  • #17284 use correct toolchain channel when generating built-in type doc links.
  • #17275 fix inconsistent working directory for Run and Debug commands.

Internal Improvements

  • #17296 (first contribution) avoid clone when constructing runnable label.
  • #17287 allow sysroot to only consist of the source root dir.
  • #17252 refactor prefer_no_std and prefer_prelude bools into a struct.

See also the changelog post.

2024-05-20

20 May 05:09
Compare
Choose a tag to compare

Changelog #234

Commit: 21ec8f5
Release: 2024-05-20 (v0.3.1966)

Note

Because of an infrastructure issue, this release is not available on the VS Code Marketplace.
Of course, you can still download and install the VSIX from GitHub Releases.

Fixes

  • #17203 fix OOM caused by term search.
  • #17227 hash file contents to verify it actually changed.
  • #17225 interleave function-like and attribute macro expansion in "Expand macro recursively".
  • #17220 improve confusing literal hovers.
  • #17187 keep parentheses in De Morgan's law assist when the precedence of inner expression is lower.
  • #17216 respect path attribute in "Extract module to file".
  • #17232 don't emit --keep-going with custom build script commands.

Internal Improvements

  • #17250 (first contribution) fix Neovim 0.10 inlay hints config example.
  • #17241 (first contribution) fix some typos.
  • #17221 make macro parse tree validation lazier.
  • #17195 implement unsafe attribute parsing.
  • #17228 sort computed runnables.
  • #17243 add StaticLifetime to hir API.
  • #17235, #17238, #17239, #17240 tweak metrics CI caching.
  • #17224 bump Cargo.lock dependencies.
  • #17259 sync from downstream.

See also the changelog post.

2024-05-13

13 May 05:13
Compare
Choose a tag to compare

Changelog #233

Commit: 5bf2f85
Release: 2024-05-13 (v0.3.1958)

Fixes

  • #17192 fix source range for INT_NUMBER in completion.

Internal Improvements

  • #17207 report all LSP protocol errors with invalid_data.
  • #17208 report both I/O and main loop thread errors.

See also the changelog post.

2024-05-06

06 May 06:33
Compare
Choose a tag to compare

Changelog #232

Commit: c4618fe
Release: 2024-05-06 (v0.3.1950)

Fixes

  • #17177 (first contribution) hide Run lens when lenses are disabled.
  • #17160 create generics for impl traits in associated types.
  • #17190 fix panic on dyn Trait with lifetimes.
  • #17157 don't retry requests that rely on positions, and version resolve data.
  • #17161 discard file paths that aren't valid UTF-8.
  • #17172 correctly handle no_core/no_std for preludes.
  • #17175, #17176 fix implicit tyype argument lowering.
  • #17138 make "Generate function" emit a constructor stub for functions called new.

Internal Improvements

  • #17144 (first contribution) remove confusing rust-project.json example from the docs.
  • #17168 (first contribution) switch from winapi to windows-sys.
  • #17148 match tracing span with function names.

See also the changelog post.

2024-04-29

29 Apr 07:29
Compare
Choose a tag to compare

Changelog #231

Commit: f216be4
Release: 2024-04-29 (v0.3.1940)

Fixes

  • #16972 (first contribution) make cargo run always available for binaries.
  • #17131 (first contribution) use different codes for "no such field" errors based on variant type.
  • #17135 compute expression scopes for inline consts.
  • #17145 fix source roots creation on changes.
  • #17151 avoid item tree collisions for attributes on generic parameters.
  • #17153 fix doc comment desugaring for proc macros.
  • #17021 support hovering limits for ADTs.
  • #17134 don't render unknown lifetimes in generic arguments.

Internal Improvements

  • #17143 show workspace info in the status bar.
  • #17102 add more tracing spans to project loading.
  • #17150 make sure josh rustc-pull doesn't add new root commits.

See also the changelog post.

2024-04-22

22 Apr 05:40
Compare
Choose a tag to compare

Changelog #230

Commit: 47a901b
Release: 2024-04-22 (v0.3.1932)

New Features

  • #16813 add wrap/unwrap #[cfg_attr] assist.
  • #17094 add "Convert From to TryFrom" assist.
  • #17110 add minimal cargo-script support.
  • #17118 allow .rs files to be used linkedProjects.
  • #16057 render matched declarative macro arm on hover.

Fixes

  • #17115 (first contribution) try to generate more meaningful names in JSON converter.
  • #16877 fix impl Trait<Self> causing stack overflows.
  • #17055 replace just the variable name in the "Unused variable" quick fix.
  • #17093 avoid some circular symlinks in VFS.
  • #17024 handle escaped chars in doc comments.
  • #17074 add static and const highlight token types.
  • #17105 make test harness arguments configurable.

Internal Improvements

  • #17104 (first contribution) bump actions in metrics.yaml.
  • #16639 redesign rust-analyzer::config.
  • #17078 improve diagnostics performance.
  • #16726 remove #[cfg(test)] hacks.
  • #17108 clean up #[cfg] and environment handling in project-model.
  • #16938 handle BeginPanic in const eval.
  • #17119 extract common fields out of ProjectWorkspace variants.
  • #17037 improve TokenSet implementation and add reserved keywords.
  • #17072 use hir_fmt_args everywhere in hir_ty::display.
  • #17070 remove unnecessay GlobalState::send_hint_refresh_query field.
  • #17087 fix a few tracing spans without .entered().
  • #17083 improve ReferenceCategoryType.
  • #16257 teach Cargo about #[cfg(rust_analyzer)].
  • #17025 use josh for subtree syncs.
  • #17095 add a CONTRIBUTING.md.

See also the changelog post.