2023-06-21

IDE feature sweetner

My most common IDE knows how to extract selected block of text as a function or method.1 Which is great even when it misses a couple of parameters and almost magic when it works exactly as intended. But I've enountered a problem in the current bit of legacy code in front of me: I need to extract a loop body that is more than six hundred lines long. Selecting the thing is enough of a pain as to present a barrier to getting anything done.

I could really use a feature to "select current loop body" or a extract variant like "extract loop body".

Ah! Ha! Found it!

In Qt creator go to move the index inside the block, then use menu item "Edit:Advanced:Select block down".


1 Well, usually. For some reason Qt creator occassionally just doesn't offer that option in the re-factor sub-menu. No idea what controls the availability.

No comments:

Post a Comment