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 162232 - Code refactoring disabled in non-class files
Summary: Code refactoring disabled in non-class files
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-08 15:18 UTC by dancehands
Modified: 2017-02-17 15:36 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dancehands 2009-04-08 15:18:47 UTC
When I'm editing a PHP script, like a controller script, that isn't a class object, the code refactoring is disabled.
For example, I open a PHP file, highlight a variable that is used several times throughout the script, and then go to
the main Refactor menu and everything is disabled.
Comment 1 Tomasz Slota 2009-04-08 15:28:08 UTC
I believe this was already requested, but I cannot find the existing issue. 
Comment 2 Tomasz Slota 2010-02-10 08:46:03 UTC
reassigning to default owner
Comment 3 Filip Zamboj 2010-09-15 12:28:34 UTC
batch reassigning
Comment 4 Xenos 2017-02-17 15:36:24 UTC
I renamed the bug since its title has nothing to do with the issue.

Still, when I do a Ctrl+R a variable to refactor something in a non-class PHP file, I get the refactoring popup, and when I do the preview, it seems to work and rename the variable.

So this seems to be fixed in NB 8.2
But I believe this way of working (with global variables) is very hazardous when it comes to refactor and rename variables (it would be renamed across different templates, even non-related ones)