MCPcopy Index your code
hub / github.com/prompt-toolkit/ptpython / AliasCompleter

Class AliasCompleter

src/ptpython/ipython.py:163–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162
163class AliasCompleter(Completer):
164 def __init__(self, alias_manager):
165 self.alias_manager = alias_manager
166
167 def get_completions(
168 self, document: Document, complete_event: CompleteEvent
169 ) -> Iterable[Completion]:
170 text = document.text_before_cursor.lstrip()
171 # aliases = [a for a, _ in self.alias_manager.aliases]
172 aliases = self.alias_manager.aliases
173
174 for a, cmd in sorted(aliases, key=lambda a: a[0]):
175 if a.startswith(text):
176 yield Completion(f"{a}", -len(text), display_meta=cmd)
177
178
179class IPythonInput(PythonInput):

Callers 1

create_completerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected