Skip to content

Releases: rust-lang/rust-analyzer

2023-04-10

10 Apr 06:10
Compare
Choose a tag to compare

Changelog #176

Commit: 01120f1
Release: 2023-04-10 (v0.3.1472)

New Features

  • #14433 (first contribution) add #[doc(alias(..))]-based completions.

  • #14512 highlight escapes in char literals:

    Screenshot showing highlighted char escapes

  • #14455 add assist to convert nested functions to closures.

  • #14432 drop support for non-syroot proc macro ABIs (proc macros no longer expand with Rust 1.63).

Fixes

  • #14486 desugar async fn completely.
  • #14481 fix VS Code project linking pop-up buttons being swapped.
  • #14482 use the correct path accessor in the project linking pop-up.
  • #14483 do autoderef in "Generate delegate methods".
  • #14493 insert whitespace between text and attribute macros.
  • #14505 fix block-local trait impl solving regressions.
  • #14520 unify types in infer_expr_coerce_never().

Internal Improvements

  • #14521, #14526, #14528 add bounds for fields in derive macros.
  • #14436 normalize associated types in paths in expressions.
  • #14490 use an arena instead of a hash map in the crate graph.
  • #14442 implement structured API for snippets.
  • #14509 resolve labels in body lowering.
  • #14511 always reborrow mutable reference receiver in methods.
  • #14517 shuffle around some hir-def modules.
  • #14519 don't recreate Hygiene unnecessarily.
  • #14518 remove unnecessary Names from FunctionData::params.
  • #14525 remove parameter names from function item tree.
  • #14524 render function parameters in hir-def pretty printing.

See also the changelog post.

2023-04-04

04 Apr 07:43
Compare
Choose a tag to compare
Auto merge of #14468 - lowr:patch/expand-macro-bang, r=Veykril

Expand Macro Recursively: don't append "!" to non-bang macro name

When we run `Expand Macro Recursively`, we prepend a comment "Recursive expansion of foo! macro" to the expansion result. I've noticed we unconditionally render the macro name with "!" and, while super subtle, I feel a bit awkward when the macro is either a derive or attribute macro.

2023-04-03

03 Apr 05:56
Compare
Choose a tag to compare

Changelog #175

Commit: 2365762
Release: 2023-04-03 (v0.3.1459)

New Features

  • #14366 prompting the user to add a Cargo.toml of unlinked file to the linkedProjects.

Fixes

  • #14422 (first contribution) don't escape double hashes outside of Rust code blocks.
  • #14444 (first contribution) pass environment variables to debug runnables.
  • #14424 check ancestor blocks for local trait impls.
  • #14434 use struct_tail_without_normalization in Expectation::rvalue_hint.
  • #14440 handle box and raw pointers correctly in builtin_deref.
  • #14461 use async block in async function type inference.
  • #14435 add missing autoborrow adjustment for index expressions.
  • #14426 fix stack overflow in inhabitedness checking.
  • #14464 fix false-positive needs-mut on array.
  • #14449 recover from pub() visibility modifier.
  • #14468 don't append ! to derive and attribute macros in "Expand macro recursively".
  • #14419 use the right CrateIds for proc macros in rust-project.json workspaces.
  • #14427 allow subsequent rust-project.json-based workspaces to get proc macro expansion.
  • #14430 canonicalize rust-project.json manifest path.

Internal Improvements

  • #14465 (first contribution) add limited syntax support for return type notations.
  • #14425 (first contribution) fix typo in comment.
  • #14410 add config to specifiy LRU capacities for all queries.
  • #14445 introduce StructFlags.
  • #14448 don't expose InferenceTable outside of hir-ty.
  • #14439 set durability to high for enable_proc_attr_macros input.
  • #14454 refine CrateOrigin variants.
  • #14458 clean up CrateGraph construction.

See also the changelog post.

2023-03-27

27 Mar 08:00
Compare
Choose a tag to compare

Changelog #174

Commit: b99d5eb
Release: 2023-03-27 (v0.3.1451)

New Features

  • #14405, #14409, #14415 load proc macros asynchronously.
  • #14368 MIR episode 3, add support for ?, function pointers and trait objects.

Fixes

  • #14385 (first contribution) fix VS Code status message formatting error.
  • #14407 fix renames of locals used in macro calls.

Internal Improvements

  • #14380 coalesce adjacent Indels.
  • #14402 reject symlinks in rust-project.json.
  • #14408 only intern blocks that declare items.
  • #14412 handle proc macro fetching via OpQueue.
  • #14404 remove client side proc-macro version check.

See also the changelog post.

