How to switch on CodeLens in Visual Studio 2017?
If you like CodeLens you can install Visual Studio 2019 Community
Microsoft has enabled it even for the Community edition. See Integrated Development Environment on Visual Studio Comparison. Most features are enabled.
See CodeLens for Everyone What's New in Visual Studio 2019 for more info.
Visual Studio Community dose not support CodeLens , only Visual Studio Professional and Visual Studio Enterprise give this Integrated Development Environment Facility. For more information go to this link enter link description here
For Visual information Please See this Image: Visual Studio Community supported Features
CodeLens is not available in the Community editions. You need Professional or higher to switch it on.
In VS2015, one way to "get" CodeLens was to install the SQL Server Developer Tools (SSDT) but I believe this has been rectified in VS2017.