emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62687: closed (30.0.50; Eglot (eglot--sig-info): SignatureInformatio


From: GNU bug Tracking System
Subject: bug#62687: closed (30.0.50; Eglot (eglot--sig-info): SignatureInformation's Documentation is never shown when it's of type MarkupContent)
Date: Tue, 11 Apr 2023 11:15:02 +0000

Your message dated Tue, 11 Apr 2023 12:16:49 +0100
with message-id <87a5zemzxa.fsf@gmail.com>
and subject line Re: bug#62687: [PATCH] Eglot: eglot--sig-info: Show SigInfo 
Docs if Markup; fix regex for highlighting; etc
has caused the debbugs.gnu.org bug report #62687,
regarding 30.0.50; Eglot (eglot--sig-info): SignatureInformation's 
Documentation is never shown when it's of type MarkupContent
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
62687: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62687
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; Eglot (eglot--sig-info): SignatureInformation's Documentation is never shown when it's of type MarkupContent Date: Wed, 05 Apr 2023 21:17:24 +0000
What's the problem?

When you enable eglot-mode from Eglot 1.14; when it then successfully
connects to a language server; when you then move the cursor to
"something callable", Eglot is supposed to show the Documentation from the SignatureInformation, as specified in the language server protocol. This SignatureInformation's Documentation can either be of type string,
or of type MarkupContent [1]. Eglot will never show it, if it's of
latter type.

Why does this happen?

You enable eglot-mode. Eglot successfully connects to a language server.
Eglot enables eldoc-mode. When you move the cursor, the function
`eglot-signature-eldoc-function' is called because it's a member of
`eldoc-documentation-functions'. This function,
`eglot-signature-eldoc-function`, calls `eglot--sig-info'. That function
will only show the documentation if it's of type string [2].

--8<---------------cut here---------------start------------->8---
;; Decide whether to add one-line-summary to signature line
       (when (and (stringp documentation)
                  (string-match "[[:space:]]*\\([^.\r\n]+[.]?\\)"
                                documentation))
         (setq documentation (match-string 1 documentation))
(unless (string-prefix-p (string-trim documentation) label)
           (goto-char (point-max))
           (insert ": " (eglot--format-markup documentation))))
--8<---------------cut here---------------end--------------->8---


How to see this happen?

Install GNU Emacs from master-branch; use any commit after "Eglot: Bump to 1.14" 8125d4cfc5605ead9102b7d823c4241029eb76cc. You might need to build with tree-sitter and install a tree-sitter grammar for typescript, so that you can use `typescript-ts-mode' because Emacs
   has no other mode for typescript.

   Install Git and Node.js, including NPM.

   Install typescript-language-server:
       npm install --global typescript-language-server

   Clone the minimal-reproducing-example:
git clone https://github.com/mekeor/emacs-eglot-minimal-reproducing-example
       cd emacs-eglot-minimal-reproducing-example

   Install the project dependencies:
       npm install

   Open source file with Emacs:
       emacs ./main.ts

   In Emacs, type:
       M-x typescript-ts-mode RET
       M-x eglot RET
       C-3 C-5 C-2 C-f

In the echo-area, you will see the type signature of the function
   "fastify.addHook", but there will be no documentation:
       

Attachment: 2023-04-06-000337_496x610_scrot.png
Description: PNG image



[1] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation

[2] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/eglot.el?id=fa669c4b17c04eff852eb23a6179ccb8fab864db#n3132
--- End Message ---
--- Begin Message --- Subject: Re: bug#62687: [PATCH] Eglot: eglot--sig-info: Show SigInfo Docs if Markup; fix regex for highlighting; etc Date: Tue, 11 Apr 2023 12:16:49 +0100 User-agent: Gnus/5.13 (Gnus v5.13)
Mekeor Melire <mekeor@posteo.de> writes:

> Also, I never claimed that the problem, that your last commit
> introduced, was related to user-visible behavior.

OK, that's really what I and Eglot users are mostly interested in.

> Decide yourself how you want to proceed. 

I'll close this bug.  The problem reported is fixed and I can't discern
any others.  Your remarks are noted here for posterity.

I saw your patch, but I don't think it has any effect on efficiency.  If
you think otherwise, report it in another bug, and I'd prefer if it is
accompanied with some kind of reproducible performance measurement in
addition to the list of things requested in the Troubleshooting page I
linked to earlier.

My best and friendly regards,
João


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]