You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently only the public function itself is moved when function is renamed to a new namespace.
If that functions references script local variables or functions, another (now manual) refactoring is necessary then.
It would help greatly if this plugin would take such references into account.
Detecting them is easy, as the mandatory s: prefix is easily detectable in the function body.
But what is the expected behaviour?
Move the script-local variable / function along with the renamed function? This will break other things, if other functions reference these, too.
Copy the script-local variable / function along with the renamed function? This will lead to (often unwanted) code duplication.
Inhibit the rename? This would make this plugin quite useless for functions referencing script-local variables / functions (which is likely the majority of functions). On the other hand it would be possible to force renaming by giving a bang (!) to the command.
Ask the user on what do to? This can easily get quite complex.
Also there could be a differentation between references to script-local variables / functions that are exclusive to the moved function (used nowhere else) and others that are also used in other places.
In the former case the script-local variables / functions can easily be moved along with the renamed function. The latter case is the complex one.
The text was updated successfully, but these errors were encountered:
Currently only the public function itself is moved when function is renamed to a new namespace.
If that functions references script local variables or functions, another (now manual) refactoring is necessary then.
It would help greatly if this plugin would take such references into account.
Detecting them is easy, as the mandatory
s:
prefix is easily detectable in the function body.But what is the expected behaviour?
Also there could be a differentation between references to script-local variables / functions that are exclusive to the moved function (used nowhere else) and others that are also used in other places.
In the former case the script-local variables / functions can easily be moved along with the renamed function. The latter case is the complex one.
The text was updated successfully, but these errors were encountered: