Skip to content

Releases: rust-lang/rust-analyzer

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.

2024-01-01

01 Jan 12:33
Compare
Choose a tag to compare

Changelog #214

Commit: 9db5155
Release: 2024-01-01 (v0.3.1791)

Fixes

  • #16221 (first contribution) fix panic in some macros due to unhandled SyntaxContextId::SELF_REF.
  • #16096 (first contribution) update VS Code extension panic problem matcher.
  • #16224 fix handling of hygiene in the presence of SyntaxContextId::SELF_REF.

Internal Improvements

  • #16217 (first contribution) simplify implementation of apply_document_changes.

See also the changelog post.

2023-12-25

25 Dec 07:41
Compare
Choose a tag to compare

Changelog #213

Commit: 85fb463
Release: 2023-12-25 (v0.3.1782)

New Features

  • #16088 implement a rust-analyzer span-backed proc-macro server mode.

Fixes

  • #16155 (first contribution) don't assume ASCII in remove_markdown.
  • #16152 resolve alias before resolving enum variant.
  • #16163 de-duplicate annotations.
  • #16165 update metavariable expression implementation.
  • #16066, #16185 remove unnecessary braces after with unused imports.
  • #16167 fully remove dummy spans.
  • #16175 correctly set and mark the proc-macro spans.
  • #16178 fix span marking for built-in function-like macros.
  • #16184 fix Semantics node caching in completion analysis.
  • #16158 desugar doc comments correctly for MBE.
  • #16137 complete exported macros in #[macro_use($0)].

Internal Improvements

  • #16182 update world symbols request definiton, prefer focus range for macros.
  • #16183 clean up Expander a bit.
  • #16143 move proc macro knowledge out of base-db and into hir-expand.
  • #16145 split out a span crate.
  • #16150 move out WithFixture into dev-only crate.
  • #16151 add minimal support for the 2024 edition.
  • #16144 sync from downstream.
  • #16149 don't fail changelog generation on missing PRs.

See also the changelog post.

2023-12-18

18 Dec 06:53
Compare
Choose a tag to compare

Changelog #212

Commit: 21b06c1
Release: 2023-12-18 (v0.3.1774)

Fixes

  • #15887 (first contribution) fix tuple to named struct conversion inside macro calls some more.
  • #16106 fix syntax bridge assigning invalid spans to lifetime tokens.
  • #16061 fix fragment parser on incomplete parses.
  • #16130 remove subtrees with fake spans in syntax fix-up.
  • #16131 fix false positive type mismatch in const reference patterns.
  • #16094 replace doc_comments_and_attrs with collect_attrs, second round.
  • #16089 query for nearest parent block around the hint to resolve.

Internal Improvements

  • #16099 improve import asset performance a bit, bump limit, and shorten the paths.
  • #16125 run rust-analyzer on rustc UI tests in metrics.
  • #16115 update built-in attributes.
  • #16102, #16104 publish and bump line-index.
  • #16123 remove ModuleId from TypeOwnerId.
  • #16098 sync from downstream.

See also the changelog post.

2023-12-11

11 Dec 06:16
Compare
Choose a tag to compare

Changelog #211

Commit: 457b966
Release: 2023-12-11 (v0.3.1766)

New Features

  • #15959 replace TokenMap with an abstraction that matches reality.

  • #16027 add support for implicit format args:

    rename-format-args.mp4

  • #16034 support multiple navigation targets when the focus range is in the macro definition site:

    Screen recording showing two Go to definition results for tcx.def_span in the rustc source code

  • #15990 diagnose extra trait impl items:

    Screenshot showing an error on a trait impl item that's not a member of original trait

  • #15627 prioritize import suggestions based on the expected type:

    Screenshot showing the flyimport pop-up prioritizing std::sync::atomic::Ordering in a fetch_add call

Fixes

  • #15896 (first contribution) show placeholder while getting runnable list from server:

    Screenshot showing a Looking for runnables... in the picker before cargo test and cargo check show up

  • #15515 (first contribution) improve handling of binary expressions on the left-hand side of "Flip binary expression".

  • #16009 (first contribution) don't search for ControlFlow as string in "Extract function".

  • #16028 make drop inlay hints more readable:

    Screenshot showing drop hints appearing now after the semicolon

  • #16024 fix runnables working directory on Windows.

  • #16054 fix token downmapping being quadratic.

  • #16016 don't insert parantheses around fields in struct literals.

  • #16041 fix WideChar offsets calculation in line-index.

  • #16073 replace doc_comments_and_attrs with collect_attrs.

  • #16035 fix diagnostics panicking when resolving to different files due to macros.

  • #16037 don't print proc-macro panic backtraces in the logs.

  • #15486 fix item tree lowering pub(self) to pub().

  • #15705 resolve Self type references in delegate method assist.

  • #16048 fix concat_bytes! expansion emitting an identifier.

  • #16058 reduce spans for unresolved field and method diagnostics.

  • #16060 fix completion in format_args! with invalid template.

  • #16078 fix "View Mir", "View Hir" and "Interpret function" when the caret is inside a macro.

  • #16039 don't emit missing items diagnostic for negative impls.

  • #16045 fix panic with closure inside array length.

  • #16055 fall back to method resolution on unresolved field access.

Internal Improvements

  • #16036 (first contribution) make ParamLoweringMode accessible.
  • #15986 use triomphe::Arc::from_iter.
  • #16042 bump salsa.
  • #16022 don't explicitly warn against semicolon_in_expressions_from_macros.
  • #16038 publish lsp-server 0.7.5.
  • #16043 bump and unlock some dependencies.

See also the changelog post.

2023-12-04

04 Dec 06:49
Compare
Choose a tag to compare

Changelog #210

Commit: e402c49
Release: 2023-12-04 (v0.3.1756)

New Features

  • #15879 implement completion for callable fields:

    Screenshot showing a struct field of fn() type in the completion results

  • #16000 initial support for implicit drop inlay hints (rust-analyzer.inlayHints.implicitDrops.enable):

    Screenshot showing drop(var) inlay hints when var is dropped

Fixes

  • #15961 (first contribution) improve error handling for top-level let statements.
  • #15993 (first contribution) use package root as working directory when launching the debugger.
  • #15970 fix variant resolution through for type aliases.
  • #15994 report error on comma after base struct functional update syntax.
  • #15857 fix spacing after using "Remove redundant parentheses".
  • #15971 don't report missing match arms for empty match body.

Internal Improvements

  • #15946 (first contribution) simplify workspace de-duplication.
  • #15985 bump triomphe.
  • #15912 remove unused PhantomData.

See also the changelog post.

2023-11-27

27 Nov 06:18
Compare
Choose a tag to compare

Changelog #209

Commit: 237712f
Release: 2023-11-27 (v0.3.1748)

New Features

  • #15956, #15962 (first contribution) improve completion label details display:

    Screenshot showing the completion label details like the originating trait for a method displayed in gray by VS Code

  • #15846 (first contribution) add VS Code option to suppress internal error notifications.

Fixes

  • #15940 ensure renames happen after edits.
  • #15911 handle default constant values in trait_impl_missing_assoc_item diagnostic.
  • #15825 better resolve associated item with type bound.
  • #15754 de-dup duplicate crates with differing origins in CrateGraph construction.

Internal Improvements

  • #15894 (first contribution) make LSP initialization cancellable.
  • #15944 (first contribution) update Arch Linux package URL.
  • #15921 use PathSegment::qualifying_trait.
  • #15960 replace option.map(cond) == Some(true) with option.is_some_and(cond).
  • #15967 switch to our own salsa fork.

See also the changelog post.

2023-11-20

20 Nov 06:53
Compare
Choose a tag to compare

Changelog #208

Commit: 255eed4
Release: 2023-11-20 (v0.3.1740)

New Features

  • #15891 diagnose some orphan trait impl cases:

    Screenshot showing an error on impl Copy for String

  • #15895 diagnose missing associated items in trait impls:

    Screenshot showing an error on a trait implementation with a missing associated const value

  • #15893 diagnose incorrect unsafety for trait impls:

    Screenshot showing an error on a safe trait implementation of an unsafe trait, and on an unsafe implementation of a safe trait

Fixes

  • #15901 diagnose everything in nested items.
  • #15903 make line! and column! expand to literals.

Internal Improvements

  • #15875 fix PathSegment grammar.
  • #15899, #15917 sync from downstream.
  • #15874 migrate assists to the structured snippet API, part 4.
  • #15925 remove debugging code in path resolution.
  • #15902, #15913 bump some deps.
  • #15830 VS Code: expose workspaces to other extensions, remove addProject command.
  • #15900 disable VSIX builds for win32-ia32, which VS Code no longer supports.
  • #15904 bump minimum supported VS Code to 1.78.

See also the changelog post.