doomemacs / doomemacs/core

Rust files opened via `magit-find-file` seem to be sent to the underlying server

Open
#6,144 0 comments 0 reactions 0 assignees View on GitHub
:tools lsp :tools magit is:bug
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?

I'd expect that opening an older revision of a Rust file via `M-x magit-find-file` will show me a buffer with the older contents, but won't actually send those older contents to the underlying LSP server.

(as far as I've checked, this works correctly for C++, so it might be specific either to rustic-mode or Doom's integration with rustic-mode.)

### What actually happened?

Opening an older revision of a Rust file sends that older revision to the underlying LSP server, which then thinks the file got replaced with new contents; this, in turn, messes up inlay hints etc. for the original buffer.

### Describe your attempts to resolve the issue

I've tried debugging the issue, but there seem to be too many moving parts for me to grasp it with my current elisp knowledge 😅

I've also tried reporting the issue to lsp-mode - https://github.com/emacs-lsp/lsp-mode/issues/3233 - and it was eventually doomed that lsp-mode does the correct thing, leaving either rustic-mode or doom-emacs at fault.

### Steps to reproduce

1. Open a Rust code repository,
1. Open some Rust file,
1. Use `M-x magit-find-file` to preview the older revision of that file,
1. See how annotations (e.g. type hints) in the original buffer end up in wrong, seemingly random places.

### System Information

https://pastebin.com/MPTK5x72

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.