Assigned visit_* methods not being called in BatchableMetadataProvider
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 229
- PR merge metrics
- No merged PRs in 30d
Description
I am building a metadata provider and running into a pretty strange bug.
If I declare my provider:
```Python
class Provider(cst.BatchableMetadataProvider[bool]):
def _visit_simple_block(self,
node: Union[cst.SimpleStatementLine, cst.SimpleStatementSuite]
) -> Optional[bool]:
... # Operate on node.body
visit_SimpleStatementLine = _visit_simple_block
visit_SimpleStatementSuite = _visit_simple_block
```
`_visit_simple_block` is never called when resolving `Provider`
However if I instead declare it like:
```Python
class Provider(cst.BatchableMetadataProvider[bool]):
...
def visit_SimpleStatementLine(self, node: cst.SimpleStatementLine) -> Optional[bool]:
return self._visit_simple_block(node)
... # similar for visit_SimpleStatementSuite
```
Everything works fine
Contributor guide
Assessment
This issue has not been assessed yet.