doomemacs / doomemacs/core

Opening multiple Rust files in a Cargo workspace spawns multiple language servers

Open
#4,070 48 comments 0 reactions 0 assignees View on GitHub
:lang rust :tools lsp status:waiting workaround
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

**What did you expect to happen?**
Opening multiple Rust files in separate crates in a Cargo workspace should use the same instance of rust-analyzer.

**What actually happened?**
A new rust-analyzer process is spawned for each file.

**Additional details:**
N/A

**Steps to reproduce:**
- Install `rust-analyzer` on your path.
- Install `lsp` module and enable `+lsp` flag on `rust` module.
- Create a [Cargo workspace](https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html) with multiple crates inside.
- Add the Cargo workspace as a known project (`SPC-p-a`) and switch to it.
- Open multiple files from those crates.

**System information:**

```
SYSTEM type gnu/linux
config x86_64-pc-linux-gnu
shell /bin/zsh
uname Linux 5.8.11-1-MANJARO #1 SMP PREEMPT Wed Sep 23 14:35:40 UTC 2020 x86_64
path (~/.local/bin /usr/local/bin /usr/local/sbin /usr/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /usr/lib/emacs/27.1/x86_64-pc-linux-gnu)
EMACS dir ~/.emacs.d/
version 27.1
build Aug 28, 2020
buildopts --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
features XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
traits (server-running)
DOOM dir ~/Projects/dotfiles/.doom.d/
version 2.0.9
build grafted, HEAD -> develop, origin/develop, origin/HEAD 7833cee 2020-10-09 18:34:14 -0400
elc-files 0
modules (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo ligatures modeline neotree ophints (popup +defaults) vc-gutter vi-tilde-fringe workspaces zen :editor (evil +everywhere) file-templates fold snippets :emacs dired electric undo vc :term eshell :checkers syntax :tools (eval +overlay) lookup lsp magit :lang emacs-lisp (gdscript +lsp) markdown org (rust +lsp) sh :config (default +bindings +smartparens))
packages (n/a)
unpin (n/a)
elpa (n/a)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.