2023-03-20

20 Mar 05:58
Compare
Choose a tag to compare

Changelog #173

Commit: 825833c
Release: 2023-03-20 (v0.3.1443)

New Features

  • #14281 add quick fix for inserting an unsafe block:

    add-unsafe.mp4

  • #13789 prioritize missing variants in match pattern completions:

    Screenshot showing existing enum variants being de-prioritized in a match

  • #14354 add signature help for record and tuple struct patterns:

    Screenshot showing the doc comments and fields of a struct in a pattern

  • #13994 lint incoherent inherent impls:

    Screenshot showing an error on impl Vec<i32> {}

Fixes

  • #12958 fix return type of async closures.
  • #14337 allow the status bar item to be clicked again.
  • #14347 add StorageDead for let bindings without initializer (fixes false positive needs-mut in loops).
  • #14348 fix rustc proc-macro handling in the rustc workspace.
  • #14349 respect parent blocks in visibility resolution.
  • #14338 only skip reborrow adjustment hints for block, if and match expressions.
  • #14353 don't replace SyntaxToken with SyntaxNode in "Inline call".
  • #14355 don't emit unnecessary reference completions.
  • #14357 don't pass feature flags to rustc private crates metadata invocation.
  • #14359 don't retry inlay hint requests.
  • #14361 fix ast::IfExpr child accessors.

Internal Improvements

  • #14307 add Cargo-style project discovery for Buck and Bazel users.
  • #14362 prioritize "Remove dbg!" assist over "Inline macro".
  • #14358 report sysroot and rustc crate loading errors.
  • #14334, #14336 add is_float, is_char and as_slice to hir::Type.
  • #14378 bump chalk to fix a GAT bug.
  • #14342 add path of workspace root folders to status output.
  • #14340 rename AstDatabase to ExpandDatabase.

See also the changelog post.

2023-03-13

13 Mar 06:16
Compare
Choose a tag to compare

Changelog #172

Commit: f1e51af
Release: 2023-03-13 (v0.3.1435)

New Features

  • #14232, #14316 MIR episode 2, add need-mut and experimental unused-mut diagnostics:

    Screenshot showing an error when reassigning a non-mut variable

  • #14313 add fancy buttons to the VS Code status message:

    Screenshot showing the status and Stop, Reload, Restart and Open logs options in a status bar menu

  • #14266 make replace_or_with_or_else assists more generally applicable.

  • #14328 allow passing extra cargo args when running build scripts.

Fixes

  • #14323 (first contribution) fix source root de-duplication.
  • #14267 mark unresolved field, unresolved method and expected function diagnostics as experimental.
  • #14297 add libcore dependency to proc macros.
  • #14282 load proc macros for rustc_private crates.
  • #14260 tighten replace_match_with_if_let applicability range.
  • #14271 don't trigger unresolved method/field diagnostics on types containing errors.
  • #14284 highlight unresolved derives as such.
  • #14248 show diagnostic for } followed by else in let-else statement.
  • #14283 don't send error notifications for workspace failures if server status is supported.
  • #14286 fix block defmap not looking into tail expressions for macro calls.
  • #14291 fix handling of multiple definition bindings in convert_match_to_let_else.
  • #14299 fix searching inside bodies of attributed items.
  • #14300 watch both stdout and stderr in flycheck.
  • #14306 fix block with no termination in or-patterns.

Internal Improvements

  • #14261 reuse the resolver in InferenceContext instead of rebuilding it when needed.
  • #14302 add missing queries to per_query_memory_usage.
  • #14311 don't attempt to compute diagnostics in library crates.
  • #14326 rename match_expr field of hir::diagnostics::MissingMatchArms.

See also the changelog post.

2023-03-06

06 Mar 07:58
Compare
Choose a tag to compare

Changelog #171

Commit: 0a956ec
Release: 2023-03-06 (v0.3.1426)

New Features

  • #14240 diagnose break with value in incorrect positions:

    Screenshot showing an error on while true { break 0; } and for _ in [()] { break 0; }

  • #14243 diagnose unresolved field, method call and call expression:

    "Screenshot showing errors on various unresolved fields and methods

  • #14238 allow "Generate function" to create functions in a different local crate.

  • #14222, #14245 implement pattern mismatch diagnostics, but keep them disabled.

Fixes

  • #14185 (first contribution) fix running doctests for structs with lifetime parameters.
  • #14208 (first contribution) fix path resolution in the presence of functions and structs with the same name.
  • #14223 implement rendering of tuples in constant values.
  • #14225 removing nested dbg!()s in "Remove dbg!()".
  • #14176 fix associated item visibility in block-local impls.
  • #14239 load the sysroot in all CLI commands.
  • #14247 generate correct completion edits for missing macro arguments.
  • #14255 bring back the hex display in const hover.

