GNU bug report logs - #64099
Emacs 29 - Eglot hint display issue on macOS

Previous Next

Package: emacs;

Reported by: Milan Jovanovic <milanj <at> gmail.com>

Date: Fri, 16 Jun 2023 05:57:02 UTC

Severity: normal

To reply to this bug, email your comments to 64099 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64099; Package emacs. (Fri, 16 Jun 2023 05:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Milan Jovanovic <milanj <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 16 Jun 2023 05:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Milan Jovanovic <milanj <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs 29 - Eglot hint display issue on macOS
Date: Thu, 15 Jun 2023 18:41:14 +0200
[Message part 1 (text/plain, inline)]
Hi all,

There is an issue with how Eglot inlay hints are being printed on the macOS
(both Intel and apple silicon).
I've tried on Linux with the same versions and it works fine.

Example of broken inlay hints:
https://user-images.githubusercontent.com/3064500/245880108-a4f43db5-7ebb-43e6-8031-ebb403ee94b3.png

How to reproduce:
1. install Emacs 29 from https://emacsformacosx.com or via brew
https://github.com/d12frosted/homebrew-emacs-plus

2. install rustup/rustc/cargo/rust-analyzer - https://rustup.rs
   # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
   `rustup component add rust-analyzer`

3.  create rust project
   # cargo new inlay-hints


copy this code to inlay-hints/src/main.rs
==================================
use std::error::Error;

struct Foo {}

struct Bar {}

type MyResult = Result<Foo, (Bar, String, Box<dyn Error + Send>)>;

fn get_vec_results() -> Vec<MyResult> {
    todo!()
}

fn main() {
    for result in get_vec_results() {
        match result {
            Ok(res) => todo!(),
            Err(err) => todo!(),
        }
    }
}

==================================

4. open Emacs (no .emacs and no .emacs.d)
   # cd inlay-hints
   # /Applications/Emacs.app/Contents/MacOS/Emacs -Q src/main.rs -f
rust-ts-mode -f eglot
      choose/type 'rust-analyzer' as the server


------------------------------------------------------------------------------
My Emacs:

system-configuration-options:
"--with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules --with-x-toolkit=no"

ELISP> system-configuration-features
"ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG
RSVG THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB"



P.S. I'm seeing the same thing with Emacs 28
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64099; Package emacs. (Wed, 21 Jun 2023 20:19:01 GMT) Full text and rfc822 format available.

Message #8 received at 64099 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: Milan Jovanovic <milanj <at> gmail.com>
Cc: 64099 <at> debbugs.gnu.org
Subject: Re: bug#64099: Emacs 29 - Eglot hint display issue on macOS
Date: Wed, 21 Jun 2023 22:17:51 +0200
Milan Jovanovic <milanj <at> gmail.com> writes:

> Hi all,
>
> There is an issue with how Eglot inlay hints are being printed on the macOS
> (both Intel and apple silicon).
> I've tried on Linux with the same versions and it works fine.
>
> Example of broken inlay hints:
> https://user-images.githubusercontent.com/3064500/245880108-a4f43db5-7ebb-43e6-8031-ebb403ee94b3.png
>
> How to reproduce:
> 1. install Emacs 29 from https://emacsformacosx.com or via brew
> https://github.com/d12frosted/homebrew-emacs-plus
>
> 2. install rustup/rustc/cargo/rust-analyzer - https://rustup.rs
>    # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
>    `rustup component add rust-analyzer`
>
> 3.  create rust project
>    # cargo new inlay-hints
>
>
> copy this code to inlay-hints/src/main.rs
> ==================================
> use std::error::Error;
>
> struct Foo {}
>
> struct Bar {}
>
> type MyResult = Result<Foo, (Bar, String, Box<dyn Error + Send>)>;
>
> fn get_vec_results() -> Vec<MyResult> {
>     todo!()
> }
>
> fn main() {
>     for result in get_vec_results() {
>         match result {
>             Ok(res) => todo!(),
>             Err(err) => todo!(),
>         }
>     }
> }
>
> ==================================
>
> 4. open Emacs (no .emacs and no .emacs.d)
>    # cd inlay-hints
>    # /Applications/Emacs.app/Contents/MacOS/Emacs -Q src/main.rs -f
> rust-ts-mode -f eglot
>       choose/type 'rust-analyzer' as the server
>
>
> ------------------------------------------------------------------------------
> My Emacs:
>
> system-configuration-options:
> "--with-ns '--enable-locallisppath=/Library/Application
> Support/Emacs/${version}/site-lisp:/Library/Application
> Support/Emacs/site-lisp' --with-modules --with-x-toolkit=no"
>
> ELISP> system-configuration-features
> "ACL GLIB GMP GNUTLS JPEG JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG
> RSVG THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER ZLIB"
>
>
>
> P.S. I'm seeing the same thing with Emacs 28

I can reproduce the issue with a build from https://emacsformacosx.com,
concretely:

29.0.91 (Build 21G217) of 2023-05-14

But I can't reproduce the issue if I build Emacs from the emacs-29
branch, concretely:

29.0.92 (Build 22A380) of 2023-06-21

It could be a bug related to how https://emacsformacosx.com packages
Emacs, but the fact that it also fails in another Emacs distro
(Emacs-plus), I'd say that this is probably a problem in Eglot that may
have been recently fixed.  Could you try an Emacs build from the tip of
the emacs-29 branch?




This bug report was last modified 1 year and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.