Adds a new custom completer function. The position argument (defaults to 0) is the index in the completers list where you want the completer to be inserted. `completer` should have the following signature:: def completion(self: Completer, text: string) -> List[
(self, completer, pos=0)
| 2212 | return self.Completer.complete(text, line, cursor_pos) |
| 2213 | |
| 2214 | def set_custom_completer(self, completer, pos=0) -> None: |
| 2215 | """Adds a new custom completer function. |
| 2216 | |
| 2217 | The position argument (defaults to 0) is the index in the completers |
| 2218 | list where you want the completer to be inserted. |
| 2219 | |
| 2220 | `completer` should have the following signature:: |
| 2221 | |
| 2222 | def completion(self: Completer, text: string) -> List[str]: |
| 2223 | raise NotImplementedError |
| 2224 | |
| 2225 | It will be bound to the current Completer instance and pass some text |
| 2226 | and return a list with current completions to suggest to the user. |
| 2227 | """ |
| 2228 | |
| 2229 | newcomp = types.MethodType(completer, self.Completer) |
| 2230 | self.Completer.custom_matchers.insert(pos,newcomp) |
| 2231 | |
| 2232 | def set_completer_frame(self, frame=None): |
| 2233 | """Set the frame of the completer.""" |
no outgoing calls