Skip to content

Add constructor reference support for attributes#155

Open
RemcoSmitsDev wants to merge 1 commit into
PHPantom-dev:mainfrom
RemcoSmitsDev:fix-find-references-for-attributes
Open

Add constructor reference support for attributes#155
RemcoSmitsDev wants to merge 1 commit into
PHPantom-dev:mainfrom
RemcoSmitsDev:fix-find-references-for-attributes

Conversation

@RemcoSmitsDev

Copy link
Copy Markdown
Contributor

Hey, while I was trying out this LSP again, I noticed that find all references for a constructor didn't work in combination with attributes. So this PR fixes this by adding a new ClassRefContext option called Attribute, this allows us to do some additional checks for getting all the right references in the case of class attributes.

Here is a video of how works now, vs how it was before (it didn't find any references at all) because the class used in my example the symfony Group class attribute is never normally instantiated using new Group.

Note for the reviewer: A part of this change was assistet with AI because I don't know the code that good.
So let me know if you want me to make any changes!

Screen.Recording.2026-06-13.at.20.24.52.mov

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 78.51852% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/references/mod.rs 78.62% 28 Missing ⚠️
src/diagnostics/invalid_class_kind.rs 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants