Opened 4 years ago

Last modified 4 years ago

#996 new enhancement

refactoring: renaming of hash keys

Reported by: zenogantner Owned by:
Priority: minor Milestone:
Component: Refactoring Perl 5 Version: 0.69
Keywords: refactoring, hash key, rename Cc:

Description

Another nice refactoring feature would be the renaming of hash keys in the current scope.

E.g. you want to rename the key 'replace' to 'replace_button' in the following code:

	# The "Replace" button
	$self->{replace} = Wx::Button->new(
		$self,
		Wx::wxID_REPLACE,
		Wx::gettext("&Replace"),
	);
	Wx::Event::EVT_BUTTON(
		$self,
		$self->{replace},
		sub {
			$_[0]->replace_button;
		}
	);
	Wx::Event::EVT_CHAR(
		$self->{replace},
		sub {
			$self->hotkey( $_[1]->GetKeyCode );
		}
	);
	$self->{replace}->SetDefault;

Then having this rename-feature would come in handy, and it would be nicer to use than the normal 'search and replace' function.

The functionality could be integrated into one action 'rename' that renames several other things like variables, subroutines, or modules.
Having a menu entry and a context menu entry for the one action won't make the user interface more complicated, just more consistent.

Change History (1)

comment:1 Changed 4 years ago by szabgab

  • Component changed from advanced perl tools to Refactoring Perl 5
Note: See TracTickets for help on using tickets.