In VS I set the FS0025 warning (Incomplete pattern matches on this expression) to be treated as an error so I can’t compile the code if I’ve missed something. (I can’t remember how I did it in VS.)
However, I can’t figure out how to make VS Code do the same thing.
I’ve searched the “File → Preferences → Settings” for ‘error’ and ‘warning’ but can’t find anything.
I’ve looked at various articles and references on the web but can’t find anything which matches (pardon the pun) my requirements, the answers are usually for either C# or VS but not F# and VS Code.
I’d like this setting to be automatically applied to all of my previous, current and future F# projects but not any other type of project.
Is it possible to do this without having to (remember to) add <WarningsAsErrors>FS0025</WarningsAsErrors> into each fsproj file?
Note: I don’t really want to go ‘messing around with the compiler’ if I don’t have to as I’m not confident enough to do it and remember that I’ve done it and back-out the changes if it causes problems down the road.
Thanks for your reply Martin521 (and welcome to the community by the way).
Unfortunately I don’t know what Directory.build.props is, or where it is, or what it does (I’ve looked and didn’t find anything like that).
I think I would prefer to add that line into the fsproj file for each project, if I had to do anything like that, but, as mentioned in my original post, I would prefer not to have to remember to do it for every project.
Hopefully something will come from the PR as mentioned above.
Directory.Build.props work hierachical and quite practical. if you have multiple different solutions in one repo and they also may have different net versions. Then you can enable or disable features through that file.