[Lldb-commits] [lldb] Add the ability to define custom completers to the parsed_cmd template. (PR #109062)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 19 16:50:47 PDT 2024


================
@@ -43,7 +43,65 @@ def __call__(self, debugger, args_list, exe_ctx, result):
 will return True if the user set this option, and False if it was left at its default
 value.
 
-There are example commands in the lldb testsuite at:
+Custom Completions:
+
+You can also implement custom completers for your custom command, either for the
+arguments to your command or to the option values in your command.  If you use enum
+values or if your option/argument uses is one of the types we have completers for,
+you should not need to do this.  But if you have your own completeable types, or if
+you want completion of one option to be conditioned by other options on the command
+line, you can use this interface to take over the completion.  
+
+You can choose to add a completion for the option values defined for your command,
+or for the arguments, separately.  For the option values, define:
+
+def handle_option_argument_completion(self, long_option, cursor_pos):
+
----------------
medismailben wrote:

Use `.. code-block:: python`  so this gets rendered differently on the website

```suggestion

        .. code-block:: python

                def handle_option_argument_completion(self, long_option, cursor_pos):

```

https://github.com/llvm/llvm-project/pull/109062


More information about the lldb-commits mailing list