IDE: references and call hierarchy for overridden methods
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
In the IDE, when navigating to references (via `Go to references` or `Show Call Hierarchy`), I would expect it to also show references of the overridden base method. While it's not a direct call, I'd prefer to show it all possible references.
```python
from typing import Protocol, override, cast
class Foo(Protocol):
def foo(self): pass
class FooImpl(Foo):
def foo(self): pass
def a():
cast(Foo, None).foo() # not counted as a reference for FooImpl.foo
def b():
cast(FooImpl, None).foo()
class Bar():
def bar(self): pass
class BarChild(Bar):
@override
def bar(self): pass # not counted as a reference for FooImpl.foo
def c():
cast(Bar, None).bar()
def d():
cast(BarChild, None).bar()
```
Screenshot with Pyrefly:
Screenshot with Pylance:
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
VS Code with Pyrefly v0.53.0
Contributor guide
Assessment
This issue has not been assessed yet.