This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
If I select a method and press alt+enter I get the following choices Surround with if condition... Surround with begin When I select one of these choices, the IDE surrounds the selected method and should instead surround whole line. For example, I have this code: def deleteFirst @songs.shift end I select "shift", press alt+enter, and choose Surround with if condition... I get def deleteFirst @songs.if condition shift end end And I should get def deleteFirst if condition @songs.shift end end Tor wrote: Yes. I've been meaning to make this code smarter such that when you make a selection, it goes and looks at the parse tree and sees if each of the code snippets actually make sense before offering them. Would you mind filing an issue to track this?
This is fixed now. It won't offer surround-with quickfixes for partial code fragments like this. (It's now also better about listing code templates in code completion.)