Skip to content

Releases: rust-lang/rust-analyzer

2024-03-11

11 Mar 08:15
Compare
Choose a tag to compare

Changelog #224

Commit: 574e23e
Release: 2024-03-11 (v0.3.1877)

New Features

  • #16662, #16773, #16794 add test explorer (disabled by default, enable using rust-analyzer.testExplorer).
  • #15938, #16756 add hover display for trait assoc items

Fixes

  • #16723 (first contribution) complete constants inside format strings.
  • #16769 fix argument type inference with associated type impl Trait.
  • #16757 disable style lints by default (rust-analyzer.diagnostics.styleLints.enable).
  • #16759 fix "Go to definition" for constants inside range patterns.
  • #16778 bump rustc_pattern_analysis to fix a panic on mismatched types.
  • #16770 fix panic on float numbers without dots in chain calls (x.1e0).
  • #16779 skip match diagnostics for partially unknown types.
  • #16690 use four-space indentation in macro expansion.
  • #16752 don't allow destructuring of structs with no public fields.
  • #16766 keep attributes in "Generate delegate trait" assist.
  • #16775 remove accidental dependency between parse_macro_expansion and parse.
  • #16776 make SpanMap accesses lazy to avoid a salsa dependency.
  • #16777 don't invalid body query results when generating desugared names.
  • #16781, #16782 don't escape \ and $ in "Extract format expression".
  • #16719 add basic support for the VS Code Native Debug extension.

Internal Improvements

  • #16722 (first contribution) avoid some allocations.
  • #16748 compute syntax validation errors on demand.
  • #16755 use PATH For toolchain binaries.
  • #16785, #16786, #16787 simplify the parser code somewhat.
  • #16742 add parent-child relationship between SourceRoots.
  • #16703 add more methods for resolving AST definitions to their corresponding HIR types.
  • #16763 add index and parent_fn accessors to hir::Param.
  • #16772 add tracing spans to salsa databases.
  • #16708, #16751 move assist, diagnostics docs and lint definition generation into xtask codegen.
  • #16747 various clean-ups.
  • #16758 bump dependencies.

See also the changelog post.

2024-03-04

04 Mar 06:21
Compare
Choose a tag to compare

Changelog #223

Commit: 037924c
Release: 2024-03-04 (v0.3.1868)

New Features

  • #16638 (first contribution) add destructure_struct_binding assist.
  • #16651 add fill_record_pattern_fields assist.
  • #16687 support tuples in term search.
  • #16555, #16692 speed up completions by considering coherence.

Fixes

  • #16630 fix type inference of closures with predicates.
  • #16679 resolve modules in blocks in the ide layer.
  • #16647 fix false positive for dyn Trait in replace_filter_map_next_with_find_map.
  • #16678 fix panic when inlining callsites inside macro parameters.
  • #16684 don't panic on synthetic syntax in inference diagnostics.
  • #16691 fix completions panicking with certain macro setups.
  • #16693 prefer sysroot rustc in rust-project.json projects.
  • #16696, #16709 handle deref_mut and index_mut in index expressions.
  • #16727 don't highlight related associated items of supertraits.
  • #16702 ignore generic arguments in intra-doc link path resolution.
  • #16665 prioritize rustup sysroots over system ones.
  • #16695 revert doc-comment highlighting.

Internal Improvements

  • #16670 (first contribution) document NeoVim inlay hint configuration.
  • #16673 (first contribution) narrow down typos ignore list.
  • #16706 drop load-cargo dependency on ide.
  • #16738 bump rustc_pattern_analysis.
  • #16627 add repository URL and code sample sections to the bug report template.
  • #16669 merge BorrowKind::Unique into BorrowKind::Mut.
  • #16697 add RelPath::to_path_buf() method.
  • #16698 derive PartialEq, Eq and Hash for hir::Param.
  • #16705 add public function for resolving callable AST expressions to their HIR equivalents.
  • #16707 export SemanticsImpl from hir.
  • #16680 remove salsa compile-fail tests.

See also the changelog post.

2024-02-26

26 Feb 06:53
Compare
Choose a tag to compare

Changelog #222

Commit: 5346002
Release: 2024-02-26 (v0.3.1860)

New Features

  • #16489 (first contribution) create alias when renaming an import.
  • #16589 add unresolved-ident diagnostic.
  • #16303 add non-exhaustive-let diagnostic.
  • #16475 support multiple tab stops for edits in VSCode.

