Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/dap: stop setting CompletionItem.length
Date: Sun, 13 Sep 2026 21:24:31 +0200	[thread overview]
Message-ID: <CACcXsZi1qGbcFhw3gHVkJr6qxkORT1N27R7KSyYjK25tZGLrbg@mail.gmail.com> (raw)
In-Reply-To: <87zeyfqxrb.fsf@tromey.com>

пт, 21 авг. 2026 г. в 17:49, Tom Tromey <tom@tromey.com>:
>
> >>>>> "Oleg" == Oleg Tolmatcev <oleg.tolmatcev@gmail.com> writes:
>
> Oleg> Do not set the CompletionItem.length field in completions responses.
> Oleg> According to the DAP spec, length says how many characters the
> Oleg> completion text should overwrite. It is not the length of the
> Oleg> completion label, so using the label length here is wrong.
>
> I am not so sure about this.
>
> The spec says:
>
>   /**
>    * Length determines how many characters are overwritten by the completion
>    * text and it is measured in UTF-16 code units. If missing the value 0 is
>    * assumed which results in the completion text being inserted.
>    */
>   length?: number;
>
>
> But IIUC the gdb 'completions' result will also include whatever prefix
> was supplied.
>
> So for instance I think if we try to complete "print" we might get
> results like "print_this" and "print_that".  But here we wouldn't want
> to report length=0, because wouldn't that mean "the completion text
> being inserted" would result in "printprint_this" and "printprint_that"?
>
> Tom

Sorry for the delayed reply. You are right, and I will send another
patch that properly fixes the problem.

Oleg

      reply	other threads:[~2026-09-13 19:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01 16:02 Oleg Tolmatcev
2026-08-21 15:49 ` Tom Tromey
2026-09-13 19:24   ` Oleg Tolmatcev [this message]

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=CACcXsZi1qGbcFhw3gHVkJr6qxkORT1N27R7KSyYjK25tZGLrbg@mail.gmail.com \
    --to=oleg.tolmatcev@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox