Visual Studio Code "editor.showUnused": true not working

Viewed 248

I'm trying to make Visual Studio Code detect unused Python imports. One of the ways is to type "editor.showUnused": true into the setting.json file.

{
    "editor.showUnused": true
}

But it just doesn't work for me, even if I reloaded VSCode. I also went into VSCode settings and checked the box for "control fading out for unused code", which also did not work.

PyCharm automatically fades out unused imports. Is there a way to do the same in VSCode?

1 Answers

{"editor.showUnused": true} is VS Code default setting. The value controls fading out of unused code and decides if the unused modules are displayed solidly: enter image description here enter image description here

To fix your question, you can reset the VS Code. Delete everything between the two curly braces in User settings.json, save the file, and VS Code will go back to using the default values.

If the question still exists, it's recommended to uninstall VS Code completely:

Delete all settings: turn to directory \userfolder\AppData\Roaming\Code and delete the whole folder.

Delete all extensions: \userfolder\.vscode\extensions and delete the whole folder.

Then install VS Code again.

Related