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 270387 - renaming using ctrl-R behavior is random
Summary: renaming using ctrl-R behavior is random
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-13 10:00 UTC by elecharny
Modified: 2017-04-18 12:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description elecharny 2017-04-13 10:00:54 UTC
When I try to rename variables using ctrl-R, the editor react in various random ways I still don't understand.
- for short variables, like one letter ones, the renaming is done inline, sort of : from time to time (I woudl say 30%, rough estimate), it simply does not rename the instances.
- for longer variables (but I can't tell how long), a popup pops and let me rename the variable. This simply works well in this case.

Beside the fact I don't see the rational for the popup - either do it inline for every variables, or don't, but mixing both mode is an horrible user experience, the simple fact that renaming fails for short variable make the feature unusable.

FTR, I'm using the C editor.
Comment 1 Vladimir Voskresensky 2017-04-13 11:11:17 UTC
There are two "rename" modes:
- when declaration is local, then Ctrl-R tries to do "in-place" rename
- when declaration is global, then Ctrl-R does standard Refactoring->Rename based on dialog/preview/refactor worflow
Comment 2 Vladimir Voskresensky 2017-04-13 11:14:42 UTC
Some more details:
if you use Refactor->Rename from editor's popup menu, then it will be always dialog-based.
But when you use shortcut, then IDE tries "instantly" detect 'local variable case':
- if succeed then "in-place" mode is activated
- if validation requires more time or variable is global, then fallback to standard dialog-based

Hope it helps,
Vladimir.
Comment 3 elecharny 2017-04-13 12:17:41 UTC
This is not what I see. I only rename either function parameters or variable inside a function. Neither one or the other are global. And even for two variables, one can be renamed online, when the other pops the rename popups. Here is the variables I renamed for instance :

	struct berval	*type, *vals, *nvals;

vals get renamed to values inline, but nvals was using the popup.

FTR, I always use ctrl-R
Comment 4 elecharny 2017-04-18 12:30:59 UTC
Forgot to mention that beside the erratic behavior of ctrl-R, it sometimes simply does not work : the newly named variable is not reflected in the code. That's the most annoying problem.

Strange enough, when there is a popup, the renaming works just fine, it's really when the inline feature is activated that it sometime fails.