From 8cf74618f70a60a2d6814a336a2515c4eaefd6e7 Mon Sep 17 00:00:00 2001 From: Simon Ruggier Date: Fri, 27 Feb 2026 12:06:27 -0500 Subject: [PATCH 1/3] README: rejoin key tips list with the paragraph that follows it They were separated by commit 07ef231aa95911a839f12a0731c48c691bc5d258, but the flow is a bit clearer when the cargo.targetDir example block isn't in between. --- README.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 6bbd2b0c20d..1f892584071 100644 --- a/README.adoc +++ b/README.adoc @@ -83,6 +83,8 @@ NOTE: This section assumes you're already familiar with the prerequisites and en * When using Cargo's check/build/clippy commands, use `--all-targets` to make sure you're checking or building the test code, too. * Use https://rust-analyzer.github.io/book/configuration#cargo.targetDir[`cargo.targetDir`] to give rust-analyzer a target directory other than `./target` so it doesn't block you from running commands in the terminal. This uses extra disk space. +These are explained a bit more below, along with some common pitfalls. + .How to set `cargo.targetDir` in various editors [%collapsible] ==== @@ -97,8 +99,6 @@ cargo.targetDir = true ==== -These are explained a bit more below, along with some common pitfalls. - Here's an example workflow. Suppose you're working on some changes to the Nexus database model (`nexus-db-model` package, located at `nexus/db-model` from the root). While you're actively writing and checking code, you might run: ``` From 4b2f0fac7946cb108af7253d0ed0ece1cbeb4c58 Mon Sep 17 00:00:00 2001 From: Simon Ruggier Date: Fri, 27 Feb 2026 12:25:25 -0500 Subject: [PATCH 2/3] README: add two rust-analyzer configuration examples for Neovim users --- README.adoc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.adoc b/README.adoc index 1f892584071..9b350c1d2ef 100644 --- a/README.adoc +++ b/README.adoc @@ -95,6 +95,39 @@ These are explained a bit more below, along with some common pitfalls. [language-server.rust-analyzer.config] cargo.targetDir = true ---- +.Neovim (using rustaceanvim) +[source, lua] +---- +vim.g.rustaceanvim = { + server = { + default_settings = { + ['rust-analyzer'] = { + cargo = { + targetDir = true, + }, + }, + }, + }, +} +---- +.Neovim (using LazyVim): merge the following into custom.lua +[source, lua] +---- + { + "mrcjkb/rustaceanvim", + opts = { + server = { + default_settings = { + ["rust-analyzer"] = { + cargo = { + targetDir = true, + }, + }, + }, + }, + }, + }, +---- ==== From 9e464384f1cca02caaf8e3ebbc2894f02cb727fc Mon Sep 17 00:00:00 2001 From: Simon Ruggier Date: Wed, 4 Mar 2026 19:21:24 -0500 Subject: [PATCH 3/3] README: add a warning about rust-analyzer's memory usage --- README.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.adoc b/README.adoc index 9b350c1d2ef..c3e5731809d 100644 --- a/README.adoc +++ b/README.adoc @@ -81,6 +81,13 @@ NOTE: This section assumes you're already familiar with the prerequisites and en * Use `cargo check` when you just want to know if your code compiles. It's _much_ faster than `cargo build` or `cargo nextest run`. * When using Cargo's check/build/test/clippy commands, you can use the `-p PACKAGE` flag to only operate on a specific package. This often saves a lot of time for incremental builds. * When using Cargo's check/build/clippy commands, use `--all-targets` to make sure you're checking or building the test code, too. +* Beware of rust-analyzer's memory usage, which can easily be over 12 GB per + process. If you spawn multiple instances of it for this codebase, whether by + using multiple instances of vim, multiple editors, or some combination of + editors and coding agents, it's easy to accidentally overwhelm your system. + Consider using something like https://codeberg.org/p2502/lspmux[lspmux] (or + https://github.com/sunshowers/lspmux-rust-analyzer[sunshowers/lspmux-rust-analyzer]) + to prevent this from happening. * Use https://rust-analyzer.github.io/book/configuration#cargo.targetDir[`cargo.targetDir`] to give rust-analyzer a target directory other than `./target` so it doesn't block you from running commands in the terminal. This uses extra disk space. These are explained a bit more below, along with some common pitfalls.