Skip to content

Releases: rust-lang/rust-analyzer

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.

2023-02-06

06 Feb 07:04
Compare
Choose a tag to compare

Changelog #167

Commit: 0b32b65
Release: 2023-02-06 (0.3.1394)

New Features

  • #14065 support generic functions in the generate_function assist.
  • #14057 handle complex patterns in match to let-else assist.
  • #14063 drop support for the 1.58 proc-macro ABI.

Fixes

  • #14036 record method resolution for the remaining operator expressions.
  • #14067 Code: create the trace output channel lazily.
  • #14068 apply unsize adjustments after pointer casts.
  • #14071 don't render field-less discriminant inlay hints for data-carrying enums.
  • #14082 support non-ASCII characters in case conversion.
  • #14043 use relative offsets when inserting ident token in macro expansion for completion.
  • #14058 fix display of negative trait bounds in outline view.

Internal Improvements

  • #14010 (first contribution) make the fuzzing harness build again.
  • #14072 (first contribution) mention all three Visual Studio extensions in the manual.
  • #14049 add installation instructions for Flatpak VS Code.
  • #14070 implement proc-macro API versioning.
  • #14061 make tt generic over the span data.
  • #14056 parse #[allow_internal_unsafe] on macros.
  • #14062 set the current edition to 2021.
  • #14034 tweak change collapsing some more.
  • #14083 add more basic issue templates.

See also original changelog.

2023-01-30

30 Jan 06:46
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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.