================
@@ -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):
+
+The line to be completed will be parsed up to the option containint the cursor 
position, 
+and the values will be set in the OptionValue parser object.  long_option will 
be
+the option name containing the cursor, and cursor_pos will be the position of 
the cursor
+in that option's value.  You can call the 
OVParser.dest_for_option(long_option) to get the
+value for that option.  The other options that came before the cursor in the 
command
+line will also be set in the OV Parser when the completion handler is called.
----------------
medismailben wrote:

```suggestion
in that option's value.  You can call the 
`OVParser.dest_for_option(long_option)` to get the
value for that option.  The other options that came before the cursor in the 
command
line will also be set in the `OVParser` when the completion handler is called.
```

https://github.com/llvm/llvm-project/pull/109062
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to