Skip to content

Releases: rust-lang/rust-analyzer

2023-01-30

30 Jan 06:46

Choose a tag to compare

Changelog #166

Commit: f1b257f
Release: 2023-01-30 (0.3.1386)

New Features

  • #14012 (first contribution) add installation instructions for Visual Studio.

  • #14024 (first contribution) update documentation for Emacs.

  • #14041 show signature help for record literals:

    Screenshot showing signature help for the fields in a struct literal

  • #14007 add "Open server logs" button to the error notification:

    Screen recording showing a button that opens the logs when cargo check fails to run

Fixes

  • #14015 (first contribution) don't include lifetime or label apostrophe when renaming.
  • #14020 fix associated item search finding unrelated definitions.
  • #14006 replace soft breaks in Markdown with spaces.
  • #14019, #14023 substitute VS Code variables more generally
  • #14004 don't escape non-snippets in Move const to impl.
  • #14011 fix Unwrap block for let statements.
  • #14037 handle boolean scrutinees better in Match to if-let assist.
  • #14039 make Add missing impl members work for impls inside blocks.
  • #14038 don't fail workspace loading if sysroot can't be found

Internal Improvements

  • #14025 improve deduplication in process_changes.
  • #14009 🧹 lsp_ext.ts.
  • #14017 remove TypeWalk.
  • #14026 try to fix auto-publishing of lib crates.

See also original changelog.

2023-01-23

23 Jan 07:12

Choose a tag to compare

Changelog #165

Commit: daa0138
Release: 2023-01-23 (0.3.1377)

New Features

  • #13935 (first contribution) add assist to desugar doc-comments:

    desugar-comment.mp4

  • #13947 add basic tooltips to adjustment hints:

    Screenshot showing a T ) &T (borrow coercion) tooltip over a .& adjustment hint

  • #13963 unconditionally enable location links in inlay hints.

Fixes

  • #13983 (first contribution) parse const_closures syntax.
  • #13993 (first contribution) VS Code: substitute variables in config.serverPath.
  • #13981 don't run flycheck on startup unless checkOnSave is enabled.
  • #13966 don't compute layout if TargetDataLayout is not available.
  • #13971 improve inference for binary operations more precise.
  • #13961 don't generate PartialEq/PartialOrd methods body when types don't match.
  • #13984 fix target data layout fetching incorrectly passing rustc to rustc.
  • #13978 handle slice patterns in Fill match arms.
  • #13985 don't respond with ContentModified while loading the workspace.
  • #13988 fix whitespace handling in hover Markdown removal.
  • #13980 fix checkOnSave config patching.

Internal Improvements

  • #13964 specify authors, edition, license and rust-version via workspace.package.
  • #13969 use workspace.dependencies to declare local dependencies.
  • #13989 remove hover fallback in favor of ranged hover.
  • #14001 replace SmolStr usage with enum for lang items.

See also original changelog.

2023-01-16

16 Jan 07:55

Choose a tag to compare

Changelog #164

Commit: ff4d55e
Release: 2023-01-16

New Features

  • #13684 (first contribution) add Extract format expression assist:

    Screen.Recording.2022-11-29.at.2.39.49.mov

  • #13810 (first contribution) add action to expand a macro once, inline

    Screen recording showing a macro invocation being replaced by its expansion

  • #13744 (first contribution) add the ability to limit the thread pool size (rust-analyzer.numThreads).

  • #13816 add option to make adjustment (reborrow) hints postfix:

    Screenshot showing some postfix reborrow hints like db.*.&.<unsize>

  • #13825 add Unqualify method call assist:

    Screen recording showing the assist converting Add::add(1, 2) to 1.add(2)

  • #13848 colorize cargo check diagnostics in the full view in VSCode:

    Screen recording showing colors and ASCII art when displaying the compiler output

  • #13934 make unlinked_file diagnostic quickfixes work for inline modules:

    Screen recording showing a mod declaration added into a parent inline module

  • #13458 add assist to replace plain arithmetic operations with wrapping/checked/saturating ones.

  • #13946 remove hover inlay tooltips, replace them with location links.

  • #13799 rename checkOnSave settings to check.

Fixes

  • #13843 (first contribution) add missing await in generated delegate methods.
  • #13753 (first contribution) increase proc macro expansion token limit (fixes the visitors in swc).
  • #13940 (first contribution) fix a panic in the match-to-let-else assist.
  • #13763 add type bounds to generated #[derive] implementations.
  • #13891 keep whitespace in extracted functions.
  • #13890 unescape inline module names when resolving modules.
  • #13897 resolve inherent methods implemented in ancestor blocks.
  • #13948 make inlay hint location links work for more types.
  • #13945 handle or-patters in missing match diagnostics.
  • #13923 revert "add a ZWNJ to prevent VS Code from forming ligatures between hints and code".

Internal Improvements

  • #13956 (first contribution) upgrade command-group to fix build on Haiku OS.
  • #13915 make it clearer when the server expects an initialized notification.
  • #13917 split out hir-def attribute handling parts into hir-expand.
  • #13933 refine reference search for const and function associated items.
  • #13941 explain the idea behind rust-project.json.
  • #13928, #13929, #13862, #13919, #13936, #13937 fix some Clippy lints.

