Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb/dap: stop setting CompletionItem.length
@ 2026-08-01 16:02 Oleg Tolmatcev
  2026-08-21 15:49 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Tolmatcev @ 2026-08-01 16:02 UTC (permalink / raw)
  To: gdb-patches; +Cc: Oleg Tolmatcev

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-21 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-01 16:02 [PATCH] gdb/dap: stop setting CompletionItem.length Oleg Tolmatcev
2026-08-21 15:49 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox