Re-Sharper code formatting issue: Adding spaces and Line-Wrapping

Please look at the StackOverflow page I've created for this question:
http://stackoverflow.com/questions/26536171/re-sharper-code-formatting-issue-adding-spaces-and-line-wrapping?noredirect=1#comment41705375_26536171

Here is the unformatted version:

On code cleanup, this:

<a onclick='DisplayScheduleNowPopup(@Model.Contract.ContractId, false)'>Schedule Now</a> 


Turns into:

<a onclick=' DisplayScheduleNowPopup(@Model.Contract.ContractId, false) '>Schedule Now</a> 


The spaces are added and it is causing problems. I'm using MVC Razr.

Also, on C# I would like Chop on Object Initilizer, so I have it set to chop always and it works fine. However, it turns out ridicoulous on MVC razr. For example: Wrap object and collection Initializer (Chop always):


@using (Ajax.BeginForm("UpdateReservation", "Reservations", new
{
    temp = false
}, new AjaxOptions
{
    OnSuccess = "ReservationUpdateSucceeded",
    OnFailure = "ReservationUpdateFailed",
    LoadingElementId = "loadingDiv"
}, new
{
    id = "reservationScreenForm",
    @class = "custom form"
}))

Anyway to have Resharper either: ignore "Chop always" on Views.cshtml, or select "Simple Wrap" for views, while remaining "Chop Always" for C#.
Any ideas on how to solve these problems?

2 comments
Comment actions Permalink

Hello

  Thanks for contacting us.

  Concerning the first issue: There is a similar ticket it YouTrack https://youtrack.jetbrains.com/issue/RSRP-339299. You are weclome to comment it.

  Concerning the second one: I filed a new ticket to YouTrack https://youtrack.jetbrains.com/issue/RSRP-426877.

Thanks!

0
Comment actions Permalink

Thanks for that!
For the 2nd one (Code Initialization Formatting), an option to "Do Not Change" would be just as good. Right now, if I select "Chop", my C# remains fine but Razr turns out crazy looking. If I choose Simple Wrap, Razr is fine but I don't like the way C# code turns out. An option to Ignore these formatting and not change anything will also be able to fix this problem.

0

Please sign in to leave a comment.