Wrap and align html attributes when line reaches wrap-line-length
See original GitHub issueDescription
I would like to get the combination of the power of :
"wrap-attributes": "force-aligned",
"wrap-line-length": 120
If my line reaches the wrap-line-length, it should wrap the whole line and align them with the previous line.
Input
The code looked like this before beautification:
<p-dataTable
[value]="data"
[(selection)]="selectedRows"
(selectionChange)="onSelectionChange($event)"
[editable]="editable"
[selectionMode]="settings.selectionMode"
[resizableColumns]="settings.resizable"
[reorderableColumns]="settings.reorderable"
responsive="true"
scrollable="true"
scrollHeight="550px"
[lazy]="settings.lazy"
[totalRecords]="totalRecords"
[paginator]="settings.paginator"
[rows]="settings.paginator?.rowsPerPage || 10">
</p-dataTable>
Expected Output
The code should look like this after beautification with that feature:
<p-dataTable [value]="data" [(selection)]="selectedRows" (selectionChange)="onSelectionChange($event)" [editable]="editable"
[selectionMode]="settings.selectionMode" [resizableColumns]="settings.resizable" [reorderableColumns]="settings.reorderable"
responsive="true" scrollable="true" scrollHeight="550px" [lazy]="settings.lazy" [totalRecords]="totalRecords"
[paginator]="settings.paginator" [rows]="settings.paginator?.rowsPerPage || 10">
</p-dataTable>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Visual Studio Code - force code formatting to wrap attribute ...
So expected behavior is to have line wrapped when the max length of the line is exceeded. However I do not want to...
Read more >Getting rid of VSCode's attribute wrapping in HTML files
The default value for wrapAttributes is auto , which instructs VSCode to wrap attributes when a certain line length is exceeded. The line...
Read more >VS Code Setting: html.format.wrapAttributes - YouTube
Want to master VS Code? Click here: https://andrecasal.com/courses/mastery-for-vs-codeWant to upgrade web dev skills?
Read more >Options - Prettier
Print Width. Specify the line length that the printer will wrap on. For readability we recommend against using more than 80 characters: In...
Read more >User and Workspace Settings - Visual Studio Code
inherit: Lines will wrap according to the `editor. ... HTML support for the custom HTML tags, attributes and attribute values you specify in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A side note on this: I was actually looking for the combination of those two settings, but now like the proposed example. What I need is that VSCode leaves attributes alone, and when the element becomes longer than 120, it will allign the attributes on new lines, so what I would want is the following:
to:
Notice the second input, where it should leave the attributes alone, because they are not longer than 120 characters + they are already aligned.
So what I would like to see is instead of a force, make sure they are aligned when on multiline, and put them multiline when the line goes over 120 characters.
This is highly desired. @cheerypick are you still planning on making a PR for this?