Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
To: gdb-patches@sourceware.org
Cc: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
Subject: [PATCH] gdb/dap: stop setting CompletionItem.length
Date: Sat,  1 Aug 2026 18:02:34 +0200	[thread overview]
Message-ID: <20260801160233.79-2-oleg.tolmatcev@gmail.com> (raw)

Do not set the CompletionItem.length field in completions responses.
According to the DAP spec, length says how many characters the
completion text should overwrite. It is not the length of the
completion label, so using the label length here is wrong.
---
 gdb/python/lib/gdb/dap/completions.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/python/lib/gdb/dap/completions.py b/gdb/python/lib/gdb/dap/completions.py
index 5cc6e025ee5..fb8f078d046 100644
--- a/gdb/python/lib/gdb/dap/completions.py
+++ b/gdb/python/lib/gdb/dap/completions.py
@@ -49,7 +49,7 @@ def completions(
     completion = None
     if "completion" in mi_result:
         completion = mi_result["completion"]
-        result.append({"label": completion, "length": len(completion)})
+        result.append({"label": completion})
     # If `-complete' finds one match then `completion' and `matches'
     # will contain the same one match.
     if (
@@ -59,5 +59,5 @@ def completions(
     ):
         return {"targets": result}
     for match in mi_result["matches"]:
-        result.append({"label": match, "length": len(match)})
+        result.append({"label": match})
     return {"targets": result}
-- 
2.55.0.windows.1


             reply	other threads:[~2026-08-01 16:03 UTC|newest]

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

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=20260801160233.79-2-oleg.tolmatcev@gmail.com \
    --to=oleg.tolmatcev@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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