[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-12 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG246afe0cd17f: [lldb] Display autosuggestion part in gray if there is one possible suggestion (authored by gedatsu217, committed by teemperor). Herald added a project: LLDB. Changed prior to commit:

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-11 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Slightly late to the party, but I want to point out that there _is_ an escape code for clearing a line: CSI n K -- Erase in Line --Erases part of the line. If n is 0 (or missing), clear from cursor to the end of the line. If n is 1, clear from

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-10 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. Also signing this off as I think this is in a good enough state to land. The remaining issues can all be follow-up patches. Also you might want to change your editor to remove trailing

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-10 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision as: JDevlieghere. JDevlieghere added a comment. I applied the patch locally and gave this another shot. I'm still missing all the common ways I accept auto-suggestions in fish: - C-e - Right arrow - End but I'm fine with fixing that in another patch assuming

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 283686. gedatsu217 added a comment. add comments. revise a test(add self.quit()). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files: lldb/include/lldb/Core/Debugger.h

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. Alright, let's see if the others see any other issues, otherwise I think this is finally good to go. Comment at: lldb/source/Host/common/Editline.cpp:1011 el_insertstr(m_editline, to_add.c_str()); - break; + if (to_add == " ") +

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 283590. gedatsu217 added a comment. Simplify the code. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files: lldb/include/lldb/Core/Debugger.h lldb/include/lldb/Core/IOHandler.h

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. > Are there any other problems with the current state of the patch that haven't > been resolved? (I went over the comments, but it's hard to say what has and > hasn't been fixed until now). Yes, I have solved all the problems. CHANGES SINCE LAST ACTION

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D81001#2199450 , @gedatsu217 wrote: >> So, if I would type "b" and then press tab, the autosuggestion would briefly >> disappear until I type the next character? > > Yes. Indeed, it may not be good. I'll think of other

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. > So, if I would type "b" and then press tab, the autosuggestion would briefly > disappear until I type the next character? Yes. Indeed, it may not be good. I'll think of other ways. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D81001#2199205 , @gedatsu217 wrote: >> So the way the issue with the single space is now solved is by doing >> CC_REDISPLAY when we're only adding the single space? Isn't that also >> deleting the whole autosuggestion? > >

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. > So the way the issue with the single space is now solved is by doing > CC_REDISPLAY when we're only adding the single space? Isn't that also > deleting the whole autosuggestion? Yes. CC_REDISPLAY can delete all the gray characters left. Comment

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-06 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. So the way the issue with the single space is now solved is by doing CC_REDISPLAY when we're only adding the single space? Isn't that also deleting the whole autosuggestion? In D81001#2190864 , @gedatsu217 wrote: I don't

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-04 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 282961. gedatsu217 added a comment. Add test. Delete gray character if autosuggestion has the only one character. (e.g. "b") (Editline::TabCommand) Simplify the code. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-04 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. @teemperor I understand what you say just now. Indeed, your method is more efficient than mine. I'm fixing the code now. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-03 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. >>> I don't think the value of m_previous_autosuggestion_size should only grow >>> (which is what this if is doing), as this way we just keep printing a >>> longer and longer space buffer over time. Just printing enough to clear the >>> buffer of the previous

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-03 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D81001#2190646 , @gedatsu217 wrote: > @skipIfAsan > @skipIfEditlineSupportMissing > def test_hidden_autosuggestion(self): > @skipIfAsan > @skipIfEditlineSupportMissing > def test_autosuggestion(self): >

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-03 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. @skipIfAsan @skipIfEditlineSupportMissing def test_hidden_autosuggestion(self): @skipIfAsan @skipIfEditlineSupportMissing def test_autosuggestion(self): self.launch(extra_args=["-o", "settings set show-autosuggestion true", "-o", "settings set

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-03 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. Added some comments on the new code. Also we should be able to see these spaces in the pexpect output, so I guess we should be able to test this too? To make this special case less fragile to test, you can make a new subtest in the Test case by just defining a new

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-01 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 282430. gedatsu217 added a comment. Add spaces when a character is typed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files: lldb/include/lldb/Core/Debugger.h lldb/include/lldb/Core/IOHandler.h

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-01 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D81001#2189008 , @gedatsu217 wrote: >> Also could you rebase the diff here when you have time (e.g., regenerate the >> diff from you changes on top of the latest master commit)? It no longer >> applies at the moment without

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-01 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. > Also could you rebase the diff here when you have time (e.g., regenerate the > diff from you changes on top of the latest master commit)? It no longer > applies at the moment without having to manually resolve a conflict. Does this mean that I should generate diff

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-01 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D81001#218 , @gedatsu217 wrote: > Although I thought of how to clear all the following characters, I did not > come up with it. So, I will try to fill the space. Should I add how many > spaces? If I add too many spaces,

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-08-01 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. Although I thought of how to clear all the following characters, I did not come up with it. So, I will try to fill the space. Should I add how many spaces? If I add too many spaces, sequences will be two lines, but if I add a few spaces, I can't handle some of the

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-30 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. I'm not hitting the same bug here, but I do hit a different bug. If I have a autosuggestion and then type another character that causes a shorter autosuggestion to display, then the old text of the autosuggestion is not deleted from the terminal. For example: >

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-29 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 281686. gedatsu217 added a comment. Sorry, I mistakenly uploaded a different file. This is the correct file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files: lldb/include/lldb/Core/Debugger.h

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-29 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 281677. gedatsu217 added a comment. Fix the cursor position. (Editline::TypedCharacter) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files: lldb/include/lldb/Core/Debugger.h

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-29 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2179690 , @gedatsu217 wrote: > For example, I execute "help frame variable" and save it as command history. > Then, when I type "hel", "helhelp [me variable]" (gray characters are in []) > is displayed, probably because

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-28 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. For example, I execute "help frame variable" and save it as command history. Then, when I type "hel", "helhelp [me variable]" (gray characters are in []) is displayed, probably because of cursor position or CC_NORM. I am trying to solve this problem, but I have not

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-28 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. Sorry, I found the bug. Please do not check this yet. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-28 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 281247. gedatsu217 added a comment. Editline::TypedCharacter is called when delete is pressed. (This probably fix the above bug.) Revise the test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files:

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-28 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Thanks. When trying this out I did notice one subtle bug related to backspacing. When backspacing over the first character, the command line does not get redrawn, which means the autosuggested text remains on screen. The "deleted" character also remains, and is printed

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-27 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 281017. gedatsu217 added a comment. Revise Editline::ApplyAutosuggestCommand. (Change the return value.) Revise IOHandlerEditline::IOHandlerEditline (Disable to use autosuggestion if debugger.GetUseColor() is false.) Fix the test. CHANGES SINCE LAST

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-27 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2176076 , @gedatsu217 wrote: > > Could you create a patch to change the definition of ANSI_UNFAINT ? (might > > be worth taking a quick look at git history if there is no good reason for > > why it uses the color code

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-27 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. > Could you create a patch to change the definition of ANSI_UNFAINT ? (might be > worth taking a quick look at git history if there is no good reason for why > it uses the color code that it uses) Sure. Should I create another patch? (In short, should I create it

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-27 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2172658 , @gedatsu217 wrote: > I do not intend for this feature to work with colors disabled. Right in that case, we should probably disable the feature if colors are disabled. > I found that pexpect output the below

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-24 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. I do not intend for this feature to work with colors disabled. I found that pexpect output the below sequence, and this passed the test. self.child.expect_exact("\x1b[" + str(len("(lldb) he") + 1) + "G" + "l" + "\x1b[2m" + "p frame" + "\x1b[0m\x1b[1G" + "l" +

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-24 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2172035 , @labath wrote: > In D81001#2171999 , @gedatsu217 > wrote: > > > > That said, are you sure this is the right sequence? \x1b[1Gl seems like > > > it should print the l at

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-24 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. Yes, I'm testing it on Mac. By the way, I checked its output on the error message. When the test failed, the characters, `buffer (last 100 chars) : ~~~`, are displayed as an error message. I thought it was pexpect's output, possibly it is not that output? CHANGES

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-24 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2171999 , @gedatsu217 wrote: > > That said, are you sure this is the right sequence? \x1b[1Gl seems like it > > should print the l at column one, which does not sound right... > > I thought it did not add up too, but

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-24 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. > That said, are you sure this is the right sequence? \x1b[1Gl seems like it > should print the l at column one, which does not sound right... I thought it did not add up too, but pexpect probably actually outputs these characters. > The sequence I got in this test

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-24 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2170570 , @gedatsu217 wrote: > I checked what's the sequence that actually gets output, and it was like > below. > > h\x1b[2melp frame\x1b[0m\x1b[1Ghe\x1b[2mlp frame\x1b[0m\x1b[1Gel\x1b[2mp > frame\x1b[0m\x1b[1Gl > >

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-23 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. I checked what's the sequence that actually gets output, and it was like below. h\x1b[2melp frame\x1b[0m\x1b[1Ghe\x1b[2mlp frame\x1b[0m\x1b[1Gel\x1b[2mp frame\x1b[0m\x1b[1Gl Is it not good to check these characters in `expect_exact`? CHANGES SINCE LAST ACTION

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-23 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Some quibbles about the test. Otherwise, this looks good to me. Comment at: lldb/test/API/iohandler/autosuggestion/TestAutosuggestion.py:33 +self.child.send("hel") +self.child.expect_exact(faint_color + "p frame" + reset + "\x1b[1G") +

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-22 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 279906. gedatsu217 added a comment. Add the test content. Change return from void to llvm::Optional in several functions to make the code cleaner. Revise the details. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-22 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2162743 , @gedatsu217 wrote: > In addition to it, I tried the below code, but it did not go well. ("\x1b[nD" > moves the cursor n steps to the left.) > > self.child.send("hel") > self.child.expect_exact(faint_color +

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-20 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. In addition to it, I tried the below code, but it did not go well. ("\x1b[nD" moves the cursor n steps to the left.) self.child.send("hel") self.child.expect_exact(faint_color + "p frame" + reset + "\x1b[" + str(len("p frame")) + "D") In the first place, the

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-20 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 marked an inline comment as done. gedatsu217 added inline comments. Comment at: lldb/source/Core/IOHandler.cpp:204 + .GetAutoSuggestionForCommand(line)) +result = res.getValue(); +} labath wrote: > gedatsu217 wrote: > > labath

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-20 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D81001#2158645 , @teemperor wrote: > Not sure if there is a good way to test that the text is directly behind the > cursor, but we can test that it's there. I guess that would be done by expecting the appropriate cursor

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-17 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 marked an inline comment as done. gedatsu217 added a comment. > help help frame should not have an autosuggestion to help frame. You can just > try to get the autosuggestion for help help frame and check for the error for > an invalid command. Sorry, I do not know what this means.

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-17 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor requested changes to this revision. teemperor added a comment. This revision now requires changes to proceed. > The test looks wrong to me. If the feature is supposed to be off by default, > then how can it test anything without first turning the feature on? Either > the feature isn't

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-17 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. The test looks wrong to me. If the feature is supposed to be off by default, then how can it test anything without first turning the feature on? Either the feature isn't really off, or the test is broken. I would expect it to be the latter, because the test sequence

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-17 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. This now looks good to me. I'll give the others a chance to take a look too but beside that I think this is ready to go IMHO. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-16 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 278580. gedatsu217 added a comment. Remove extra parts in Editline::TabCommand in Editline.cpp. Add a test for the autosuggestion. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files:

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-14 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 marked an inline comment as done. gedatsu217 added inline comments. Comment at: lldb/source/Host/common/Editline.cpp:1017 + el_insertstr(m_editline, to_add.c_str()); + return CC_REFRESH; +} teemperor wrote: > gedatsu217

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-14 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments. Comment at: lldb/source/Host/common/Editline.cpp:1017 + el_insertstr(m_editline, to_add.c_str()); + return CC_REFRESH; +} gedatsu217 wrote: > teemperor wrote: > > gedatsu217 wrote: > > > teemperor wrote:

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-13 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 marked an inline comment as done. gedatsu217 added inline comments. Comment at: lldb/source/Host/common/Editline.cpp:1017 + el_insertstr(m_editline, to_add.c_str()); + return CC_REFRESH; +} teemperor wrote: > gedatsu217

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor requested changes to this revision. teemperor added a comment. This revision now requires changes to proceed. Sorry this is taking so long, but I think beside one minor change this only needs some testing and then it's ready. So the way I would like to see this tested would be with a

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-08 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 276468. gedatsu217 added a comment. I fixed the code according to your advice. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81001/new/ https://reviews.llvm.org/D81001 Files: lldb/include/lldb/Core/Debugger.h

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-07-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments. Comment at: lldb/include/lldb/Host/Editline.h:381 void *m_completion_callback_baton = nullptr; - + std::string m_current_autosuggestion = ""; + bool m_use_autosuggestion = false; Strings are empty by default, so you can

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-25 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 marked an inline comment as done. gedatsu217 added inline comments. Comment at: lldb/source/Host/common/Editline.cpp:1017 + el_insertstr(m_editline, to_add.c_str()); + return CC_REFRESH; +} teemperor wrote: > If I understand

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-25 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. Just a quick comment while I look into how we can test this code. Comment at: lldb/source/Host/common/Editline.cpp:1017 + el_insertstr(m_editline, to_add.c_str()); + return CC_REFRESH; +} If I understand the

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-25 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 273349. gedatsu217 added a comment. I revised the code according to your advice. In addition, llvm::Optional was originally returned in CommandInterpreter::GetAutoSuggestionForCommand, but it seems to useless that converting llvm::Optional to

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-25 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added a comment. I understood what you said. Sorry, I misunderstood it. Indeed, m_current_autosuggestion is not good for the future. I will get the current user input every time calling ApplyCompleteCommand instead of using m_current_autosuggestion. By the way, when I use

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-25 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:1875-1878 +if (entry.startswith(line)) { + llvm::StringRef res = entry.substr(line.size()); + result = res.str(); + return result; teemperor wrote: >

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-25 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D81001#2107102 , @gedatsu217 wrote: > Change the name and return of the function( bool UseAutosuggestion() -> void > SetShowAutosuggestion (bool) ) (ll. 1447 in Editline.cpp and ll.194 in > Editline.h). > int -> size_t

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-23 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added inline comments. Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:1875-1878 +if (entry.startswith(line)) { + llvm::StringRef res = entry.substr(line.size()); + result = res.str(); + return result; labath wrote: > ```

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-23 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:1875-1878 +if (entry.startswith(line)) { + llvm::StringRef res = entry.substr(line.size()); + result = res.str(); + return result; ``` if

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-22 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 272479. gedatsu217 added a comment. Change the name and return of the function( bool UseAutosuggestion() -> void SetShowAutosuggestion (bool) ) (ll. 1447 in Editline.cpp and ll.194 in Editline.h). int -> size_t (ll. 1009 in Editline.cpp). Fix for normal

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-22 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. This is already looking quite reasonable, I think we're getting closer to something we can merge. In D81001#2096702 , @gedatsu217 wrote: > Implementation all ascii characters for TypedCharacter. > Making m_use_autosuggestion

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-16 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 271146. gedatsu217 added a comment. Implementation all ascii characters for TypedCharacter. Making m_use_autosuggestion in Editline.cpp. (I did not know a way to pass the bool value of IOHandlerEditline to Editline constructor, so I made a function,

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. I tried out the patch and I have a few observations: - For me the faint modifier doesn't do anything. Of course it might just be my shell/theme, but we should check whether this modifier is widely supported. Additionally, this modified should be configurable. -

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments. Comment at: lldb/source/Core/Debugger.cpp:349 +bool Debugger::GetUseAutosuggestion() const { + const uint32_t idx = ePropertyShowAutosuggestion; gedatsu217 wrote: > teemperor wrote: > > You declared the function, but you don't

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-12 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 updated this revision to Diff 270454. gedatsu217 added a comment. I updated my codes according to your advice: Add if(GetUseAutosuggestion()) in IOHandlerSuggestion in IOHandler.cpp. (Is this not enough?) Add more keybinds for TypedCharacter. Return llvm::Optional in HandleSuggestion

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-12 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added inline comments. Comment at: lldb/source/Host/common/Editline.cpp:1244 +llvm::StringRef indent_chars = +"abcdefghijklmnopqrstuvwxzyABCDEFGHIJKLMNOPQRSTUVWXZY1234567890 "; +for (char c : indent_chars) { teemperor wrote: >

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-12 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 added inline comments. Comment at: lldb/source/Core/Debugger.cpp:349 +bool Debugger::GetUseAutosuggestion() const { + const uint32_t idx = ePropertyShowAutosuggestion; teemperor wrote: > You declared the function, but you don't use it anywhere. You

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/source/Host/common/Editline.cpp:1051-1052 +unsigned char Editline::TypedCharacter(int ch) { + std::string typed = std::string(1, ch); + typed = typed[0]; + el_insertstr(m_editline, typed.c_str()); the second line

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-11 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a reviewer: LLDB. teemperor added a subscriber: lldb-commits. teemperor added a comment. I think this is ready to get a review from the rest. I'll add the other LLDB folks to the review. Comment at: lldb/include/lldb/Host/Editline.h:377 void

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D81001#2068925 , @labath wrote: > Thanks for the explanation Raphael. This makes more sense now, though I am > still not very clear on the distinction between "completions" and > "suggestions". The fish tutorial mentions

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Thanks for the explanation Raphael. This makes more sense now, though I am still not very clear on the distinction between "completions" and "suggestions". The fish tutorial mentions command history -- that's something that's not typically done as a part of tab

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. @labath Just to get you into the loop: This is for a GSoC project that is about implementing the autosuggestions similar to what fish shell is providing. It's not really about actually invoking any completion logic (even though that might be an option in the future),

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Thanks for the patch. It's a very interesting feature, but I'm not sure it is actually a good idea. Some tab completions can be very expensive (not to mention they can crash lldb), and so running them after every keypress sounds problematic to me. Editors usually have

[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

2020-06-02 Thread Shu Anzai via Phabricator via lldb-commits
gedatsu217 created this revision. gedatsu217 added reviewers: teemperor, JDevlieghere. gedatsu217 added a project: LLDB. Herald added a subscriber: lldb-commits. I implemented autosuggestion if there is one possible suggestion. I set the keybinds for every character. When a character is typed,