From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mekeor Melire Newsgroups: gmane.emacs.bugs Subject: bug#62687: 30.0.50; Eglot (eglot--sig-info): SignatureInformation's Documentation is never shown when it's of type MarkupContent Date: Thu, 06 Apr 2023 19:21:31 +0000 Message-ID: <871qkwolez.fsf@posteo.de> References: <875yaanfuv.fsf@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39945"; mail-complaints-to="usenet@ciao.gmane.io" Cc: joaotavora@gmail.com To: 62687@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 21:36:38 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pkVPS-000AEN-27 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 21:36:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkVOu-0006U3-HX; Thu, 06 Apr 2023 15:36:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkVOs-0006Tf-Hf for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkVOs-0007fX-6q for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkVOr-0007k9-Oh for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mekeor Melire Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 19:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62687 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168080973829705 (code B ref -1); Thu, 06 Apr 2023 19:36:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Apr 2023 19:35:38 +0000 Original-Received: from localhost ([127.0.0.1]:55211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkVOU-0007j3-01 for submit@debbugs.gnu.org; Thu, 06 Apr 2023 15:35:38 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:40274) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkVOS-0007iw-OE for submit@debbugs.gnu.org; Thu, 06 Apr 2023 15:35:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkVOS-0006RE-H5 for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:35:36 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkVOJ-0007IG-8A for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 15:35:36 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C62FB2401C4 for ; Thu, 6 Apr 2023 21:35:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1680809723; bh=rxGy+WduZQuZs5y3lgJy96kNWzZkBbuLsklgi8ThJ+k=; h=From:To:Cc:Subject:Date:From; b=E2tZ8/NHkx27UrsP/0BL87zC3bpKoBTAjnqb5uGww1F0eQmSp2g+LTnaNiEyFLrqd BD196hX3qiclrwNMak6iefjjHVT4R+cWKiJLT7P+D9VeQNWn6MwFI9H+M7mqLmx69I zXdoiHHLw7coBygf5BFcigcllCYdDDQIWd7zDZ+g9GgkuZVPikAosDy/6+rgIpEBnt krliKKGy9U+pnOZgsJfvURMC9VyIxAnJCoO7+XO5oUDmi/ikv/6baQuIvMRUm3LIfB uGL/TUV/zVeut3MhFGoPq82g5/mYB5PAxNEPpJCM8eDn9BC53j2Q6OTK9vSGY6zHR+ Itq4/UZ9KIbJA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PssCt74Mfz9rxM; Thu, 6 Apr 2023 21:35:22 +0200 (CEST) In-reply-to: <875yaanfuv.fsf@posteo.de> Received-SPF: pass client-ip=185.67.36.65; envelope-from=mekeor@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259353 Archived-At: Sorry for the bad formatting of my bug report. Let me try to send the same content a second time, hopefully with better line wrapping. 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? 1. 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. 2. Install Git and Node.js, including NPM. 3. Install typescript-language-server: npm install --global typescript-language-server 4. Clone the minimal-reproducing-example: git clone https://github.com/mekeor/emacs-eglot-minimal-reproducing-example; cd emacs-eglot-minimal-reproducing-example 5. Install the project dependencies: npm install 6. Open source file with Emacs: emacs ./main.ts 7. In Emacs, type: M-x typescript-ts-mode RET M-x eglot RET C-3 C-5 C-2 C-f 8. In the echo-area, you will see the type signature of the function "fastify.addHook", but there will be no documentation; see the attached screenshot. [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