True when the node is a declaration that lives in a file with one of ``suffixes``. Every end of a dispatch pair has to pass this. A sourceless stub minted for a dangling reference carries no members worth dispatching to, and a cross-language pair is a name collision rather than an imple
(node: dict | None, suffixes: tuple[str, ...])
| 61 | |
| 62 | |
| 63 | def declared_in(node: dict | None, suffixes: tuple[str, ...]) -> bool: |
| 64 | """True when the node is a declaration that lives in a file with one of ``suffixes``. |
| 65 | |
| 66 | Every end of a dispatch pair has to pass this. A sourceless stub minted for |
| 67 | a dangling reference carries no members worth dispatching to, and a |
| 68 | cross-language pair is a name collision rather than an implementation. The |
| 69 | suffix is the effective one, so a `.graphifyrc` language declaration counts |
| 70 | (#2961). |
| 71 | """ |
| 72 | if not node: |
| 73 | return False |
| 74 | source_file = node.get("source_file") |
| 75 | return bool(source_file) and effective_suffix(str(source_file)) in suffixes |
| 76 | |
| 77 | |
| 78 | def method_label(node: dict) -> str: |
no test coverage detected