Subject: bug#77856: 31.0.50; Add markdown-ts-mode support to eglot/eldoc

From: Rahul Martim Juliato <[email-masked]>
Date: Tue, 22 Apr 2025 20:54:06 -0300

João Távora <[email-masked]> writes:

> I'm interested in adding markdown-ts-mode support to Eglot (not only to
> the Eglot->Eldoc interface but potentially also to the Eglot->Company
> interface).
>
> So a patch is welcome.  There is already a customization option
> eglot-prefer-plaintext so no additional opt-in/out logic is required or
> desired.  If that variable is nil the order should be:
>

Thanks for your support João!

I'm gently and slowly tapping into it.

I noticed some recent changes on flymake and eglot though, It looks like
Eldoc started failing me when using it with Eglot.

To reproduce:

Create a =test.ts= file with the content:

#+BEGIN_SRC typescript
  const xxx = 1 ++ 2;
#+END_SRC

Start Emacs compiled from master with:

#+BEGIN_SRC bash
emacs -Q test.ts \
  --eval "(progn \
    (typescript-ts-mode) \
    (setq flymake-show-diagnostics-at-end-of-line t) \
    (eglot-ensure))"
#+END_SRC

Both 1 and 2 are correctly marked with errors, the flymake inline
diagnostic also correctly prints the error inside the buffer.

Problem is that when I position my cursor over the error, or try to run
=flymake-show-buffer-diagnostics=, I always get an error like:

#+BEGIN_SRC bash
flymake--tabulated-setup-1: Wrong type argument: listp, 2357
eldoc error: (wrong-type-argument sequencep 2357)
#+END_SRC

This wasn't the case with my last week build, where eldoc was properly
showing documentation.

-- 

Rahul Martim Juliato