Opened 10 years ago

Closed 10 years ago

#655 closed defect (fixed)

Lexical Rename of Variable - Can't rename to a variable iwth an underscore in it

Reported by: waxhead Owned by: patrickas
Priority: major Milestone:
Component: editor Version: 0.47
Keywords: Cc:


This bug appears to occur when an underscore is in your new variable name:


my $inner;

gets renamed to $inner_derivitive

This is what happens:


using just $_derivitive renames it to $_derivitive.

Attachments (1)

Change History (4)

comment:1 Changed 10 years ago by patrickas

  • Owner changed from azawawi to patrickas
  • Status changed from new to accepted

The attached file resolves this issue but it may introduce other bugs since I am not sure I understand the code that follows it, it seems to me we already replaced the variable because $node->isa("PPI::Token::Symbol") so we should make sure we don't enter the other cases especially $node->isa("PPI::Token") and replace again.

If there are actual cases where we should execute code for both conditions and attempt both replacement this patch will introduce a regression.

comment:2 Changed 10 years ago by Sewi

Applied in r9180

comment:3 Changed 10 years ago by patrickas

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.