From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#74807: 30.0.90; Eglot: Non-Markdown strings rendered as Markdown Date: Mon, 06 Jan 2025 11:56:09 +0000 Message-ID: <87bjwkkvfq.fsf@gmail.com> References: <86y100t6i7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34844"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: felician.nemeth@gmail.com, Troy Brown , 74807@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 06 12:57:25 2025 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 1tUljZ-0008sn-DE for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 12:57:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUljL-0005Ek-DU; Mon, 06 Jan 2025 06:57:11 -0500 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 1tUljC-0005EV-Vb for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 06:57:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUljC-0006l3-Ic for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 06:57:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=1ssOHfdkx7fcruPuvTin6I/aS2J82873oydrQ2NPoDs=; b=Y+bGA74VbT8y2sZxjpyvrXy3mw6W3gKKrvzwiAOHhDOJVN2bp+tIn2U0z9tsYBdXjEgHsN37LaATtryl9uyGu058xQq+43p6sNxhcIvZqH+jKmK9K1MOQTWHei6DYET7SQ8ITJM0zhCBbEdF06YM7RgMmjS2bt3I267/Hi60I2aGjC6M9FK6rx3B5L7owE6ldRHiGV6m/6v2W7WOS8l/h7zhgL+mcQAZ2tmzduOQLUljw8DBsp0rBmd0RI+9tWPijhfht7wXaKHyPS6DdcyY5kx2jSFjdAaWKHHr6cL8HW+dKafw1trhZee4kEoo5c5cfKSh7KCO3h6LsR8HxbM4Sw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUljC-0007qA-Ch for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 06:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2025 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74807 X-GNU-PR-Package: emacs Original-Received: via spool by 74807-submit@debbugs.gnu.org id=B74807.173616457430066 (code B ref 74807); Mon, 06 Jan 2025 11:57:02 +0000 Original-Received: (at 74807) by debbugs.gnu.org; 6 Jan 2025 11:56:14 +0000 Original-Received: from localhost ([127.0.0.1]:37035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUliQ-0007or-4Q for submit@debbugs.gnu.org; Mon, 06 Jan 2025 06:56:14 -0500 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:60757) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tUliN-0007oV-Lq for 74807@debbugs.gnu.org; Mon, 06 Jan 2025 06:56:12 -0500 Original-Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4361f664af5so162766065e9.1 for <74807@debbugs.gnu.org>; Mon, 06 Jan 2025 03:56:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736164565; x=1736769365; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1ssOHfdkx7fcruPuvTin6I/aS2J82873oydrQ2NPoDs=; b=BYwwrcAindKBfe5FljZBx8cuEb/KB1o9b3uSqJ5sIqVdDDkyRNKtZYKaIRdG5KH9hd Y9M4SJUMV5u1/+RgrU/Snl/pmheMXRhYXLCoxVZAUCJAa2lw8sha8GwjuOwOywH50D3E +CU+kviH5XmUuGm3KuTqAKT4YhRNfqn5Etw8aQK+m7SdwXNmPxAizPLgX179ePxoDDeS tX4PLS9lwdcnY9UrxWlH/1E4N3HnG/jWGxqnzvQtPR1gS63l864p03bGSXhCxR+GJ6bR 3E3L9przGkMRZ+Se1F1Dn6GYiEPE00xmEgyI2Ecinkd7BeX11DDw1vkyomwQreyqTssC EGGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736164565; x=1736769365; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1ssOHfdkx7fcruPuvTin6I/aS2J82873oydrQ2NPoDs=; b=Oh9tBTF0I+sGugU+JQo18gaENC2stexpBYJOwDCpZZtOuZ6yKrH0iI6xa1xP+qgzFe gVgaP4Qnr32YfSRSSVhe8VR5+FbTpjVCkzDH9kYNES7PlKA4KCnHV8edErciC+u3kDGb LMqW0SJw6qDCL0hdrLcudVyRa3bWAAUTeHkessfTOiEnositan6l1y/oE06wLeil1V8l W4p0Qi3np1kht06Q1BfiObQR3GQY/N5HbSLobNFQugrZQ3j86Wc21kcuOJvL/xSKgffk SgvUgBABXFEfkKyJPdlTKun8t/jhqUj6E6KvMi/VOmJ5tPRXHS3pKWOpOzKhJGOAaBxk uGww== X-Forwarded-Encrypted: i=1; AJvYcCXnqR7G33Bk1eBlFDfgjDJqRlKUWWlWgR8+wesqKoUVqSbJC3xipg8zY8wkuDKa58ndnrX0OQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzLHM4d9b4OZBf3axjwouCKZMkDkJRbIefnuy4EH7+aUS83DJed 15eYehkJF7WL/zrFjyL+V7L/sSxkZ+zLdZUZGtxWS3/Sh3K2v2wF8qOaZQ== X-Gm-Gg: ASbGnctMg8u1l1HVhqjjxI7fB73puRiq264pMPupyGcpzoj+gOQVBoCvHRPjDblPk67 8fOYsAzEhDYVvDNLLDZ8GcZdSTobKso/IZJnS03dZF/bEJQIi2J6DG8NSozp+hFUcprv59IRIp+ 56Kyd1OfImBb52K9m8vk6Fp2YYP5IwfPfVdJRGo6vGLP7aUN6I8gPzWuS1cQxH5HaE/HhGQTQ/V w94yiqOgJTg4E1Us4BkJc/fK6GyMaP7Tty6F5NOcwe+19o= X-Google-Smtp-Source: AGHT+IGBxh3BY/q5nNJDQFgU68BL6bPBvAFeVz9cEdKu34/CtI8cC1JAuXkZHlmN5XOFmmTZes7doA== X-Received: by 2002:a05:600c:3b92:b0:434:a202:7a0d with SMTP id 5b1f17b1804b1-436ac71fa3fmr205643565e9.22.1736164565038; Mon, 06 Jan 2025 03:56:05 -0800 (PST) Original-Received: from krug ([62.28.172.234]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436611fc762sm563663505e9.11.2025.01.06.03.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 03:56:04 -0800 (PST) In-Reply-To: <86y100t6i7.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Dec 2024 13:02:40 +0200") 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:298647 Archived-At: Eli Zaretskii writes: > Ping! Can we make some progress here, please? >> [jsonrpc] e[08:23:09.518] --> textDocument/hover[13] >> {"jsonrpc":"2.0","id":13,"method":"textDocument/hover","params":{"textDo= cument":{"uri":"file:///home/troy/junk/hello_world.gpr"},"position":{"line"= :4,"character":21}}} >> [jsonrpc] e[08:23:09.531] <-- textDocument/hover[13] >> {"jsonrpc":"2.0","id":13,"result":null} Hello Troy, I've finally had time to look at your bug report. > I've run across a situation where Eglot receives a documentation > string as part of a "completionItem/resolve". The documentation is > being provided as a regular "string", not MarkupContent, yet it is > being rendered as markup. Since the string contains characters which > are being interpreted as markdown (e.g., ":"), it causes the > documentation to be rendered incorrectly. After perusing the spec, I'm not sure the simple strings cannot be rendered as Markdown by the client. The spec doesn't seem to disambiguate this. All it says about the documentation field of a Completion structure, besides its polymorphic type, is that it is a /** * A human-readable string that represents a doc-comment. */ documentation?: string | MarkupContent; Anyway I think if the server wants to ensure something is _not_ rendered as Markdown it should use the more advanced MarkupContent structure and explicitly specify 'plaintext' in its MarkupKind field. I understand this sounds counter-intuitive, but I have to be very careful to do these kinds of changes. As you know, Eglot works with a large body of servers, and I wouldn't be at all surprised that some of those servers (or, more importantly, regulat users of those servers) do actually expect plain strings to be rendered as Markdown when such a renderer is available. Lastly, and adding to my reluctance to address this in code, I don't understand what ':' is tripping the renderer here. Last I checked, ':' doesn't have any special meaning in Markdown, especially in the middle of the sequence. Emacs's `markdown-view-mode` from the markdown.el package does give the left and right parts of: Indentation kind: spaces | tabs a different face (I don't know why, the online renderers I've tried do not do that). But I wouldn't say it is being rendered "incorrectly". Anyway, I lean strongly towards not touching this. Jo=C3=A3o