[511] Linked files refactoring very broken
Noticed this one on the weekend which is a really nasty one. If you link a source code file in two projects in your solution, the parser gets very confused until you reopen the solution. That i can live with.
However the serious problem is that if you perform a rename refactoring in the IDE on a method in that file then part way through the renaming it appears Resharper tries to open the other "link" of the file in the IDE and VS throws an error about the file already being open. Resharper doesn't roll back the refactoring and so you get left with a mess in your codebase as all the usages have not been updated but some code has been...
Regards,
Grant.
Please sign in to leave a comment.
Hello Grant,
unfortunately, that's true - linked files are poorly supported by ReSharper's
refactorings. There's even
a request for this: http://www.jetbrains.net/jira/browse/RSRP-43738
However, I'd like to learn more about the first part of your post. Could
you please clarify what you mean
under 'the parser gets very confused until you reopen the solution'?
Thanks.
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Hi Dimitry,
Well, definitely +1 for the request then mate, it's pretty brutal how it behaves currently leaving the code in a right mess.
By my first comment I meant that the parser would "go red" when looking at certain class files indicating problems where there weren't any (i.e. the code compiled just fine, but the R# parser insisted that there were issues with various method names not being found).
Sorry I know I'm being a bit vague but I had this happen numerous times yesterday when linking some files in. After I figured out that closing and reloading the solution stopped Resharper getting confused I didn't really pay any attention to the exact steps to produce this.
I can tell you that in my solution, one of the projects contained the "original" class file (non-linked). I then added two other projects to the solution, and linked that same class file into them. Off the top of my head now I cant recall whether it was the linked file itself or one of the referring classes in the solution using that linked class that changed to "a sea of red" - I suspect it was the latter. If I get time to repro it tonight I will let you know the steps...
Grant.