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.
Rename refactoring should be able to perform in-place instant rename in file scope (and not only method and class scope). There are many occasions where, because of the framework in use or just the project structure, PHP files have a scope of their own and in-place instant rename would be a quicker and more importantly a faultless way to perform rename.
That's not true...you can have a file: <?php echo $foo; echo $foo + " another foo usage"; ?> and if you try to refactor $foo, then instant rename can't be used, because $foo can be declared in some another file...
(In reply to comment #1) > That's not true...you can have a file: > > <?php > echo $foo; > echo $foo + " another foo usage"; > ?> > > and if you try to refactor $foo, then instant rename can't be used, because > $foo can be declared in some another file... Short example: Kohana PHP framework -> views files -> variables in a local scope which seem in a global scope for netbeans.
Ok, so that's Kohana specific issue.
Ondrey Brejla, This is correct - rename would not be able to perform an instant rename on $foo and in most cases, this would be correct because, as you say, it could be used in another file. There are, however, cases where, because of the framework in use or just the project structure, it is known that the file has a scope of its own (for example a view file in Kohana PHP). In such cases, instant rename would be extremely helpful.
This is not at all Kohana specific. It is very likely that most PHP frameworks use files that have scopes of their own.
It's definitely framework specific...and it goes against PHP specification...so it has to be handled specificaly for every use case. Can't be handled globally.
How is this framework specific? What about simple apps that use a single PHP files? They use no framework and would still benefit from the feature. I'm not saying that regular, global scope, refactoring should be removed. It is very helpful and it should definitely remain in the IDE. What I'm saying is that there should be a way to use instant rename in file scope.
> What I'm saying is that there should be a way to use instant rename in file scope. And I say, Yes, but just in specific cases. Not globally :)
Also, how does it go against the specification of PHP? Does the specification say that you shouldn't have variables that are not used outside of the file they are defined in?
Yes, that's exactly what I'm saying and of course it makes sense in specific cases only, but even though they are specific, these cases are many enough to make a feature like this worth it. I hope you'd agree.
Do you think there is a chance for this feature to find a place in the IDE?
Yes, that's why I'm letting this opened ;) But really don't know when...sry.
One way of dealing with this is to have an extra action - Instant Refactoring, which would force a single-file refactoring scope. Developers which know that their framework is weird would use the Instant Refactoring instead of the normal one. They could assign their own hotkey, etc.
(In reply to dagguh from comment #13) > One way of dealing with this is to have an extra action - Instant > Refactoring, which would force a single-file refactoring scope. Developers > which know that their framework is weird would use the Instant Refactoring > instead of the normal one. They could assign their own hotkey, etc. This sounds like a great solution.
It's really useful feature! In view files (usually with .phtml extension) I do annoying refactoring by word replace. I propose to add two check-boxes to Rename dialog. One for infile rename, another for rename action using all open files in editor. Such feature will be great to most programmers. Thanks.
*** Bug 202886 has been marked as a duplicate of this bug. ***