Resharper compile time autoformat incorrectly changes code
Asked Answered
E

0

0

Resharper changes below code

string strTest = "Test";
string strTest2 = "Test2";

to this

string strTest = "Test";string strTest2 = "Test2";

if cursor is at the end of the first line when I start project. It makes all breakpoints obsolete ("The breakpoint will not currently be hit. The source code is different from the original version.")

And sometimes it mixes comment line with code line and completely breaks execution. For instance:

//Comment line
string strTest = "Test";

changes to

//Comment linestring strTest = "Test";

If cursor is between double quotes it doesn't modify code. If I suspend ReSharper plugin code doesn't change on compile time so I am pretty sure that ReSharper has some problems. I tried disabling formatting on ReSharper options but it still modifies code.

How can I disable this feature? Other formatting options seems ok (Both VS and ReSharper) so if I just disable compile time auto corrections it will be ok. I couldn't find any option for this.

PS: I use VS2013 with VSCommands for VS2013 extension. ReSharper version is 10.0.2.

Solution: As @Alexander mentioned it is related to DevExpress components. Emptying the licences.licx file contents and restarting visual studio/Clean&Rebuild project resolves the issue. This prebuild-event script solves the issue.

break>$(ProjectDir)\Properties\licenses.licx
Escapee answered 25/12, 2015 at 8:57 Comment(10)
Are you sure it is done by resharper? Which version?Stereochromy
I can not reproduce it using VS2015U1 and Resharper 9.2Stereochromy
@dotctor I am sure ReSharper is guilty because if I suspend it I don't have any problem. I use ReShaper 10.0.1, I've updated ReSharper to 10.0.2 and I still have this problem.Escapee
Downgrade it to 9.* and wait for the fixStereochromy
@dotctor thanks. I will try that if nothing helps.Escapee
Have you tried to submit a bug via menu RESHARPER -> Help -> Report a Bug or Submit Feedback?Lindley
Do you have DevExpress components installed? If so, it is a known issue youtrack.jetbrains.com/issue/RSRP-402877 and there is a workaround in comments.Salpa
@Alexander yes I've also DevExpress. I am checking the solution. If this is the case where should I submit bug report? DevExpress or ReSharper?Escapee
@Alexander thank you. You are my hero. It is resolved.Escapee
@Turker Tunali, ReSharper team has already had a bug report (YouTrack ticket I mentioned above), so you do not need to submit another one. Glad to hear the workaround helped you.Salpa

© 2022 - 2024 — McMap. All rights reserved.