Internal Improvements

  • #14040 introduce a MIR and use it for constant evaluation.
  • #14218, #14234 de-duplicate source roots that have overlapping include paths.
  • #14184 handle trait alias definitions.
  • #14244 report type metrics for patterns.
  • #14251 set unit type expectation for expression statements without a semicolon.
  • #14252 handle fields called as method calls as the fields they resolve to.
  • #14213 add API to get raw_ptr type.

See also the changelog post.

2023-02-27

27 Feb 06:40
Compare
Choose a tag to compare

Changelog #170

Commit: 4e29820
Release: 2023-02-27 (v0.3.1410)

New Features

  • #14175 (first contribution) add "Open Docs" command to the context menu:

    Screen recording showing the Open Docs in the context menu and how it opens docs.rs

  • #14207 (first contribution) respect CARGO_HOME in toolchain detection.

Fixes

  • #14203 (first contribution) add check for extra path segments after a fully qualified one.

Internal Improvements

  • #14183 try to improve the rustfmt.overrideCommand docs.

See also the changelog post.

2023-02-20

20 Feb 06:36
Compare
Choose a tag to compare

Changelog #169

Commit: a6603fc
Release: 2023-02-20 (v0.3.1410)

New Features

  • GitHub Discussions are now enabled on the rust-analyzer repository.
  • #14141 support UTF-32 position encoding; together with this change, fixes Emacs lsp-mode emoji crashes.

Fixes

  • #14162 (first contribution) check snippet capability in "Generate getter".
  • #14140 fix delimiter stripping in proc-macro-server.
  • #14123 don't trigger postfix completion before else.
  • #14122 don't expand macros in the same expansion tree after overflow.
  • #14144 strip prefix when searching for raw identifiers.
  • #14138 don't include r# prefix in filesystem changes.
  • #14157 adjust binding mode inlay hints to render better with @ patterns.
  • #14160 bring back hovering call parentheses for return type information.
  • #14149 trigger call info for more signature completions.

Internal Improvements

  • #14153 (first contribution) add v7 proc macro metadata support.
  • #14171 (first contribution) fix link in architecture.md.
  • #14128 improve parser recovery for delimited lists.
  • #14150 don't allocate the generic_args Vec in hir_def::Path if every element is None (~9 MB win on analysis-stats self).
  • #14152 replace some often empty Vecs with boxed slices (~2 MB win on analysis-stats self).
  • #14151 enable smallvec's union feature (~4 MB win on analysis-stats self).
  • #14156 don't reconstruct ref match completion in to_proto manually.
  • #14165 make CompletionItem more POD-like.
  • #14147 don't rely on VSCode internal commands in the server.

See also the changelog post.

2023-02-13

13 Feb 07:24
Compare
Choose a tag to compare

Changelog #168

Commit: 646f973
Release: 2023-02-13 (0.3.1402)

New Features

  • #14095 (first contribution) add unsafe postfix completions.

  • #14098 (first contribution) add support for DidChangeWorkspaceFolders notifications.

  • #13991 add an "Add braces: assist:

    Screen recording showing an assist that adds braces around the bodies of a closure and a match arm

  • #14087, #14094 support computing layout of RPIT.

  • #13986 add a setting to limit the number of completions.

  • #14127 build i686-pc-windows-msvc binaries.

  • #14135 add Lapce installation instructions.

  • #14134 add clippy configuration section to the manual.

Fixes

  • #14114 (first contribution) insert spaces when inlining macros.
  • #14084 fix parsing of nested tuple field accesses (in a cursed way).
  • #14092 don't panic on broken syntax trees in adjustment inlay hints.
  • #14099 properly use location links for type hints of impl Future and its associated type.
  • #14103 don't insert a semicolon when typing = if parse errors are encountered.
  • #14110 fix completions after functions with no bodies.
  • #14111 hide proc macro server version detection errors.
  • #14125 don't render bind pattern inlay hints for constants.
  • #14116 render discriminant inlay hints for mixed variants if at least one discriminant is specified.
  • #13975 suppress extra indent after the end of field and function chains.

Internal Improvements

  • #14091 support sysroot library source being defined inside the workspace.
  • #14100 allow specifying what proc-macro server to run in rust_analyzer::load_cargo.
  • #14119 remove a few allocations in hir_ty::utils.
  • #14090 unify language configuration folding markers with server behaviour.

See also the changelog post.