Desired Razor Formatting changes
- Be able to stop aligning to the right.
Here is a sample of how I like to format.
<SfGrid DataSource=@Contacts AllowPaging=true Toolbar=@Toolbaritems>
<Syncfusion.Blazor.Data.SfDataManager Json=@Contacts></Syncfusion.Blazor.Data.SfDataManager>
<GridEvents CommandClicked=OnCommandClicked TValue=ContactDto> </GridEvents>
<GridEditSettings AllowAdding=true AllowDeleting=true AllowEditing=true [email protected]></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(ContactDto.FirstName) HeaderText="First Name"></GridColumn>
<GridColumn Field=@nameof(ContactDto.LastName) HeaderText="Last Name"></GridColumn>
<GridColumn Field=@nameof(ContactDto.Email) HeaderText="Email"></GridColumn>
<GridColumn Field=@nameof(ContactDto.Phone) HeaderText="Phone"></GridColumn>
<GridColumn HeaderText="Actions" TextAlign=TextAlign.Center Width="150">
<GridCommandColumns>
<GridCommandColumn
ButtonOption=@(new CommandButtonOptions() { IconCss ="e-icons e-edit"})
Title="Edit"
/>
<GridCommandColumn
ButtonOption=@(new CommandButtonOptions() { IconCss="e-icons e-delete"})
Title="Delete">
</GridCommandColumn>
</GridCommandColumns>
</GridColumn>
</GridColumns>
</SfGrid>
But currently the formatter will change this to the following.
<SfGrid DataSource=@Contacts AllowPaging=true Toolbar=@Toolbaritems>
<Syncfusion.Blazor.Data.SfDataManager Json=@Contacts></Syncfusion.Blazor.Data.SfDataManager>
<GridEvents CommandClicked=OnCommandClicked TValue=ContactDto> </GridEvents>
<GridEditSettings AllowAdding=true AllowDeleting=true AllowEditing=true [email protected]></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(ContactDto.FirstName) HeaderText="First Name"></GridColumn>
<GridColumn Field=@nameof(ContactDto.LastName) HeaderText="Last Name"></GridColumn>
<GridColumn Field=@nameof(ContactDto.Email) HeaderText="Email"></GridColumn>
<GridColumn Field=@nameof(ContactDto.Phone) HeaderText="Phone"></GridColumn>
<GridColumn HeaderText="Actions" TextAlign=TextAlign.Center Width="150">
<GridCommandColumns>
<GridCommandColumn ButtonOption=@(new CommandButtonOptions() { IconCss ="e-icons e-edit"})
Title="Edit" />
<GridCommandColumn ButtonOption=@(new CommandButtonOptions() { IconCss="e-icons e-delete"})
Title="Delete">
</GridCommandColumn>
</GridCommandColumns>
</GridColumn>
</GridColumns>
</SfGrid>
https://www.loom.com/share/e1f8b29ca5b8471d91486252e7f03822
- be able to stop quotes being inserted after entering
=
https://www.loom.com/share/5e581760aac841b789889099e747da98
- Be able to turn off all formatting. (For times when it just doesn't do what the user wants)
3 will be good for me, because I like to double-indent parameters when the control has child elements
<MyControl @ref=abc
A=1
B=2
C=3>
<ChildThing/>
</MyControl>
- Respect .editorconfig settings.
https://www.loom.com/share/9e7e193541f24005a1a2729029986efc
👍 turning off auto format on type is tracked by https://github.com/dotnet/razor/issues/4336 (and completed in 17.6!) 👍 .editorconfig support is tracked by https://github.com/dotnet/razor/issues/4406
Thanks for the feedback. Feel free to log as many new issues as you like, it is easier for us to track things separately than in one big issue.