Skip to content

When implementing an interface, go to method usages always goes to the interface, instead of the actual usage #412

Description

@EranNL

Verified on latest main

  • I have confirmed this bug still occurs when built from the latest main branch.

PHPantom version / commit

phpantom_lsp 0.10.0-55-ga8767c22

Installation method

Built from source

Operating system

macOS x86_64 (Intel)

Editor

PHPStorm

Bug description

I have a class that implements an interface. I forgot to use the interface and used the concrete instead, but when I tried to find the usages of an implemented method, my editor went to the contract instead of the usage.

Image

I am injecting my UserRepository somewhere, and there I am using the findByEmail-method. When I try to find the usages of my method, as long as I implement the interface, go to usage goes to the interface:

Schermopname.2026-08-30.om.09.25.24.mov

It also might worth noting that when I remove the contract, the references badge appears with 1 reference:

Image

With the contract, no references count is shown:

Image (but it does show on top)

Steps to reproduce

  1. Let a class implement an interface
  2. Inject the concrete in another class.
  3. Try to go to usages of the overridden method in the concrete class. It goes to the interface, not the concrete usage.

Error output or panic trace


.phpantom.toml

#:schema https://github.com/PHPantom-dev/phpantom_lsp/raw/main/config-schema.json

# PHPantom configuration: only add settings you want to override.
# Editors with TOML schema support (Zed, VS Code + Even Better TOML, Neovim)
# provide autocomplete and hover documentation for all available options.
# Full reference: https://phpantom-dev.github.io/phpantom_lsp/configuration/

[diagnostics]
workspace = true

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions