From: Tom Tromey <tom@tromey.com>
To: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/dap: stop setting CompletionItem.length
Date: Fri, 21 Aug 2026 09:49:44 -0600 [thread overview]
Message-ID: <87zeyfqxrb.fsf@tromey.com> (raw)
In-Reply-To: <20260801160233.79-2-oleg.tolmatcev@gmail.com> (Oleg Tolmatcev's message of "Sat, 1 Aug 2026 18:02:34 +0200")
>>>>> "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
prev parent reply other threads:[~2026-08-21 15:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 16:02 Oleg Tolmatcev
2026-08-21 15:49 ` Tom Tromey [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=87zeyfqxrb.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=oleg.tolmatcev@gmail.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