emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.72k stars 860 forks source link

rust types displayed in minibuffer are truncated #4437

Open Ngoguey42 opened 2 months ago

Ngoguey42 commented 2 months ago

Thank you for the bug report

Bug description

Putting the cursor on a rust variable shows the type in the minibuffer: image

Recently this stopped working correctly for some types: image

When I run lsp-describe-thing-at-point on this problematic type I see 2 lines: image

My understanding is that only the first line is shown in the minibuffer.

Steps to reproduce

  1. cargo init --name main to create a dummy project

  2. open main.rs with emacs

  3. answer i to the prompt that offers to import the project root

  4. Add an let i = 0; line in the code.

  5. Put the cursor on i and witness the problem in the minibuffer

Expected behavior

The type of the variable should be shown

Which Language Server did you use?

emacs

GNU Emacs 29.3

RA

rust-analyzer 0.3.1932-standalone (47a901b9b 2024-04-21)

lsp-mode
commit f2b9ab5e2b64a996ca093206a2adf54c578febc2 (HEAD, origin/master, origin/HEAD)
Author: Muir Manders <muir@mnd.rs>
Date:   Sun Apr 21 20:34:08 2024 -0700
    Co-authored-by: Muir Manders <muirdm@fb.com>

OS

MacOS

Error callstack

No response

Anything else?

No response

Ngoguey42 commented 2 months ago

I was able to mitigate this problem using (setq lsp-eldoc-render-all t)

gagbo commented 1 month ago

It’s probably part of this PR/discussion https://github.com/emacs-lsp/lsp-mode/pull/1740, which iirc didn’t get merged because the parsing/matching was too brittle and dependant on RA unspecified implementations that could change version to version