Skip to content

IDE: references and call hierarchy for overridden methods #2490

Description

@Otto-AA

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.

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:

Image

Screenshot with Pylance:

Image

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

VS Code with Pyrefly v0.53.0

Activity

  1. changed the title [-]IDE: references and call hierarchy for overriden methods[/-] [+]IDE: references and call hierarchy for overridden methods[/+] on Mar 3, 2026
  2. added
    language-serverIssues specific to our IDE integration rather than type checking
    and removed on Mar 3, 2026
  3. asukaminato0721 commented on Apr 18, 2026

    @asukaminato0721
    Collaborator

    related #2687

  4. github-actions commented on Oct 31, 2026

    @github-actions

    This issue has someone assigned, but has not had recent activity for more than 2 weeks.

    If you are still working on this issue, please add a comment so everyone knows. Otherwise, please comment #unclaim to unassign yourself.

    Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

language-serverIssues specific to our IDE integration rather than type checkingstale

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions