What is the Vscode configuration responsible for the check system (deselect in the case) the unused variables yet?

Asked

Viewed 37 times

1

Vscode by default leaves the line of code with less opacity where it has some variable, or import which has not been "called" in the code yet. When I install a Theme I downloaded it disables this function. In the settings.json, which code line is responsible for that function?

I believe it’s in one of the editor’s roles, but I haven’t located which one.

Someone has a solution?

"breadcrumbs.enabled": true,
"editor.renderControlCharacters": false,
"editor.tabSize": 2,
"editor.renderLineHighlight": "line",


"editor.detectIndentation": true,
"editor.snippetSuggestions": "top",
"editor.wordBasedSuggestions": false,
"editor.suggest.localityBonus": true,
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.formatOnPaste": false,
"editor.linkedEditing": true,
"editor.glyphMargin": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.lineHeight": 25,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll": true

I believe you’re in one of these, but I haven’t found the right one... (I don’t know the name of this code identification function yet not called).

1 answer

2


Based on this reply from Soen, you can change JSON by adding the following value to "editorUnnecessaryCode.border" within the workbench.colorCustomizations:

"workbench.colorCustomizations": {
    "editorUnnecessaryCode.opacity": "#fff"
}

The above code removes code opacity:

  • Disabled (without the code of opacity JSON above)

var weather2 unused in the code

inserir a descrição da imagem aqui

  • Activated with the code above:

var weather2 unused in the code

inserir a descrição da imagem aqui

It is possible to add a underline with a certain color for variables not used in the code, using "editorUnnecessaryCode.border": "#fff", for a white color, for example:

var weather2 unused in the code

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.