feat: add declaration count hints and prototype navigation#283
Merged
Conversation
When the cursor is on a method definition that overrides a parent or implements an interface method, go-to-definition now navigates to the prototype declaration. Previously it returned call-site references (find_references), which sent the user to a seemingly random usage. Similarly, go-to-definition on a class declaration name now jumps to the parent class when one exists, instead of returning usages. The reverse-implementation lookup (already used by textDocument/implementation) is now reused by the definition handler for MemberDeclaration symbols. Methods and classes that do not override anything still fall through to the usages behavior. Closes #236
Show reference counts for classes, enums, interfaces, traits, methods, properties, and constants as inlay hints instead of non-actionable code lenses. Interface and abstract class declarations also show implementation counts. Code lenses remain reserved for actionable prototype navigation. The hints omit private members, magic methods, and overridden members to avoid noisy or misleading counts, while still showing zero-reference hints so users can distinguish unused symbols from missing data. Go-to-definition on overridden declarations now follows methods, properties, and constants to the nearest parent, trait, or interface prototype where applicable. Use a single all-targets Clippy invocation in CI and let agent docs prefer clippy --fix so automated changes apply safe lint suggestions before formatting. Closes #140
calebdw
force-pushed
the
calebdw/push-utrswpmvunmu
branch
from
July 25, 2026 01:51
ee62278 to
37969c0
Compare
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds reference count inlay hints for PHP declarations so unused and widely-used symbols are visible directly in the editor without turning them into fake clickable code lenses.
The new hints cover classes, interfaces, traits, enums, methods, properties, and constants. Interfaces and abstract classes also include implementation counts. Counts are shown only after the workspace index is ready, so editors do not briefly display misleading zero-reference annotations during startup.
Code lenses remain for real navigation only. Override annotations now execute a PHPantom command that uses the standard LSP
window/showDocumentrequest, which makes them work in Neovim, Cursor, VSCodium, and other clients instead of relying on VS Code-specific commands.The PR also improves declaration-site go-to-definition for overrides: methods, properties, constants, and child classes now jump to the nearest parent, trait, or interface prototype where PHPantom can resolve one.
Closes #140
Closes #236