[Lldb-commits] [PATCH] D82835: [lldb] Fix missing characters when autocompleting LLDB commands in REPL

2020-07-03 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3faec833760f: [lldb] Fix missing characters when 
autocompleting LLDB commands in REPL (authored by poya, committed by teemperor).

Changed prior to commit:
  https://reviews.llvm.org/D82835?vs=274322&id=275341#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82835/new/

https://reviews.llvm.org/D82835

Files:
  lldb/source/Expression/REPL.cpp


Index: lldb/source/Expression/REPL.cpp
===
--- lldb/source/Expression/REPL.cpp
+++ lldb/source/Expression/REPL.cpp
@@ -457,6 +457,10 @@
 debugger.GetCommandInterpreter().HandleCompletion(sub_request);
 StringList matches, descriptions;
 sub_result.GetMatches(matches);
+// Prepend command prefix that was excluded in the completion request.
+if (request.GetCursorIndex() == 0)
+  for (auto &match : matches)
+match.insert(0, 1, ':');
 sub_result.GetDescriptions(descriptions);
 request.AddCompletions(matches, descriptions);
 return;


Index: lldb/source/Expression/REPL.cpp
===
--- lldb/source/Expression/REPL.cpp
+++ lldb/source/Expression/REPL.cpp
@@ -457,6 +457,10 @@
 debugger.GetCommandInterpreter().HandleCompletion(sub_request);
 StringList matches, descriptions;
 sub_result.GetMatches(matches);
+// Prepend command prefix that was excluded in the completion request.
+if (request.GetCursorIndex() == 0)
+  for (auto &match : matches)
+match.insert(0, 1, ':');
 sub_result.GetDescriptions(descriptions);
 request.AddCompletions(matches, descriptions);
 return;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D82835: [lldb] Fix missing characters when autocompleting LLDB commands in REPL

2020-07-02 Thread Martin Svensson via Phabricator via lldb-commits
poya added a comment.

Don't believe I have the necessary permissions to land this myself, so would 
need some help to get this committed to the repo. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82835/new/

https://reviews.llvm.org/D82835



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D82835: [lldb] Fix missing characters when autocompleting LLDB commands in REPL

2020-06-30 Thread Martin Svensson via Phabricator via lldb-commits
poya marked an inline comment as done.
poya added inline comments.



Comment at: lldb/source/Expression/REPL.cpp:460
 sub_result.GetMatches(matches);
+// Prepend command prefix that was excluded in the completion request
+if (request.GetCursorIndex() == 0) {

teemperor wrote:
> Nit: Missing `.` at the end of the comment, but I'll fix that when landing.
Thanks, I wasn't sure about the convention since other comments in the same 
file had it both ways


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82835/new/

https://reviews.llvm.org/D82835



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D82835: [lldb] Fix missing characters when autocompleting LLDB commands in REPL

2020-06-30 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!




Comment at: lldb/source/Expression/REPL.cpp:460
 sub_result.GetMatches(matches);
+// Prepend command prefix that was excluded in the completion request
+if (request.GetCursorIndex() == 0) {

Nit: Missing `.` at the end of the comment, but I'll fix that when landing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82835/new/

https://reviews.llvm.org/D82835



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D82835: [lldb] Fix missing characters when autocompleting LLDB commands in REPL

2020-06-29 Thread Martin Svensson via Phabricator via lldb-commits
poya created this revision.
poya added a reviewer: teemperor.
Herald added a project: LLDB.
poya added a comment.

Tests for the Swift REPL in https://github.com/apple/llvm-project/pull/1388


When tabbing to complete LLDB commands in REPL, characters would at best be 
missing but at worst cause the REPL to crash due to out of range string access.
This patch appends the command character to the completion results to fulfill 
the assumption that all matches are prefixed by the request's cursor argument 
prefix.

Bug report for the Swift REPL
https://bugs.swift.org/browse/SR-12867


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82835

Files:
  lldb/source/Expression/REPL.cpp


Index: lldb/source/Expression/REPL.cpp
===
--- lldb/source/Expression/REPL.cpp
+++ lldb/source/Expression/REPL.cpp
@@ -457,6 +457,12 @@
 debugger.GetCommandInterpreter().HandleCompletion(sub_request);
 StringList matches, descriptions;
 sub_result.GetMatches(matches);
+// Prepend command prefix that was excluded in the completion request
+if (request.GetCursorIndex() == 0) {
+  for (auto &match : matches) {
+match.insert(0, 1, ':');
+  }
+}
 sub_result.GetDescriptions(descriptions);
 request.AddCompletions(matches, descriptions);
 return;


Index: lldb/source/Expression/REPL.cpp
===
--- lldb/source/Expression/REPL.cpp
+++ lldb/source/Expression/REPL.cpp
@@ -457,6 +457,12 @@
 debugger.GetCommandInterpreter().HandleCompletion(sub_request);
 StringList matches, descriptions;
 sub_result.GetMatches(matches);
+// Prepend command prefix that was excluded in the completion request
+if (request.GetCursorIndex() == 0) {
+  for (auto &match : matches) {
+match.insert(0, 1, ':');
+  }
+}
 sub_result.GetDescriptions(descriptions);
 request.AddCompletions(matches, descriptions);
 return;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D82835: [lldb] Fix missing characters when autocompleting LLDB commands in REPL

2020-06-29 Thread Martin Svensson via Phabricator via lldb-commits
poya added a comment.

Tests for the Swift REPL in https://github.com/apple/llvm-project/pull/1388


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82835/new/

https://reviews.llvm.org/D82835



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits