Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio -> wrap every parameter

Using Visual Studio 2019, I found a really useful refactoring option in 'Quick actions and refactoring': (might comes from PowerTools, whatever)

enter image description here

I just wondered how:

  • I can make this wrapping settings a default formatting settings
  • Or apply this formatting on my whole solution at once (without resharper)

For the later, a solution with Visual Studio Code would be perfect as well !

Thanks for your help

like image 400
Mose Avatar asked May 15 '19 09:05

Mose


People also ask

How to wrap text and code in Visual Studio Code?

1. Go to File > Preferences > Setting (Windows) or Code > Preferences > Settings (macOS). 2. Type word wrap in the search field and you will see the search results immediately. 3. Select on from the drop-down. Your settings will be saved automatically. From now on, all documents opened by Visual Studio Code will wrap text and code by default.

How to wrap every parameter in a list in Python?

Place your cursor in a parameter list. Press Ctrl +. to trigger the Quick Actions and Refactorings menu. Select Wrap every parameter to accept the refactoring. What: Lets you wrap binary expressions.

What is word-wrap for Visual Studio?

To eliminate those disappearing lines on the demo computer we use in the course, he turned on word-wrap for Visual Studio. This choice keeps all of the code on the screen by wrapping long lines of code back to the left hand margin. If you like that idea, it's easy to turn on that option.

How do I wrap a call chain in Visual Studio?

Place your cursor in any of the call chains. Press Ctrl +. to trigger the Quick Actions and Refactorings menu. Select Wrap call chain or Wrap and align call chain to accept the refactoring. This refactoring applies to: What: Lets you wrap, indent, and align parameters or arguments.


1 Answers

You can try using Rewrap extension which formats code, comments, and other text to a given line length (80 by default).

The main Rewrap command is: Rewrap Code / Comment, by default bound to Alt+Q. Put the text cursor inside a comment line, block or plain text paragraph and invoke the command to wrap. You can also select just a few lines, or multiple comments in one selection.

There is currently an Open request for this in the VS Code Issue tracker on GitHub

like image 136
Tomer Avatar answered Nov 05 '22 17:11

Tomer