all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Felician Nemeth <felician.nemeth@gmail.com>
To: Troy Brown <brownts@troybrown.dev>
Cc: 71353@debbugs.gnu.org
Subject: bug#71353: [PATCH] eglot--format-markup doesn't support MarkedString code-blocks
Date: Tue, 04 Jun 2024 13:21:55 +0200	[thread overview]
Message-ID: <87zfs1j6lo.fsf@betli.tmit.bme.hu> (raw)
In-Reply-To: <CABvCZ43H7DUmwg=zF7fJ-VbWSNhoa54dVK+tKryCnrgRTsWnYg@mail.gmail.com> (Troy Brown's message of "Tue, 4 Jun 2024 06:01:05 -0400")

Troy Brown <brownts@troybrown.dev> writes:

> On Tue, Jun 4, 2024 at 1:42 AM Felician Nemeth
> <felician.nemeth@gmail.com> wrote:
>>
>> According to the LSP specification, if MarkedString is "{ language:
>> string; value: string }", then it should be interpreted as this markdown
>> formatted string:
>>
>> ```${language}
>> ${value}
>> ```

> Unless I'm mistaken, I believe it does implement that behavior if the
> language is markdown, plaintext or the same as the major mode.  

I don't think "markdown" is a valid markdown language.

For example, if a MarkedString is

    { "language": "c", "value": "printf(42);"}

then the LSP client should interpret it as this markdown-formatted text:

    ```c
    printf(42);
    ```

Whereas I think you argue that this MarkedString:

    { "language": "markdown", "value": "```c\nprintf(42);\n```"}

should be interpreted as this markdown-formatted text:

    ```c
    printf(42);
    ```

I beleive the second example is not in line with the LSP specification.

The patch, however, will format "printf(42);" according to the
major-mode of the current buffer, which is probably c-mode or something
similar.  So this part will usually work.

In any case, why not just turn a MarkedString into a markdown-formatted
text and give it gfm-view-mode?





  reply	other threads:[~2024-06-04 11:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04  2:51 bug#71353: [PATCH] eglot--format-markup doesn't support MarkedString code-blocks Troy Brown
2024-06-04  5:41 ` Felician Nemeth
2024-06-04 10:01   ` Troy Brown
2024-06-04 11:21     ` Felician Nemeth [this message]
2024-06-04 12:37       ` Troy Brown
2024-06-04 19:36         ` Felician Nemeth
2024-06-15  8:12           ` Eli Zaretskii
2024-06-15  9:37             ` João Távora
2024-06-15 12:36               ` Eli Zaretskii
2024-06-18 13:39                 ` João Távora
2024-07-01  3:28                   ` Troy Brown
2024-07-06  8:41                     ` Eli Zaretskii
2024-07-06  9:18                       ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zfs1j6lo.fsf@betli.tmit.bme.hu \
    --to=felician.nemeth@gmail.com \
    --cc=71353@debbugs.gnu.org \
    --cc=brownts@troybrown.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.