Subject: Re: 30.0.50; Eglot inlay hints "pile up"
From: João Távora <[email-masked]>
To: Chinmay Dalal <[email-masked]>
Cc: [email-masked]
Date: Mon, 27 Feb 2023 14:33:07 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Chinmay Dalal <[email-masked]> writes:

> Chinmay Dalal <[email-masked]> writes:
>
>> Eglot inlay hints pile up when scrolling a large file.
>> To reproduce
>> 1) Open a large rust file with rust-analyzer installed
>>   (I tried to reproduce this with C++/clangd but I couldn't, maybe
>>   because it has less no. of hints)
>> 2) Scroll around
>> 3) Look for duplicate hints

I've reproduced this.  This is rust-analyzer's fault.  We ask it for
hints in some region, and it happily returns hints outside that.

Reported this in https://github.com/rust-lang/rust-analyzer/issues/14215

   (:jsonrpc "2.0" :id 216 :method "textDocument/inlayHint" :params
             (:textDocument
              (:uri "file:///home/capitaomorte/Source/Rust/bevy/crates/bevy_animation/src/lib.rs")
              :range
              (:start
               (:line 187 :character 0)
               :end
               (:line 238 :character 31))))
   [server-reply] (id:216) Mon Feb 27 14:11:25 2023:
   (:jsonrpc "2.0" :id 216 :result
             [(:position
               (:line 294 :character 1)
               :label
               [(:value "fn animation_player" :location
                        (:uri "file:///home/capitaomorte/Source/Rust/bevy/crates/bevy_animation/src/lib.rs" :range
                              (:start
                               (:line 185 :character 7)
                               :end
                               (:line 185 :character 23))))]

Easy to fix on Eglot's side though, so pushed a fix to emacs-29 and closing.

João