plantain-00 / type-coverage

A CLI tool to check type coverage for typescript code
MIT License
1.25k stars 44 forks source link

[vscode] Plugin not highlighting in versions >1.3.0 #86

Open jessykalycia opened 3 years ago

jessykalycia commented 3 years ago

Version(if relevant): Higher than 1.3.0

Expected:

Visual studio code plugin to highlight "Any" variables;

Actual:

Visual studio code plugin is not highlighting "Any" variables in versions > 1.3.0

Note: Settings/Extensions/Type Coverage is checked on to active and is active on the workspace.

plantain-00 commented 3 years ago

I cannot reproduce this. More information is needed.

jessykalycia commented 3 years ago

Is there any additional configuration needed to highlight the "Any" variables?

Also, what information can I provide to help reproducing easier?

plantain-00 commented 3 years ago

No additional configuration.

danvk commented 3 years ago

The VS Code extension works in some projects but not others. I haven't been able to pin down what the important difference between the projects is, but it will either report all the any symbols or just not report anything.

For example, the extension works for me on this project: https://github.com/paulirish/webtreemap-cdt

image

but it does not report any any types on this project, even when I add them: https://github.com/danvk/literate-ts

image

type-coverage v2.16.5

Visual Studio Code Version: 1.59.1 Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa Date: 2021-08-19T11:53:52.479Z Electron: 13.1.7 Chrome: 91.0.4472.124 Node.js: 14.16.0 V8: 9.1.269.36-electron.0 OS: Darwin x64 19.6.0

plantain-00 commented 3 years ago

@danvk I cannot reproduce your case 屏幕快照 2021-08-29 09 34 35 The only difference is OS: Darwin x64 18.7.0

danvk commented 3 years ago

I think I found the issue: to get the VS Code extension to work, I also have to install ts-plugin-type-coverage in my project's workspace:

yarn add ts-plugin-type-coverage -D

and then restart VS Code. Note that I'm using my workspace's version of TypeScript:

image

Does this seem right? Perhaps this could be added to the docs for the extension, or it could be bundled.

plantain-00 commented 3 years ago

@danvk ts-plugin-type-coverage is a dependency of the plugin: https://github.com/plantain-00/type-coverage/blob/master/packages/vscode/package.json#L25 It seems not right, but I will add a reference to this in the doc.