ionide / ionide-analyzers

Home Page:http://ionide.io/ionide-analyzers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option.get analyzer

sheridanchris opened this issue · comments

I think an analyzer for Option.get that promotes the graceful handling of the None case by using functions like Option.defaultValue or pattern matching should be added. I'd like to create a PR for this if you believe this is a useful addition.

Hi Chris,

Thank you for this suggestion! We like it and would be happy to receive a PR for this 🥳!
Don't hesitate to ask any technical questions if you have any.

could / should there be something similar for ValueOption ?

Yeah, seems reasonable. Are you interested in submitting a PR?

Would probably be nothing more than adding an OR in if mfv.FullName = "Microsoft.FSharp.Core.Option.get" && args.Length = 1 then

I can have a go later if no one else gets to it first

commented

I think we should have the Option.Value analyzer from the SDK sample as well.