- User Since
- Feb 24 2020, 10:25 AM (24 w, 4 d)
And, the test does not work well. Would you check it?
Did you check it? This test seems to work well, but an error occurs.
Tue, Aug 11
Revise the code according to your advice.
Mon, Aug 10
Thu, Aug 6
Regarding the expected test: This isn't really related to the autosuggestion feature but a more generic feature, so I would make a new separate test where you check that the command history is persistent across lldb instances. The easiest way to check this is to add a unique command to the history and then relaunch LLDB and check its still there (you can list the command history via session history. If your branch isn't fully up-to-date, the command might still be named command history).
Simplify the code.
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).
So, if I would type "b" and then press tab, the autosuggestion would briefly disappear until I type the next character?
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.
Tue, Aug 4
@teemperor I understand what you say just now. Indeed, your method is more efficient than mine. I'm fixing the code now.
Mon, Aug 3
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 completion is enough.
If I keep the number of characters of the only previous command, I think there is a problem. For example, If I type "help frame var" → "help frame info" → "help frame v", the remains are hidden. However, If I type "help frame var" → "help frame info" → "help" → "help frame v", the number of characters of "help frame var" is more than that of "help", so "help frame v[aro]" is displayed. What do you think?
Not sure if I understand your example correctly, but as soon as you type "help frame ", you should have an autosuggestion of "help frame info" and then typing the "v" should clear the "nfo" part. The "help" autosuggestion should not be involved at all in any logic after you typed "help "?
@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 use-color true"]) self.expect("help frame v") self.expect("help frame info") [type 'help frame v' and check for the three space after the grey part to cover up the "nfo" text]
Sat, Aug 1
Add spaces when a character is typed.
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.
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 cases.
Wed, Jul 29
Sorry, I mistakenly uploaded a different file. This is the correct file.
Fix the cursor position. (Editline::TypedCharacter)
Tue, Jul 28
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 do not know how to land this. So, I would like to land this if I can do.
Sorry, I found the bug. Please do not check this yet.
Sorry, I misunderstood it.
Editline::TypedCharacter is called when delete is pressed. (This probably fix the above bug.)
Mon, Jul 27
Revise Editline::ApplyAutosuggestCommand. (Change the return value.)
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)
Fri, Jul 24
I do not intend for this feature to work with colors disabled.
Yes, I'm testing it on Mac.
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.
Thu, Jul 23
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
Wed, Jul 22
Add the test content.
Mon, Jul 20
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.)
Fri, Jul 17
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.
Thu, Jul 16
Remove extra parts in Editline::TabCommand in Editline.cpp.
Jul 14 2020
Jul 13 2020
Jul 8 2020
I fixed the code according to your advice.
Jun 25 2020
I revised the code according to your advice.
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.
Jun 23 2020
Jun 22 2020
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 setter (ll. 269 in IOHandler.cpp).
Jun 16 2020
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, Editline::UseAutosuggestion, in Editline class. If the autosuggestion is valid, this function is called from IOHandlerEditline constructor. Is this implementation good?)
Jun 12 2020
I updated my codes according to your advice:
Jun 10 2020
I corrected codes according to your advice.
Jun 8 2020
Jun 5 2020
I implemented autosuggestion based on command history first according to your advice.
But I did not understand what you said completely. So I want to know it in detail.
Jun 4 2020
In short, should I implement autosuggestion using m_command_history at first?
Jun 2 2020
May 5 2020
I performed a factory reset for OS upgrade and rebuild LLDB, and solved this problem. Thanks.
Apr 9 2020
[39/575] Linking CXX shared library lib/libc++abi.1.0.dylib FAILED: lib/libc++abi.1.0.dylib : && /Library/Developer/CommandLineTools/usr/bin/c++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -g -dynamiclib -Wl,-headerpad_max_install_names -nodefaultlibs -compatibility_version 1.0.0 -current_version 1.0.0 -o lib/libc++abi.1.0.dylib -install_name @rpath/libc++abi.1.dylib projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_aux_runtime.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_demangle.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_exception_storage.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_guard.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_handlers.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_unexpected.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_vector.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_virtual.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/stdlib_exception.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/stdlib_stdexcept.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/stdlib_typeinfo.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/abort_message.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/fallback_malloc.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/private_typeinfo.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/stdlib_new_delete.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_exception.cpp.o projects/libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_personality.cpp.o -Wl,-rpath,@loader_path/../lib -lSystem -Wl,-exported_symbols_list,/Users/shu/Documents/llvm-project/libcxxabi/src/../lib/itanium-base.exp -Wl,-exported_symbols_list,/Users/shu/Documents/llvm-project/libcxxabi/src/../lib/new-delete.exp -Wl,-exported_symbols_list,/Users/shu/Documents/llvm-project/libcxxabi/src/../lib/personality-v0.exp && : Undefined symbols for architecture x86_64: "__ZTIDu", referenced from: -exported_symbol[s_list] command line option "__ZTIPDu", referenced from: -exported_symbol[s_list] command line option "__ZTIPKDu", referenced from: -exported_symbol[s_list] command line option "__ZTSDu", referenced from: -exported_symbol[s_list] command line option "__ZTSPDu", referenced from: -exported_symbol[s_list] command line option "__ZTSPKDu", referenced from: -exported_symbol[s_list] command line option ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Mar 30 2020
I revised the test case. If "log timers" is executed, an error will not occur.
Mar 28 2020
Thanks. I revised it. Then, I want to have a test. How do I have a test?
Mar 27 2020
Sorry, I do not understand what you said completely. In short, is "log timer" (not "log timers") expected to fail? In that case, for example, "log ena" operates the same as "log enable". Thus, I think that "log timer" should operate the same as "log timers". Or, should I fix CommandObjectMultiword to solve such problems? (In short, should I fix it so that "log ena" do not operate like "log enable", "log timer" do not operate like "log timers", "brea li" do not operate "breakpoint list" and so on?)
Mar 4 2020
What should I do after this? I think I don't have the right to commit.
Mar 3 2020
Sorry, I revised it.
Mar 1 2020
I fixed a little according to your instruction, and I made an additional revision. (I revised type inference.)