Fixes

  • #16358 (first contribution) de-duplicate references from macro expansions.
  • #16621 (first contribution) avoid setting RUSTC_BOOTSTRAP for build scripts, to prevent spurious recompiles.
  • #16590 fix remove-unnecessary-else false positives on if expressions.
  • #16616 try to fix potential server hang with build scripts.
  • #16645 fix deadlock between recreate_crate_graph and file_line_index.
  • #16618 don't escape { in assists.
  • #16637 account for string delimiters correctly in proc macro server.
  • #16606 render associated item owner in hover for items other than functions.

Internal Improvements

  • #16654 (first contribution) add -V shorthand for --version.
  • #16643, #16652 reduce salsa memory usage.
  • #16612 fetch toolchain and data layout for detached files.
  • #13112 set up handling of auto trait bounds, but leave it disabled due to performance problems.
  • #16617 attempt to add a timeout to rustc_tests.
  • #16648 pin rustc-tests commit.
  • #16649, #16650 disable rustc-tests metrics.
  • #16601 check out repository before running typos.
  • #16646 remove some repeated words.
  • #16668 sync from downstream.

See also the changelog post.

2024-02-19

19 Feb 09:36
Compare
Choose a tag to compare

Changelog #221

Commit: 68c506f
Release: 2024-02-19 (v0.3.1850)

New Features

  • #16092 (first contribution) introduce term search to rust-analyzer.
  • #16117 (first contribution) prioritize constructors and builders in completions.
  • #15923 improve support for ignored proc macros.
  • #15476 substitute $saved_file in custom check commands.

Fixes

  • #16550 (first contribution) activate on top level Cargo.toml and rust-project.json files.
  • #16530 fix macro transcriber emitting incorrect lifetime tokens.
  • #16541 highlight doc comments.
  • #16547 validate literals in proc macro server's FreeFunctions::literal_from_str.
  • #16544 only complete traits in impl ... for.
  • #16553 improve parser error recovery on = in record field initializer and patterns.
  • #16554 pass .cargo/config.toml environment variables to proc-macro server.
  • #16563 set RUSTUP_TOOLCHAIN and invoke the proxies instead of sysroot binaries.
  • #16247 fix build scripts not being rebuilt on some occasions.
  • #16574 fix needless_return false positives on trailing inner item declarations.
  • #16582 respect textual length of paths in find_path.
  • #16583 ignore type mismatches between {unknown} and non-{unknown} types.
  • #16586 remove cargo knowledge from CrateData.
  • #16569 place snippets correctly in multi-edit assists.
  • #16579 fix snippets being placed leftwards of where they should be.
  • #16559 fill in SCIP documentation fields.

Internal Improvements

  • #16588 (first contribution) parse (nightly) const and async trait bounds.
  • #16587 (first contribution) update GitHub actions and Node version.
  • #16576 (first contribution) add license files to lsp-server.
  • #15003 add basic support for become expressions (tail calls).
  • #16577 migrate assists to the structured snippet API, part 7 of 7.
  • #16446 implement literal_from_str in proc macro server.
  • #16537, #16545 make tool discovery prefer sysroot paths.
  • #16540 make macro_arg query always returns a TokenTree.
  • #16560 set channel override when querying the sysroot metadata.
  • #16558 update JsonProject to include optional fields.
  • #16562 add clippy and rustfmt problem matchers to CI.
  • #16573 remove salsa compile tests.
  • #16533 bump rustc_pattern_analysis.
  • #16585 bump actions/checkout to v4.
  • #16598, #16599, #16600 downgrade actions/checkout, actions/setup-node and Node in release workflow.
  • #16597 sync from downstream.

See also the changelog post.

2024-02-12

12 Feb 06:34
Compare
Choose a tag to compare

Changelog #220

Commit: c06ca6c
Release: 2024-02-12 (v0.3.1839)

New Features

  • #16510 add option to only run cargo check on the current package.
  • #16502 add unnecessary else diagnostic.
  • #16460 add trailing return diagnostic.
  • #16477 add incorrect case diagnostics for traits and their associated items.
  • #16454 add break and return postfix completions.
  • #16424 add support for converting let statements to guarded returns.
  • #15863 add UnindexedProject notification for LSP clients.

Fixes

  • #16487 (first contribution) improve Deref handling in "Generate getter" assist.
  • #16509 render visibility for tuple struct fields.
  • #16124 improve parser error recovery on missing arguments in call expressions.
  • #16484 preserve where clause when expanding built-in derive macros.
  • #16462 improve error message when proc-macros have not yet been built.
  • #16497 fix spacing when inlining functions defined in macros.
  • #16517 fix crash inside filter_unnecessary_bounds on missing generic parameter.

