-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command to re-wrap code to respect a preferred line length column (e.g. 80 columns) #9514
Comments
@stkb Thanks. What is the distinction between features that should be added as a part of VS Code by default versus things which should be added as extensions? |
To paraphrase something @bpasero once said: if it can be done as an extension, it should be done as an extension. Of course, some (small) features that were once extensions do get added to vscode from time to time. |
For languages that have a formatter (above all, TypeScript), the wrapping behavior would also make sense as part of the formatter. Are there any plans for such a feature? |
+1 for having max line length as part of the formatter. I'm on a hunt for a Ideally my team would like a formatter (for ts/tsx) that handles an 80 col limit with the proper line breaks/indentation to make it look good. I'm looking at |
clang-format (http://probst.io/blog/2015/01/15/clang-format-for-javascript/) supports TypeScript and does intelligent wrapping. |
Thank you @evmar ! I will look into this |
+1 for having max line length as part of the formatter. Since it is included for html ("html.format.wrapLineLength"), why should it not be for js/ts etc.? |
FWIW, |
We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines. Happy Coding! |
For example, in Vim, you can select multiple lines of text and type
gq
and lines will be re-wrapped so that they don't exceed the setting for max line length (e.g. 80 columns).It would be nice to see a similar feature in VS Code especially for wrapping comments, which also has the behavior of correctly inserting a syntax-aware single-line comment token (e.g. //) at the beginning of each wrapped line (and not moving that token into the re-wrapped text of the same lines).
Would also like this functionality to respect the indentation level of the code.
The text was updated successfully, but these errors were encountered: