[PHP] Refactor->rename isn't detecting the property usage properly.
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 20 release candidate
### What happened
When refactoring a class property a lot of incorrect usages are picked up.

It looks for any untyped occurrence of `->propertyName`. Maybe it made sense before typing and namespaces existed in PHP but now it's just a problem, especially if you're renaming something generic like `value`. I think that searching for untyped potential matches needs to be optional. Either unchecked by default (as seen on screenshot, this can be a setting in options) or entirely disabled.
Searching in vendor packages also doesn't make sense in my opinion.
### How to reproduce
Open a class file and try to rename a property by Refactor > Rename (`Ctrl+R`).
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 11
### JDK
21.0.1
### Apache NetBeans packaging
Apache NetBeans binary zip
### Anything else
At first I was very confused and thought that it's simply broken. Upon further investigation I discovered what was really going on. I find this kind of behavior unintended, that's why I filed it as a bug, feel free to change it to feature if you think otherwise.
Since this window has a lot of empty space I propose to add a checkbox for it.

Also the preview only appears after opening a file dropdown and selecting a specific occurrence. Can we please make it so that the file preview loads when you select a file (and jumps to first occurrence)? The message is confusing and made me think that the previews are broken, took me a while to figure out you had to go deeper.

### Are you willing to submit a pull request?
No
Contributor guide
Research direction
Start by reproducing the issue through Refactor > Rename (Ctrl+R) on a PHP class property. Inspect how untyped property matches, vendor-package results, and file preview behavior are presented; done means incorrect usages are controlled or excluded and the preview appears at the expected selection level.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100