Microsoft Dev Blogs

Overhauled F# code fixes in Visual Studio

    thumbnail
    • This summer, the F# code fixes in Visual Studio received significant updates, improving the way errors and warnings are fixed automatically.
    • Each diagnostic in the code has a unique ID and location, usually indicated by a squiggly line.
    • Code fixes aim to automatically resolve these diagnostics to improve the code.
    • The challenge is to ensure that code fixes are precise and don't mislead developers by making undesirable modifications to the source code.
    • To improve the code fixes, the IcedTasks library was incorporated, which helped transition from regular expressions to more precise expressions in the fixes.
    • Traditionally, the testing of code fixes in Visual Studio relied on manual testing, but now a framework for unit testing has been implemented, allowing for more efficient testing of code fixes.
    • The framework allows for specifying examples of broken code and the desired fixed code, as well as instances where code fixes should remain inactive (negative testing).
    • There are still some issues to be resolved, and feedback and contributions from the community are welcome.
    • The progress and tasks related to code fixes can be tracked in a ticket, and there are some tasks suitable for newcomers to contribute to.