You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSDoc Type hints not working for imported types. #21933
Let me know if this is actually a TypeScript bug. While there isn't explicitly any TypeScript involved (except the typings file in the source) I recognize that a lot of the JavaScript intellisense is sourced from the TypeScript engine.
VSCode Version: 1.10.1
OS Version: Windows 10
Steps to Reproduce:
varFoo=require('foo');/** @type {Foo} */varfoo;// `foo` is of type `any` according to tooltip.
varFoo=require('foo');varfoo=newFoo();// `foo` is of type `Foo` according to tooltip.
/** @type {WebGLRenderingContext} */varfoo;// `foo` is of type `WebGLRenderingContext` according to tooltip.
The above illustrates that while VSCode knows about and understands the imported type Foo (the package has a typing file). When using JSDoc for type hinting in JavaScript, VSCode doesn't appear to recognize it in the JSDoc. The last example shows that the JSDoc hinting is working in general by providing a globally scoped/available type in the doc and seeing that VSCode does the right thing.
Activity
mjbvz commentedon Mar 8, 2017
Thanks. This is a duplicate of microsoft/TypeScript#14056 being tracked on the TypeScript side