Visual Studio Code (VS-Code) References & Implementations CodeLens
Refactoring or removing technical debt from the codebase is an integral and unsaid responsibility of any software engineer. The refactoring process comes with its challenges and pain points. This process can be time-consuming, cumbersome, and error-prone in a huge code base.
As all software engineers are humans, mistakes are natural. To reduce certain pain points of the developers while refactoring the code Visual Studio Code (VSCode) comes with a very friendly setup. This setup enhances the developer experience and helps developers to either refactor or reduce technical debt with ease.
References CodeLens
The TypeScript references CodeLens displays an inline count of references for classes, interfaces, methods, properties, and exported objects
In the above image, one can see "2 references" just above the method's name, suggesting that this method is being referenced twice the complete code base.
Setting "typescript.referencesCodeLens.enabled": true
Clicking on the reference count will provide a quick preview of the references
Implementation CodeLens
The TypeScript implementation CodeLens displays the count of implementors of an interface
Setting "typescript.implementationsCodeLens.enabled": true
As with the references CodeLens, one can click on the implementation count for a quick preview of all implementations.
Conclusion
References & Implementations CodeLens are two special features provided by VS Code to speed up the development process and to provide a good developer experience
Let’s sit together to find new interesting and efficient ways to make the development process efficient, effective, and a cakewalk.
Happy Coding :)