Internal Improvements

  • #16482 (first contribution) use boxed slice for Subtree::token_trees.
  • #16503 move salsa fork in-tree.
  • #16505 optimize input queries that take no arguments.
  • #16527 remove hack for self-referential SyntaxContexts.
  • #16467 migrate assists to the structured snippet API, part 6.
  • #16474 instrument more paths using tracing.
  • #16499 bump rustc_pattern_analysis.
  • #16525 abstract more over ItemTreeLoc-like structs.
  • #16470 lint against debug prints and disallowed types using Clippy.
  • #16500 run Clippy on Windows, not Linux.
  • #16518, #16519, #16521 enable more Clippy lints.
  • #16492, #16532 sync from downstream.

See also the changelog post.

2024-02-05

05 Feb 07:05
Compare
Choose a tag to compare

Changelog #219

Commit: 39ad79b
Release: 2024-02-05 (v0.3.1831)

New Features

  • #16439 support "Go to definition" from inside include!d files.
  • #16417 add "Normalize import" assist and improve "Merge imports".
  • #16441 add option to exclude tests from references search results.

Fixes

  • #15730 (first contribution) add postfix completion for let .. else.
  • #16453 undo special bracket classification in VS Code config.

Internal Improvements

  • #16463 (first contribution) remove references to abi_amdgpu_kernel.
  • #16394, #16456 extend tracing integration and use it in hprof.
  • #16459 use improved adjusted_display_range for all diagnostics.
  • #16461 remove unnecessary usages of ExpansionInfo.
  • #16447 clean up mir error variants.
  • #16479 use MacOS 12 runners for releases.
  • #16451 work through temporarily allowed Clippy lints, part 2.
  • #16413 run clippy on CI.
  • #16448, #16469 add typo check to CI.
  • #16476 sync from downstream.
  • #16416 VS Code: report conflict with panicbit.cargo.

See also the changelog post.

2024-01-29

29 Jan 06:39
Compare
Choose a tag to compare

Changelog #218

Commit: 7219414
Release: 2024-01-29 (v0.3.1823)

New Features

  • #16420 use upstream exhaustiveness checker.

Fixes

  • #16431 (first contribution) use adjusted_display_range_new in mismatched_arg_count diagnostic.
  • #16427 filter #[cfg]-ed out fields when lowering record patterns.

Internal Improvements

  • #16415 make TryToNav trait public.
  • #16435 do not return code lens data after resolving.
  • #16434 restructure and clean up hir-expand a bit.

See also the changelog post.

2024-01-22

22 Jan 04:40
Compare
Choose a tag to compare

Changelog #217

Commit: d410d4a
Release: 2024-01-22 (v0.3.1815)

New Features

  • #16370 show additional value information when hovering over literals.
  • #16374, #16375 show implemented notable traits on hover.
  • #16391 add config to allow renaming of non-local definitions.
  • #16372 add One import granularity.

Fixes

  • #16349 add error recovery for use_tree_list parsing:

    Screenshot showing only one error for an unclosed brace in a use declaration

  • #16385 fix intra-doc links.

  • #15868 infer OUT_DIR when workspace root contains a symlink.

  • #16396 fix panic when extracting struct from enum variant.

  • #16378 handle SelfParam better in "Inline call".

  • #16405 include for in "Convert to guarded return".

  • #16314 parse macro_rules as macro name.

  • #16367 make value_ty query fallible.

Internal Improvements

  • #15636, #16383 (first contribution) show which roots are being scanned in progress messages.
  • #16196 (first contribution) rename generator to coroutine.
  • #16409 (first contribution) remove some unused code.
  • #16350 speed up line index calculation via NEON for aarch64.
  • #16395 speed up line ending normalization using memchr.
  • #16366 make data queries transparent over their diagnostics variant.
  • #16352, #16389 port rustfmt's algorithm for import ordering.
  • #16351 eagerly lower enum variants in CrateDefMap construction.
  • #16388 record FnAbi.
  • #16356 add unstable config for loading the sysroot sources via cargo metadata.
  • #16380, #16387 run cargo metadata on sysroot for CI metrics.
  • #16384 make use of some new SmolStr improvements.
  • #16397 refactor macro_call to be consistent with other parsers.
  • #16398 automatically fix Clippy lints.
  • #16401 expand lint tables and make Clippy happy.
  • #16404 work through temporarily allowed Clippy lints, part 1.
  • #16406 add max_line_length to .editorconfig.
  • #16364, #16412 sync from downstream.

See also the changelog post.

2024-01-15

15 Jan 06:49
Compare
Choose a tag to compare

Changelog #216

Commit: 9d8889c
Release: 2024-01-15 (v0.3.1807)

New Features

  • #16209 (first contribution) add assist to merge nested ifs:

    merge_ifs.mp4

  • #16308 use $crate for built-in derives.