See also original changelog.

2023-01-09

09 Jan 12:51

Choose a tag to compare

Changelog #163

Commit: f77b68a
Release: 2023-01-09

New Features

  • #13832 add enum variant discriminants hints:

    Screenshot showing the discriminant values on an enum

  • #13876 package Windows release artifacts as ZIP and add symbols file.

Fixes

  • #13894 apply fallback before final obligation resolution.
  • #13854 support multi-character punct tokens in MBE.
  • #13877 prefix prelude items whose name collides in current scope.
  • #13887 only set machine-applicable rustc diagnostics as preferred.
  • #13882 remember adjustments introduced by binary operators.
  • #13853 use diagnostic code as link to full message.
  • #13886 add a ZWNJ to prevent VS Code from forming ligatures between hints and code.
  • #13885 skip lifetime elision hints on fn pointers and fn trait types.
  • #13893 complete record enum variants without parens when snippets are disabled.

Internal Improvements

  • #13860 fix a bunch of clippy lints.

See also original changelog.

2023-01-02

02 Jan 10:48

Choose a tag to compare

Changelog #162

Commit: 643bc02
Release: 2023-01-02

New Features

Fixes

  • #13866 (first contribution) use rustc_safe_intrinsic attribute to check for intrinsic safety.
  • #13867 fall back to inaccessible associated functions and constants if no visible resolutions are found.
  • #13869 improve exit point highlighting for for and while loops in tail position.
  • #13871 merge multiple intersecting ranges to fix panic in "Extract module".

Internal Improvements

  • #13861 (first contribution) derive Hash for FileId.
  • #13841 fix a couple more Clippy lints.

See also original changelog.

2022-12-26

26 Dec 08:03

Choose a tag to compare

Changelog #161

Commit: 74ae2dd
Release: 2022-12-26

New Features

  • #13699 implement location links for type inlay hints (disabled until Code 1.76 release because of a bug):

    Screen recording showing clicking on inlay hint parts

  • #13817 add option to hide adjustment hints outside of unsafe blocks and functions:

    Screenshot showing an <unsize>&raw mut * on the RHS of let ptr: *mut [u8] = &mut []

Fixes

  • #13805 (first contribution) complete enum variants without parens when snippets are disabled.
  • #13794 fix "parser seems stuck" panics when parsing colossal files.
  • #13795 use the correct edition when formatting code in path dependencies.
  • #13800 don't match let expressions and inline consts in expr MBE fragments.
  • #13820 fix binding mode hints always adding parentheses to or-patterns.
  • #13831 don't autofill associated type trait bounds when generating an implementation.
  • #13764 correctly check for redundant parentheses in the remove_parentheses assist.
  • #13806 skip hints for identity (T -> T) adjustments.
  • #13814, #13818 calculate the TargetDataLayout correctly for the selected target.
  • #13840 handle lifetime variables in CallableSig query.

Internal Improvements

  • #13828, #13829, #13835 (first contributions) fix redundant_clone, explicit_auto_deref, uninlined_format_args clippy warnings.
  • #13830 use a default derives and strip_prefix.
  • #13771 add xtask command for publishing release notes on GitHub Releases.
  • #13804 split inlay hints into modules by type.
  • #13822 thread FamousDefs through the inlay hints.

See also original changelog.

2022-12-19

19 Dec 10:53

Choose a tag to compare

Auto merge of #13792 - Veykril:flycheck, r=Veykril

Add a command to clear flycheck diagnostics

And document the flycheck notifications

2022-12-12

12 Dec 07:53

Choose a tag to compare

Auto merge of #13756 - flodiebold:simplify-assoc-item-subst, r=flodie…

2022-12-05

05 Dec 09:51

Choose a tag to compare

Auto merge of #13721 - Veykril:incoherent-impls, r=Veykril

Support `rustc_has_incoherent_inherent_impls`

Fixes us not resolving `<dyn Error>::downcast` now that `Error` moved to core, while that assoc function is declared in `alloc`.

2022-11-28

28 Nov 10:07

Choose a tag to compare

Auto merge of #13681 - lowr:fix/extract-function-tail-expr, r=Veykril

fix: check tail expressions more precisely in `extract_function`

Fixes #13620

When extracting expressions with control flows into a function, we can avoid wrapping tail expressions in `Option` or `Result` when they are also tail expressions of the container we're extracting from (see #7840, #9773). This is controlled by `ContainerInfo::is_in_tail`, but we've been computing it by checking if the tail expression of the range to extract is contained in the container's syntactically last expression, which may be a block that contains both tail and non-tail expressions (e.g. in #13620, the range to be extracted is not a tail expression but we set the flag to true).

This PR tries to compute the flag as precise as possible by utilizing `for_each_tail_expr()` (and also moves the flag to `Function` struct as it's more of a property of the function to be extracted than of the container).