Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Microsoft DevBlog: How to Write a Roslyn Analyzer (devblogs.microsoft.com/dotnet)
12 points by DDerTyp on March 5, 2020 | hide | past | favorite | 2 comments


Analyzers (but not Roslyn-based) can also be created for F# code using https://github.com/ionide/FSharp.Analyzers.SDK.

Here's a cool example that type checks SQL statements embedded in your code as you go: https://github.com/Zaid-Ajaj/Npgsql.FSharp.Analyzer


My team wrote an analyzer to prevent use of DateTime.Now and enforce DateTime.UtcNow instead. Helps us prevent weird time bugs. Neat stuff. The code for it took me a while to get used to, lots of strange looking syntax and types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: