apache / apache/netbeans

[PHP] Rename Refactor and Find Usages Does not Match all Usages

Open
#8,413 0 comments 0 reactions 0 assignees View on GitHub
kind:bug needs:triage PHP
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 25

### What happened

When renaming a variable, not all usages seem to be targeted, leading some to not be renamed. Similar behavior appears to be happening when running "Find Usage" on the variable name.

In this image the second usage of "$tablerefs" was renamed but only the ones following are targeted for rename. However this behavior has been seen in other contexts where the section seems arbitrary.

![Image](https://github.com/user-attachments/assets/59343d36-f76c-42be-bcac-a14bd0b95153)

### Language / Project Type / NetBeans Component

PHP project

### How to reproduce

While variable is focused on, press the Ctrl+R hotkey

### Did this work correctly in an earlier version?

Apache NetBeans 20

### Operating System

Linux Mint 22.1 Cinnamon 6.4.8

### JDK

java 23.0.1 2024-10-15

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

The issue is not consistent: sometimes it works while others it does not. Not sure what causes it, though it could be after having had NetBeans open for several hours of development.

Using the Rename Refactor dialog may not have the same issue:
![Image](https://github.com/user-attachments/assets/2d69eaf7-f0e4-4a93-a40d-545bce9ab790)

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in a PHP project with a focused variable and Ctrl+R, then compare the inline rename behavior with the Rename Refactor dialog and Find Usage. Investigate why only some usages are targeted, including whether the long-running IDE state matters. Done means all relevant variable usages are consistently found and renamed.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.