gdb/dap: stop setting CompletionItem.length
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Test passed
|
Commit Message
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(-)
@@ -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}