[Fixed] Detect unused methods – Visual Studio Code

Issue

Is there a way to detect unused methods in a typescript file (Angular) in Visual Studio Code?
I’ve tried a couple of plugins for Angular but in vain.
Web Storm used to grey out the unused methods by default. Looking for a similar thing in VS Code.

Solution

It is currently not possible to detect unused public methods in VSCode (you can check for updates here). However, if it’s a private method, you can mark it as private and VSCode is able to look for whether it is used or not within the scope (although do remember: methods used in the HTML template are public).

If the public method checks are important for you, you’ll have to either wait, or contribute to the VSCode community. I still use VSCode but if it is a necessity for you, just switch to WebStorm for the moment.

Leave a Reply

(*) Required, Your email will not be published