Skip to content

Releases: rust-lang/rust-analyzer

2023-05-08

08 May 04:56
Compare
Choose a tag to compare

Changelog #180

Commit: 833d530
Release: 2023-05-08 (v0.3.1506)

New Features

  • #11557 (first contribution) add dependency tree explorer:

    Screenshot showing a new VS Code panel with a tree of the project dependencies

  • #14662 (first contribution) support locally-built documentation for experimental/externalDocs with compatible clients.

  • #14664 MIR episode 4, support arithmentic assignment operators, statics, constants in patterns and associated constants in traits.

  • #14711 highlight closure captures when cursor is on | or move.

  • #14732 fix pattern type mismatches for bindings, enable pattern type mismatch diagnostics again.

  • #14725 emit function bodies when expanding built-in derives.

  • #14749 define problem matcher for panics, F8 will go to the panic location in Code.

  • #14758 add rust-analyzer.hover.memoryLayout.enable config for disabling memory layout info on hover.

Fixes

  • #14745 (first contribution) sort dependencies in VS Code tree view.
  • #14707 don't generate already-existing methods on generate_delegate_methods.
  • #14713 don't highlight escapes in raw strings.
  • #14714 exclude Sized from go-to actions in hover.
  • #14705 fix floating point evaluation and try block tracking in MIR.
  • #14712 only pass unstable flags to cargo metadata from extra args config.
  • #14738 use block def maps in body lowering.
  • #14739 parse bare dyn types with leading lifetime.
  • #14750 ignore impls with #[rustc_reservation_impl]
  • #14748 show memory layout type aliases.

Internal Improvements

  • #14716 reduce memory consumption by not merging trait_impls_in_deps results (saves 59 MB on self).
  • #14720 use boxed slices instead of Vecs in declarative macros (saves 8 MB on self).
  • #14718 use triomphe::Arc instead of std::sync::Arc (saves 4 MB on self).
  • #14715 refactor symbol index.
  • #14710 refactor notification handlers.
  • #14733 publish line-index and switch to nohash_hasher.
  • #14757 fix library publish branch filter.

See also the changelog post.

2023-05-01

01 May 06:43
Compare
Choose a tag to compare

Changelog #179

Commit: 3a27518
Release: 2023-05-01 (v0.3.1498)

New Features

  • #14690 add hover for closures:

    Screenshot showing a a closure hover with details about captured fields

  • #14513 add #[doc(alias(..))]-based field and function completions.

  • #14659 de-duplicate crates when extending crate graphs.

  • #14644, #14686 don't underline whole for loops and iterator chains on errors.

Fixes

  • #14647 (first contribution) remove extra rustc argument in target layout loading.
  • #14641 register obligations during path inference.
  • #14652 fix pat fragment handling in the 2021 edition.
  • #14651 fix VS Code workspace root de-duplication.
  • #14689 force InitializeParams path drives to uppercase on Windows.
  • #14667 handle nested types in unwrap_result_return_type.
  • #14671 fix proc-macro-srv path config.
  • #14678 fix "Restart server" button trying to start instead of restart the server.
  • #14639 fix some typos in StructFlags.

Internal Improvements

  • #14648 (first contribution) specify --pre-release when publishing on the Code Marketplace.
  • #14658 remove proc-macro server command from the rust-analyzer binary.
  • #14654 fix status command panicking when additional LRU caches are set up.
  • #14636 remove unnecessary is_derive field from MacroCallKind::Attr.

See also the changelog post.

2023-04-24

24 Apr 05:12
Compare
Choose a tag to compare

Changelog #178

Commit: bc78ebd
Release: 2023-04-24 (v0.3.1489)

New Features

  • #14610 resolve $crate in derive paths.

Fixes

  • #14591 (first contribution) restrict Sort items assist range.
  • #14618 (first contribution) respect editor.parameterHints.enabled after triggering a completion.
  • #14598 fix release channel detection for unstable completion filtering.
  • #14619 fix false need-mut positive and too large span in closures.
  • #14625 fix token conversion for doc-comments.
  • #14634 report remaining macro errors in associated item collection.
  • #14643 fix const eval panic with parameter destructing.
  • #14603 try to de-duplicate workspaces by top level cargo workspace.

Internal Improvements

  • #14577 (first contribution) fix all spelling mistakes.
  • #14621 (first contribution) support type parameters in make::impl_trait.
  • #14622 add syntax::make::ty_alias.
  • #14632 increase LRU cache size for parse_expansion and macro_expand queries.
  • #14633 don't reparse files when trying to expand assoc item macro calls.
  • #14630 replace Arc<String> with Arc<str>.
  • #14594 move Expander and LowerCtx into separate modules.
  • #14604 add minicore smoke test.
  • #14599 add RA_UNSTABLE_SYSROOT_HACK.
  • #14628 restructure symbol queries.
  • #14629 add additional query information to status ouput.

See also the changelog post.

2023-04-17

17 Apr 06:56
Compare
Choose a tag to compare

Changelog #177

Commit: bab80da
Release: 2023-04-17 (v0.3.1481)

New Features

  • #14533 make inlay hints insertable:

    insert_inlay_hint.mp4

  • #14561 map tokens from include! expansion to the included file:

    include-go-to-def.mp4

  • #14470 compute closure captures.

  • #14549, #14551 don't suggest unstable items on stable toolchain.

Fixes

  • #14536 (first contribution) restrict the applicability range of Sort trait items.
  • #14540 (first contribution) allow extracting function from single brace of block expression.
  • #14579 (first contribution) accept unknown notification during initialization.
  • #14538 fix project linking popup appearing for modules that can be linked to a crate.
  • #14550 fix type inference in nested closures.
  • #14544 infer types of nested RPITs.
  • #14576 fix explicit deref problems in closure capture.
  • #14560 fix view crate graph being broken due to webworker usage.
  • #14559, #14570 skip code lens resolution for mismatched document versions.
  • #14580 parse more exclusive range and inline const patterns.
  • #14547 fix receiver adjustments for Extract variable.
  • #14535 use the Rust file's parent directory instead of the workspace folder when running the discoverProjectCommand.

Internal Improvements

  • #14556 warn when loading sysroot fails to find the core library.
  • #14446 only run TypeScript CI when the VS Code extension changes.
  • #14572 encode closing delimiter span in FlatTrees.
  • #14573 allocate ExprScope entries in a single arena instead of per-ScopeData.
  • #14575 put Attrs behind a query instead of AttsWithOwner.
  • #14574 make block_def_map infallible.
  • #14578 make inherent_impls_in_block and trait_impls_in_block infallible.
  • #14585 make ExpandDatabase::parse_macro_expansion and ExpandDatabase::parse_or_expand infallible.
  • #14581 move layout logic from hir-def to hir-ty.
  • #14583 report macro definition errors on the definition.
  • #14584, #14587, #14588 report item-level macro expansion syntax errors.

See also the changelog post.

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.