Find a list of call sites of function.
(self, function: str)
| 285 | return self.format_signature(suggestion) |
| 286 | |
| 287 | def suggest_callsites(self, function: str) -> str: |
| 288 | """Find a list of call sites of function.""" |
| 289 | mod, _, node = self.find_node(function) |
| 290 | with self.restore_after(mod): |
| 291 | callsites, _ = self.get_callsites(node) |
| 292 | |
| 293 | return "\n".join( |
| 294 | dedup( |
| 295 | [ |
| 296 | f"{path}:{line}: {self.format_args(arg_kinds, arg_names, arg_types)}" |
| 297 | for path, line, arg_kinds, _, arg_names, arg_types in callsites |
| 298 | ] |
| 299 | ) |
| 300 | ) |
| 301 | |
| 302 | @contextmanager |
| 303 | def restore_after(self, module: str) -> Iterator[None]: |
no test coverage detected