Shockah / Nickel

A modding API / mod loader for the game Cobalt Core.
Apache License 2.0
3 stars 5 forks source link

Analyzer for direct `Spr`/`UK` member access #84

Closed Shockah closed 1 month ago

Shockah commented 6 months ago

Write a C# analyzer for direct Spr/UK member access, as part of the ModBuildConfig package. The analyzer should throw a warning when a member is accessed that way (for example, Spr.icons_ace), but not when used in any other way (Enum.Parse<Spr>("icons_ace") or nameof(Spr.icons_ace).

Shockah commented 6 months ago

This could come in handy: https://github.com/Pathoschild/SMAPI/blob/develop/src/SMAPI.ModBuildConfig.Analyzer/NetFieldAnalyzer.cs