Skip to content

Test: gray out unused variables in js and ts #50487

@mjbvz

Description

@mjbvz

Test for #15710

Complexity: 2

Summary
We now gray out unused variables in parameters in javascript and typescript files, even if you have not configured the noUnusedLocals setting. This is controlled by the typescript.showUnused.enabled and javascript.showUnused.enabled settings.

The gray color is taken from the editorUnnecessary.foreground theme color

Testing
Clone or create a few basic js and ts projects, such as using create react app or the angular starers. Confirm that unused symbols are grayed out by default and have quick fixes associated with them

Things to try:

  • Make edits to the file and see if you can break where the gray out happens. The locations are based on markers so they aren't perfect but should be updated within around half a second if they get out of sync.

  • Try enabling and disabling the grey out using the typescript.showUnused.enabled and javascript.showUnused.enabled settings.

  • Try making unused variables errors by configuring a jsconfig/tsconfig with the noUnusedLocals and noUnusedParameters values. Unused variables should now have squigglies and be grayed out

  • Try configuring the fade out color with editorUnnecessary.foreground

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions