Skip to content

VS Code: "editor.showUnused": true not working in *.d.ts files #33121

@gilluminate

Description

@gilluminate

I was asked by the VS Code team to move this bug report upstream to the TypeScript project.

  • searched existing issues to avoid creating duplicates

  • tested using the latest insiders build to make sure issue has not already been fixed

  • issue occurs when all extensions are disabled

  • VSCode Version: 1.37.1

  • VSCode Insiders Version: 1.38.0-insider

  • OS Version: MacOS Mojave 10.14.6

  • TypeScript Version: 3.7.0-dev.20190828

Search Terms:
"VS Code", "d.ts", "unused", "editor.showUnused"

Steps to Reproduce:

  1. Ensure editor.showUnused is set to true for user, workspace, and folder.
  2. Create a file with extension .d.ts
  3. Add valid import statement such as
    import { User } from 'types/users';

Actual behavior: Import statement is not faded even though it hasn't been used.
Expected behavior: Import statement should be faded out as per setting.

Additional steps:

  1. convert filename to have only the .ts extension (drop the .d)
    Note: import line is dimmed as expected. The issue appears to only be affected by .d.ts files.

Related Issues:
Possibly:
#32196
#30260

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issuefeature-requestA request for a new feature

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions