This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 218259 - When changing a variable name, the suggestion should replace all the variable name instead of adding "in place" the selected name
Summary: When changing a variable name, the suggestion should replace all the variable...
Status: REOPENED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-13 07:19 UTC by areasas
Modified: 2012-09-13 15:25 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
IDE log (63.93 KB, text/plain)
2012-09-13 07:20 UTC, areasas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description areasas 2012-09-13 07:19:55 UTC
When changing a variable name, the suggestion should replace all the variable name instead of adding "in place" the selected name.

Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Mac OS X version 10.6.8 running on x86_64
Java; VM; Vendor = 1.6.0_33
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.8-b03-424
Comment 1 areasas 2012-09-13 07:20:04 UTC
Created attachment 124284 [details]
IDE log
Comment 2 areasas 2012-09-13 07:41:38 UTC
When the suggestion add "in place" the selected name, you have to erase any part at the right and it both slower the code writing and may produce errors.
Comment 3 Jiri Prox 2012-09-13 10:55:40 UTC
Sorry but I don't understand this request - can you provide example of current and expected behavior (sample files, screenshots ....).
Which action do you use to change variable name - refactoring or inplace rename?

Thanks
Comment 4 areasas 2012-09-13 13:56:12 UTC
.. i.e.: I made a copy of a block of code and I have to re-align the variable names. When I start to make the change to the variable name, the list of other variables with the same name drop down and offer the available names. If I choose a name, it overwrites the beginning of the variable name (I mean the name of the variable which is on the left of the insertion point) while it add everything is at the right not overwriting the part at the right of the insertion point, which remains written and has to be deleted.

Due to the fact that the new name has no corrispondence, the drop down list of the existing name of the variables is not presented.

I mean cases like the following:

- I make a copy of a peace of code which includes the variable "$first_buyer_editing" and I would like to change it to "$first_seller_editing" which I already used in the code. 
- When I start to replace "buyer" with "seller", starting with "s" after ""$first_", the drop down list is presented and it also contains "$first_seller_editing".
- When I choose the row containing "$first_seller_editing", what I have is a new variable named "$first_seller_editingbuyer_editing". Which I had to edit by hand.

My suggestion is to replace not only the part of the variable at the left of the insertion point but also the one at the right.

Thanks for the patience,

Carmine

p.s.: I am very sorry I missed to check "PHP" product. I made it now. I did not check if this problem is in other languages products, too.
Comment 5 areasas 2012-09-13 15:11:40 UTC
.. same problem happens in case of either "Insert Next matching word" or "Insert Previous matching word" when the variable name is not selected and the insertion point is inside the variable name.

Thanks again.
Comment 6 Tomas Mysik 2012-09-13 15:25:46 UTC
I guess it is editor issue...