✅ Renaming members across a project

I had some generated classes that looked like this:
[MessagePackObject(true)]
public class AchievementList
{
public int achievement_id { get; set; }
public int progress { get; set; }
public int state { get; set; }
}
[MessagePackObject(true)]
public class AchievementList
{
public int achievement_id { get; set; }
public int progress { get; set; }
public int state { get; set; }
}
where the properties were named in snake_case, because the property name drove what was serialized. I've since decided to re-scaffold them using my script more like
[MessagePackObject]
public class AchievementList
{
[Key("achievement_id")]
public int AchievementId { get; set; }

[Key("progress")]
public int Progress { get; set; }

[Key("state")]
public int State { get; set; }
}
[MessagePackObject]
public class AchievementList
{
[Key("achievement_id")]
public int AchievementId { get; set; }

[Key("progress")]
public int Progress { get; set; }

[Key("state")]
public int State { get; set; }
}
but now obviously everywhere I've used this type won't compile. I now have approximately 8300 errors in my project and I think a simple find and replace won't save me - what are some options to fix the errors? I could possibly write a script to convert all snake_case names to pascal case?
9 Replies
Jimmacle
Jimmacle10mo ago
i know rider can refactor across projects assuming they're loaded in the same solution
dreadfullydistinct
dreadfullydistinctOP10mo ago
I guess the thing is the old name is gone, maybe I could abuse the naming rule violation warning to get it done?
Jimmacle
Jimmacle10mo ago
maybe, or just find and replace :when:
dreadfullydistinct
dreadfullydistinctOP10mo ago
So I checked out the old commit and instructed rider to fix my shit
dreadfullydistinct
dreadfullydistinctOP10mo ago
No description
dreadfullydistinct
dreadfullydistinctOP10mo ago
:when:
dreadfullydistinct
dreadfullydistinctOP10mo ago
No description
dreadfullydistinct
dreadfullydistinctOP10mo ago
No description
dreadfullydistinct
dreadfullydistinctOP10mo ago
Yah ok rider did the trick, now I just need to fix some type names with a shell script
Want results from more Discord servers?
Add your server