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: Thu, 12 Dec 2024 08:30:05 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000293e7906290e8648" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6376"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74807@debbugs.gnu.org, felician.nemeth@gmail.com To: Troy Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 12 09:31:30 2024 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 1tLebZ-0001TP-Tx for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Dec 2024 09:31:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLebG-00066D-Q0; Thu, 12 Dec 2024 03:31:10 -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 1tLeb9-00065m-Ca for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 03:31:05 -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 1tLeb9-00035V-40 for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 03:31:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=/0eklhr7jwy4sbFPhYBI0reMHnz4KMr1KiSPJjSIpsg=; b=HjITwvLPPfjEeyOytqg3Qa+bKv5yf2a27ng/krFvuhp9qZpNroGune+TK6/wVMU5QIuoWFqnFbDRxYOX3IM/NjgnTrlL+O8lWlFIgzOlAjF4HZGUB5jeJCRmQITpYVFqsGnt9hnQxt0cHagYCtN7f223EgFcnYe0o0aUfO1CTK/jJWObapOuoaxFj/su8y4eIs71TV89t0BIXpR+ykINeBKkD2pJAYJ2ke0ayddOXmMvceY1etHVPuUPyaLj1MP9vMgGG8DYemULmI8r7V1B5y2WbZtjea99b9799mVKncY1K6qjlRrKgQcHR0K4nq1JJuadrAuaQ9/xaec+C1iT5w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLeb7-0007uI-Ts for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 03:31:01 -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: Thu, 12 Dec 2024 08:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74807 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: "simon254--- via Bug reports for GNU Emacs, the Swiss army knife of text editors" , Felician Nemeth Original-Received: via spool by submit@debbugs.gnu.org id=B.173399223230305 (code B ref -1); Thu, 12 Dec 2024 08:31:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Dec 2024 08:30:32 +0000 Original-Received: from localhost ([127.0.0.1]:37540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLeaa-0007sc-EH for submit@debbugs.gnu.org; Thu, 12 Dec 2024 03:30:31 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLeaY-0007sQ-3z for submit@debbugs.gnu.org; Thu, 12 Dec 2024 03:30:27 -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 1tLeaV-0005zv-RR for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 03:30:25 -0500 Original-Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLeaT-0002up-1K for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 03:30:22 -0500 Original-Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-29ff5c75c21so796786fac.0 for ; Thu, 12 Dec 2024 00:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733992217; x=1734597017; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/0eklhr7jwy4sbFPhYBI0reMHnz4KMr1KiSPJjSIpsg=; b=gsC6TBpXD/YUNXMUqs4VD55vHr6HkzKAJ881gmGENalztpHbwh5bEwtTpQobNoSCm3 Gu50HfVrW8gqD8Ue4Ww238/0EhAkqULJBrcVJraI7m5gQCDQKtPkP27Vj501cX9RA3Dz i0lGMkKZmLbiCxmB1oDyzpsbNb+iGy4hhwoqA6ZrebKRyVxvymUMD635jg1ZLkaiezFo zTCCK8tEJGRWN8bVIHAoWRxcXcLZtyhbb+CoeFioMq3oZqJyhvEZM8kSYxDn6lz/opxF cxLExTSYMhCRBWERQOLTY5ufJhYxn7K2zUjnJXZ+WJz07ZEcZjUrp9K71m46BHXQoq94 RCwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733992217; x=1734597017; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/0eklhr7jwy4sbFPhYBI0reMHnz4KMr1KiSPJjSIpsg=; b=vJEs2H0bUMitr0FpL+j0w07wxAClqbSpq4/5uwd+H7eku+VsYT6WUJqX1emIJtx+6T r7E4ht/DvpyYxM1YGBZn1AROMqQyX6LNoWqBK4RzvH6n3kzhaWiwqC1o3XCt8clF37mN CQOw+I2lBPXXtVPgyu5+5B0glSFhU5zG1GRgwJ8LjriyqaDM3JnnotvaX0izJrsO23/g wQqZPBsj+b/OYSAKsfFMDwy0YL+X4ZY3ixkrYXl9h0CQ/rCnv92bQgaVuSEozoJdMyc4 3sS1SSLFcUqH0cbfenHQEiSpWBJwceI0Sv8lxOPeswFXvte1HJhGjLYHKb1vxmnnbNhO La5Q== X-Gm-Message-State: AOJu0YwIXCmpkzXv8Qxr8fupljO90G0AN9IpMMi0Sl6KPK7wwLyMy2TT qNCkVA7qbci9UXvTj0cgEgjzLlhEGcPy3tJKXtBuB3laXlWrbQitx5zN3CfY/3F6nxp2JIo5D+W QCuE8sS0p/nnC0bh0FDxFoIzWq/A= X-Gm-Gg: ASbGncukdUOlrlcFxlOK20YjOrxOVCcrn5YAIy0Td5/0CSmLXb0x9k1dBgR0lrEcU5/ BjqCtUzZZCzJDDCp8ejRx/GszRwSJNlgJZ+hZlw== X-Google-Smtp-Source: AGHT+IF4PPARS5dWyul2Dky9KJszoIt5NxojJDCniBu53WQL6qMGmBJaK0uqQiQXSTsBepknFckSl4qnURx9uh8IcE8= X-Received: by 2002:a05:6870:148e:b0:297:2955:b009 with SMTP id 586e51a60fabf-2a3852f54ebmr1484487fac.1.1733992217391; Thu, 12 Dec 2024 00:30:17 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2001:4860:4864:20::34; envelope-from=joaotavora@gmail.com; helo=mail-oa1-x34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:296894 Archived-At: --000000000000293e7906290e8648 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please provide more of the eglot events log. Thanks, Jo=C3=A3o On Thu, Dec 12, 2024, 00:46 Troy Brown wrote: > 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. > > [jsonrpc] e[19:22:22.458] <-- completionItem/resolve[21] > > {"jsonrpc":"2.0","id":21,"result":{"label":"End_Of_Line","documentation":= "End > of line sequence: lf | crlf","data":["Format","End_Of_Line"]}} > > I believe this is because `eglot-completion-at-point` calls > `eglot--format-markup` for the documentation string provided in the > CompletionItem without first checking to see if it really should be > formatted (i.e., if it is a string it shouldn't be formatted). While > `eglot--format-markup` will handle strings, it should only be passed > strings which are intended to be markup formated (specified as > MarkedString in the specification). > > I believe this issue might affect more than just the documentation > string for CompletionItem, it's possible this also affects other > places which specify fields as "string | MarkupContent" (such as the > SignatureInformation documentation field). > --000000000000293e7906290e8648 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Please provide more of the eglot events log.=C2=A0

Thanks,=C2=A0
Jo=C3=A3o

On Thu, Dec 12, 2024, 00:46 Troy Brown <brownts@troybrown.dev> wrote:
I've run across a situati= on where Eglot receives a documentation
string as part of a "completionItem/resolve".=C2=A0 The documenta= tion is
being provided as a regular "string", not MarkupContent, yet it i= s
being rendered as markup.=C2=A0 Since the string contains characters which<= br> are being interpreted as markdown (e.g., ":"), it causes the
documentation to be rendered incorrectly.

[jsonrpc] e[19:22:22.458]=C2=A0 =C2=A0 =C2=A0<-- completionItem/resolve[= 21]
{"jsonrpc":"2.0","id":21,"result":{= "label":"End_Of_Line","documentation":"E= nd
of line sequence: lf | crlf","data":["Format",&quo= t;End_Of_Line"]}}

I believe this is because `eglot-completion-at-point` calls
`eglot--format-markup` for the documentation string provided in the
CompletionItem without first checking to see if it really should be
formatted (i.e., if it is a string it shouldn't be formatted).=C2=A0 Wh= ile
`eglot--format-markup` will handle strings, it should only be passed
strings which are intended to be markup formated (specified as
MarkedString in the specification).

I believe this issue might affect more than just the documentation
string for CompletionItem, it's possible this also affects other
places which specify fields as "string | MarkupContent" (such as = the
SignatureInformation documentation field).
--000000000000293e7906290e8648--