Repository navigation
fix: upper-case Roslyn severity with the invariant culture - #1420
Conversation
On a tr-TR editor "Warning".ToUpper() gives "WARNİNG", so the validate parser's ^(ERROR|WARNING|INFO): regex misses it and the diagnostic comes back as severity info, line 0.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughRoslyn diagnostic severity labels now use invariant-culture uppercase conversion in ChangesDiagnostic formatting
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Severity labels remain compatible with validation parsing and are now locale-independent. No actionable merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…oplayDev#1420) (cherry picked from upstream merge c040d6d)
Description
With
USE_ROSLYNdefined,ValidateScriptSyntaxRoslynbuilds each diagnostic as$"{severity}: …"withdiagnostic.Severity.ToString().ToUpper(). On an editor running under the Turkish (or Azerbaijani) culture"Warning".ToUpper()is"WARNİNG"and"Info"is"İNFO", so thevalidateaction's^(ERROR|WARNING|INFO): …regex doesn't match. The warning comes back as severityinfowithline = 0and the whole raw string as the message.ERRORhas noiin it, so errors were not affected.The fix uses
ToUpperInvariant(), like the other upper/lower-casing inManageScript.cs(ToLowerInvariant()forlevel,refresh,validate).Type of Change
Changes Made
MCPForUnity/Editor/Tools/ManageScript.cs: one line inValidateScriptSyntaxRoslyn.Compatibility / Package Source
Testing/Screenshots/Recordings
Related Issues
None open.
Additional Notes
The line sits inside
#if USE_ROSLYN, which the test project doesn't define, so neither the EditMode tests nor CI compile it. To check it I copied the diagnostic loop and thevalidateregex into a small console app against Microsoft.CodeAnalysis.CSharp 4.8.0 and fed it a file with a#warning:AI use: Claude Code found this, wrote the fix and the repro, and drafted this description at my request; the output above is from a real run on my machine.
Summary by CodeRabbit