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
HTML: add an option to preserve manual wrapping of attributes #1125
Comments
This is a great idea, none of the options allow for wrapping manually. It would be great to have an option that would perform |
@Robula |
@bitwiseman no, just another option like "Force-Aligned" ... but instead "auto-aligned" What it should do, is simply to align all attributes that have been manually wrapped. |
@Montago - Ah, so more like |
yeah that makes sense :) |
bump for this! |
Would be great to manually have some attributes on a new line and some on the same line. Then i can decide which one i want and everything else is automatically formatted. Thanks |
@bitwiseman I don't think aligning is necessary, but if it is, there have to be two options - one to apply the usual indent_size, another to align — all while keeping the initial line breaks. Example <input type="text" class="form-control" autocomplete="off"
[(ngModel)]="myValue" [disabled]="isDisabled" [placeholder]="placeholder"
[typeahead]="suggestionsSource" [typeaheadOptionField]="suggestionValueField" [typeaheadItemTemplate]="suggestionTemplate" [typeaheadWaitMs]="300"
(typeaheadOnSelect)="onSuggestionSelected($event)" /> Forcing indentation only: <input type="text" class="form-control" autocomplete="off"
[(ngModel)]="myValue" [disabled]="isDisabled" [placeholder]="placeholder"
[typeahead]="suggestionsSource" [typeaheadOptionField]="suggestionValueField" [typeaheadItemTemplate]="suggestionTemplate" [typeaheadWaitMs]="300"
(typeaheadOnSelect)="onSuggestionSelected($event)" /> Forcing alignment only: <input type="text" class="form-control" autocomplete="off"
[(ngModel)]="myValue" [disabled]="isDisabled" [placeholder]="placeholder"
[typeahead]="suggestionsSource" [typeaheadOptionField]="suggestionValueField" [typeaheadItemTemplate]="suggestionTemplate" [typeaheadWaitMs]="300"
(typeaheadOnSelect)="onSuggestionSelected($event)" /> |
Not sure if this is the right issue to request this, but I feel like an Example <div [isWrapped]="false" [attributesAligned]="false"></div>
<really-long-angular-component-that-would-force-wrapping class="wrapped"
[isWrapped]="true"
[attributesAligned]="true"> |
Almost surfed 5 or 6 topics where people looking forward to this feature to be implemented. Since its not, it would be great to have this on vscode with if wrap requries and force-alignment for this corresponding row vs. 😞 |
@kaankucukx Not sure what you mean? Is it covered in previous examples? |
+1 for this, I currently have the best results with
and
I just need to preserve the newlines of manually newlined attributes, but get the correct indentation. |
FWIW this does not work in any editor, that I have found, except for Intellij. Would love to see this implemented though! |
Works in Netbeans as well. |
FWIW cannot get this working in VSCode |
@christoferd that's what this issue is about. It does not work. js-beautify is not capable of keeping the line breaks. It's going to always set it to one line. I keep going back to using WebStorm because they have their own formatter and it works with line breaks. |
Related to #1404 |
Thanks for working on a fix @MacKLess! I'm anxiously awaiting a new release, so I can try it out 😃 |
--wrap-attributes
option has these possible values:auto|force|force-aligned|force-expand-multiline
This allows to whether condense all attributes into one line or auto-wrap each of them.
Would it be possible to just maintain the initial wrapping?
The text was updated successfully, but these errors were encountered: