-
Notifications
You must be signed in to change notification settings - Fork 646
Rename fails when "---" is anywhere in the file #968
Comments
@riosdavi We havent changed anything in the rename area in quite a while. The rename feature works by parsing the diff returned by the Based on your description, looks like there is mistake with parsing. Can you change the "--- Update" to just "-- Update" and try again? My guess is that https://github.com/Microsoft/vscode-go/blob/master/src/diffUtils.ts#L175 is messing up your scenario. |
@ramya-rao-a thanks for your quick reply. Effectively, replacing "---" by "--" solved the issue but I think a better algorithm should be used to detect |
@riosdavi Of course, a better logic is needed. I just asked you to to the replacing to confirm that https://github.com/Microsoft/vscode-go/blob/master/src/diffUtils.ts#L175 indeed is the root cause. Nevertheless, that was put in place as a workaround for a bug in the diff module which has since been fixed, so I can remove that check altogether. Thanks for reporting the issue and confirming my hypothesis. Fixed with 1adae1f The fix will be out in the next update which should be after about 2 or 3 weeks |
The fix is now available in the latest update (0.6.62) |
Provided the following code:
Renaming
device
tosoDevice
causes the following refactoring, where line4 (blank line) is replaced by a duplicate of line 5 with the old variable name (device
), and lines 8, 9 and 10 are replaced bylogger.Debug("Index
:Removing line 4 (empty line) causes the line 5 not being duplicated after the refactor but the result is almost the same.
Note: after removing the logging lines (
logger.Debug
andlogger.Error
), renaming worked as expected.The text was updated successfully, but these errors were encountered: