Is there a way to highlight lines longer than Hard Wrap?

Is there a way to highlight lines longer than the Hard Wrap configuration in Code Style? The visual guide is not enough for this because Inlay Hints can make a line look much longer than it actually is.

5 comments
Comment actions Permalink

Hello Sergey,

Thank you for contacting Rider Forum.

Can you please share visual example of the case you are referring to? 

Thank you in advance! Looking forward to hearing from you soon.

0
Comment actions Permalink

Hello Anna Morozyuk,

Here's my demo code with inlay hints enabled. There are two lines which look like they exceed the maximum line length specified in the code style, but there is no way to tell for sure.

Disabling inlay hints makes it clear that the longest line above actually fits the code style while the other doesn't:

This is the hard limit setting I'm talking about.

0
Comment actions Permalink

Hello Sergey,

Thanks for the detailed explanation.

It might be that in that case Code Cleanup may help you keeping Hard Wrap under control. 

If that is not suiting you by any means, can you please explain your use-case in more details? Why highlighting in the editor itself is important? 

Looking forward to hearing from soon. 

0
Comment actions Permalink

Hello Anna Morozyuk,

I never really trust automatic formatting, especially in legacy code where a blind reformat would be a code review disaster. I prefer to choose myself where and how to break a long line.

Most often, long lines are a result of refactoring, either because an identifier got longer, or because new arguments were added to a call. Such changes can be peppered across a large file which would be unwise to reformat in its entirety, and where may be only a few places needing attention.

0
Comment actions Permalink

Hello Sergey,

Thank your reply! 

i have created a new feature request: RIDER-86442.Please upvote it to increase awareness and press the Watch issue button to receive updates on the matter. 

Have a nice day! Should you gave any further questions - please let me know.

0

Please sign in to leave a comment.