Fixes

  • #16265 (first contribution) include pub(crate) imports in suggestions.
  • #16348 fix nested include!s resolving from the wrong base file.
  • #16312 fix rust-analyzer-proc-macro-srv failing to launch on Windows.
  • #16277 fix panic in generate_delegate_methods.
  • #16333 preserve extracted block comments in "Extract function".
  • #16310 fix parsing of method calls on ranges.
  • #16274 consider #[doc(notable_trait)] for completion relevance.

Internal Improvements

  • #16307 don't store the VFS contents in memory.
  • #16329 minor perf and memory improvements.
  • #16347 consider all kinds of explicit private imports in find_path.
  • #16319 differentiate between VFS configuration and file change events.
  • #16275 fix ast::Path::segments implementation.
  • #16334 bump salsa.
  • #16317 sync from downstream.
  • #16271 remove sysroot-abi feature flag from proc-macro-test.
  • #16309 recognize proc macro server unexpectedly quitting and report the exit code.
  • #16311 remove the rustc_dependencies crate.
  • #16339 replace source_root_crates output hash set with a slice.

See also the changelog post.

2024-01-08

08 Jan 06:31
Compare
Choose a tag to compare

Changelog #215

Commit: af40101
Release: 2024-01-08 (v0.3.1799)

New Features

  • #16222 (first contribution) add unresolved_assoc_item diagnostic:

    Screenshot showing a diagnostic on a misspelled associated function

  • #16279 support IDE features for tuple fields:

    Screenshot showing hover working on a tuple field, inside a println! call

  • #15933 resolve inherent and implemented associated items in doc comments:

    Screenshot showing associated methods and consts being highlighted in doc comments

  • #16100 add quick fix for unresolved methods when an associated function with the same name exists:

    Screen recording showing quick fixes for invalid method calls where an associated method with the same name exists

  • #16011 add rust-analyzer.cargo.buildScripts.rebuildOnSave option to rebuild proc macros on save if they change.

  • #16223 add quick fix for "Redundant associated item" diagnostic:

    Screen recording showing a quick fix that adds an implemented method to the corresponding trait definition

  • #16298 add inlay hint for exclusive ranges:

    Screenshot showing inlay hints like 0..<10

Fixes

  • #16081 (first contribution) keep trailing whitespace in doc comments.

  • #16139 (first contribution) give methods a container name.

  • #16136 make the expected completion type a tad smarter with function types:

    Screenshot showing no parantheses when completing a struct field with a function pointer of matching type

  • #16258, #16261, #16267, #16270 rewrite and optimize ImportMap::search_dependencies.

  • #16268 remove result limit for trait-importing method completions.

  • #16153 tell user that linkedProjects is set when failing to discover projects.

  • #16234 fix focus range in attribute/derive upmapping.

  • #16085 fix type inference with IndexMut returning references.

  • #15810 fix panic with macros in "Convert boolean to enum" and "Promot local to constant" assists.

  • #16112, #16264 rewrite "Generate delegate trait" assist.

  • #16067 make "Introduce named generic" assist work with nested types.

  • #16068 pick up new generic names on conflict in "Introduce named generic".

  • #16114 fix Self type replacement in "Inline function".

  • #16199 resolve Self in "Extract struct from enum variant".

  • #16049 don't complete callable parantheses in struct literals.

  • #16241 give a userful error when rustc cannot be found in explicit sysroot.

  • #16285 fix panic on unaligned #[repr(packed)].

  • #16062 update rust-analyzer.cargo.check documentation references to rust-analyzer.check.

Internal Improvements

  • #16179 (first contribution) populate new SCIP SymbolInformation fields.
  • #16213 (first contribution) update dev guide based on the 2024-01-01 release.
  • #16252 (first contribution) switch to expected.assert_eq for ide tests.
  • #15922, #16238, #16262 (first contribution) update Gentoo installation instructions.
  • #16302 (first contribution) add a basic README.md to the line-index crate.
  • #16290 reduce Vec cloning in MIR lowering and eval.
  • #16237 reduce Arc allocations in macro_expand.
  • #16082 migrate assists to the structured snippet API, part 5.
  • clean up and enhance readability of generate_delegate_trait.
  • #16226 expose whether the channel has been dropped in lsp-server errors.
  • #16211 use [workspace.lints.clippy] to configure lints.
  • #16256 only compare relevant parts in ide::{runnables, inlay_hints} tests.
  • #16260 replace single usage of check_expect with check_diagnostics.
  • #16294 fix some minor clippy::perf issues.
  • #16248 add proc-macro-test crate back to the main workspace.
  • #16249 sync from downstream.

See also the changelog post.