TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Microsoft DevBlog: How to Write a Roslyn Analyzer

12 pointsby DDerTypabout 5 years ago

2 comments

Nelkinsabout 5 years ago
Analyzers (but not Roslyn-based) can also be created for F# code using <a href="https:&#x2F;&#x2F;github.com&#x2F;ionide&#x2F;FSharp.Analyzers.SDK" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ionide&#x2F;FSharp.Analyzers.SDK</a>.<p>Here&#x27;s a cool example that type checks SQL statements embedded in your code as you go: <a href="https:&#x2F;&#x2F;github.com&#x2F;Zaid-Ajaj&#x2F;Npgsql.FSharp.Analyzer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Zaid-Ajaj&#x2F;Npgsql.FSharp.Analyzer</a>
valleyjoabout 5 years ago
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.