vim-ruby-refactoring icon indicating copy to clipboard operation
vim-ruby-refactoring copied to clipboard

:RInlineTemp substitutes variable names in comments

Open mcary opened this issue 9 years ago • 0 comments

Thanks for taking a stab at this refactoring plugin, @ecomba.

When I have comments within the method talking about domain concepts, the temp variable's value gets inlined there as well:

def foo
  user = User.find
  # Update the user's timestamp?
  user.save!
end

with cursor on user = ..., when I run :RInlineTemp, I get:

def foo
  # Update the User.find's timestamp?
  User.find.save!
end

Note how the comment was altered.

I would like comments to not be updated. In some cases where the comment is actually code, it could make sense, but generally I don't think the refactoring tools should manipulate comments.

mcary avatar Oct 12 '16 21:10 mcary