MCPcopy Create free account
hub / github.com/bpython/bpython / ImportCompletion

Class ImportCompletion

bpython/autocomplete.py:324–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322
323
324class ImportCompletion(BaseCompletionType):
325 def __init__(
326 self,
327 module_gatherer: ModuleGatherer,
328 mode: AutocompleteModes = AutocompleteModes.SIMPLE,
329 ):
330 super().__init__(False, mode)
331 self.module_gatherer = module_gatherer
332
333 def matches(
334 self, cursor_offset: int, line: str, **kwargs: Any
335 ) -> set[str] | None:
336 return self.module_gatherer.complete(cursor_offset, line)
337
338 def locate(self, cursor_offset: int, line: str) -> LinePart | None:
339 return lineparts.current_word(cursor_offset, line)
340
341 def format(self, word: str) -> str:
342 return _after_last_dot(word)
343
344
345def _safe_glob(pathname: str) -> Iterator[str]:

Callers 1

get_default_completerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected