Firstly, the shadowing of variables in one area is not an error or something that should be disabled. As Joel Muller claims to be legitimate, useful, and common .
Per MSDN
At any level of visibility, except for the module area, it is not an error to reuse the value or function name. If you reuse the name, the declared name is later shadowed by the name previously declared.
Syntax Coloring Function for Visual Studio F # Power Extension Tools will display the current valid variable and show shaded variables as light gray. eg.

The extension can be installed from the Visual Studio menu.
Tools β Extensions and Updates
As soon as the Select Visual Studio Gallery dialog box opens
In the upper right search box, type F # Power Tools
Since I already installed it, the installation option is not displayed.

This feature can be activated from the Visual Studio menu.
Tools β Options β F # Power Tools β General β Coloring Syntax β Gray Unused Ads

With the option turned off:

with option:

Note. After changing the option, the source file must be closed and then opened again for the changes to take effect. For this, Visual Studio does not need to be restarted, but it will have the same effect.
Thanks to Ringil for notifying me of my previously invalid statement.
Note from source:
Delete unused ads
Unused non-public types, methods, functions and values ββare currently being checked. Beware that this function is 100% reliable when the code does not have a type error. This setting is available in the general options. By default, it is disabled because there may be performance issues with large files.
F # Power Tool Functions List
Guy coder
source share