| 322 | |
| 323 | |
| 324 | class 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 | |
| 345 | def _safe_glob(pathname: str) -> Iterator[str]: |
no outgoing calls
no test coverage detected