Changelog #140

Commit: 2b472f6
Release: 2022-08-01

An Update on Proc Macros

Rust toolchains newer than 2022-07-29 contain a proc macro server that should be compatible with macros built by the matching compiler. Since today’s release, the server is automatically detected by and used rust-analyzer. This means that, from now on, proc macros will keep working when the proc_macro crate changes.

For more details, you can read @fasterthanlime’s blog post.

New Features

  • #12864, #12881 resolve derive helper attributes in IDE layer:

    180647125 98cae13b a7b4 446b 8a64 fae014f982e2
    180642110 699bdc73 e1f3 4692 94f2 21544f824ab9
  • #12858, #12878 add rust-analyzer-proc-macro-srv binary and use it if found in sysroot.

  • #12856 spawn a proc-macro-srv instance per Cargo workspace.


  • #12877 (first contribution) insert whitespace when inlining a function defined in a macro.

  • #12886 cache the resulting file in Semantics::original_ast_node.

  • #12887 don’t duplicate existing &mut in completions.

  • #12895 compte completions after type anchors.

  • #12830 insert references in the correct position in macros.

  • #12898 don’t add unnecessary brackets in pattern completions.

  • #12899 offer completions in path qualifier position.

  • #12901 don’t complete marker traits in expression position.

  • #12906 complete paths of existing record expressions.

  • #12913 fix highlight injection with doc comments.

  • #12891 increase stack size on macro expander thread.

Internal Improvements

  • #12890 assume condition/iterable is missing if there is only a BlockExpr in for and while loops.

  • #12902 sort ItemScope::entries results.

  • #12900 use cargo ws rename to rename crates for publishing.

  • #12903 only run rainbow highlighting test on 64-bit Unix.

  • #12904 be more explicit when filtering built-in completions.

  • #12915 update xtask promote and release instructions.

  • #12871 sync from rust-lang/rust.