Chop long line?

For long lines (in C#) I used to be able to use the quickfix “Chop Long Line”. I would have liked this option all of the time instead of just if a line was long; but now it seems that the option is gone even for long lines?

Is there still a way to “chop” a line?

It should turn something like this:

public MyClass(Param1 param1, Param2 param2, Param3 param3, Param4 param4, Param5 param5) {

Into something like this:

public MyClass(
   Param1 param1,
   Param2 param2,
   Param3 param3,
   Param4 param4,
   Param5 param5
) {

It doesn't have to be exactly like that but it should at least roughly stack the parameters. Is there a way to invoke this still or is “chopping” not something we can do anymore?

Thanks

0
2 comments

Hello Dave Cousineau,

You can chop an arbitrary line under Reformat and cleanup → Reformat selection. Please note that the line should be selected for this option to appear.

Regrettably, this action is not available as a shortcut. Please feel free to vote for RSRP-468373 to demonstrate your interest.

 

However, Chop Long Line action should be available for lines exceeding Settings | Editor | Code Style | C# → Hard wrap at.

If this is not the case in your environment, please let us know.

 

0

Thanks, that helps a lot. The spacious format works. 

Checking my settings, on 3 layers ‘Hard wrap at’ was set to 120 and for some reason 1 layer had it set to 620, so that was I guess why I was never getting it as a quick fix option. I changed it to 120 on the fourth layer and now it is working again.

Thanks

0

Please sign in to leave a comment.