You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to request an improvement to Typescript support: highlighting of unused symbols.
Refactoring and moving things around between files often leads to a lot of manual analysis, for example to find imports that are no longer in use.
This doesn't need to be a big, complex feature - I don't expect this to trawl through the entire codebase and figure out what is or isn't in use.
I'd be happy with just file-local highlighting - e.g. gray out variable and constant declarations if they aren't exported or used in any expression or statement anywhere in the file.
Thank you for your feature request! We have discussed this internally and have considered adding it soon.
Reacted by daniel baak, harishkswamy, Dave Chambers, Dmitri, Thomas Prochazka, Julio Cezar Silva, Sergey Kryvets, Garen Yondem, Pierre de Soultrait, Tom Bertrand and 6 more
Webstorm has it and it is really really handy! Would love to have it in VSCode for TypeScript and JavaScript.
Reacted by synthao, Michael Ovchinnikov, Pierre de Soultrait, Dmitri, Cedric, e1024kb, Julio Cezar Silva, Sergey Kryvets, Serhii Siryk, Garen Yondem and 6 more
Sorry if that's not the right place to ask this, but is this being implemented anytime soon (local unused variables)? It would be a huge improvement IMO. This is the only reason that makes me consider switching to WebStorm, though I really enjoy VS!
Storm is generally awful at Typescript, but yes, I occasionally find myself opening Storm just to check for unused symbols. Would be great to have this.
Reacted by Angelia, Dmitri, Pierre de Soultrait, Bartlomiej Bluszcz, Alyssa LaVeck and Matt Ma
Reacted by Sam Blowes
Reacted by Jianchun Wang, 青Cyan and Pierre de Soultrait
Activity
mindplay-dk commentedon Nov 18, 2016
If possible, in addition, a right-click option to clean up unused symbols would be useful :-)
waderyan commentedon Nov 22, 2016
Thank you for your feature request! We have discussed this internally and have considered adding it soon.
[-]Typescript, feature: highlight unused symbols[/-][+]Highlight unused symbols[/+]jschlieber commentedon Feb 3, 2017
Webstorm has it and it is really really handy! Would love to have it in VSCode for TypeScript and JavaScript.
mjbvz commentedon Feb 11, 2017
Related API request #20219
mjbvz commentedon Apr 3, 2017
#23805 Notes that we could also investigating graying out unreachable code
PDS42 commentedon Jun 22, 2017
Sorry if that's not the right place to ask this, but is this being implemented anytime soon (local unused variables)? It would be a huge improvement IMO. This is the only reason that makes me consider switching to WebStorm, though I really enjoy VS!
mindplay-dk commentedon Jun 23, 2017
Storm is generally awful at Typescript, but yes, I occasionally find myself opening Storm just to check for unused symbols. Would be great to have this.
16 remaining items
itsdevdom commentedon Mar 21, 2018
Also: https://twitter.com/mattbierner/status/976548673457856512?s=19
mjbvz commentedon Mar 23, 2018
Depends on microsoft/TypeScript#22361
As already noted, you can already enable this using settings in your
jsconfig/tsconfig. This issue specifically is now tracking:Allowing this you to see unused symbols even when you don't have a
jsconfigortsconfigand have not configured these settingsPossibly presenting unused symbols in a different way. Graying out these symbols is one idea
Introduce experimental fade out of unused variables
Add unused diagnostic subtype
Add unused diagnostic subtype
Add unused diagnostic subtype (#49646)
carpet92 commentedon Jun 24, 2018
Is this works only for JavaScript and TypeScript?