Skip to content

JSDoc Type hints not working for imported types. #21933

Closed

Description

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:

var Foo = require('foo');
/** @type {Foo} */
var foo; // `foo` is of type `any` according to tooltip.
var Foo = require('foo');
var foo = new Foo(); // `foo` is of type `Foo` according to tooltip.
/** @type {WebGLRenderingContext} */
var foo; // `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

  1. added
    upstreamIssue identified as 'upstream' component related (exists outside of VS Code)
    on Mar 8, 2017
  2. mjbvz commented on Mar 8, 2017

    @mjbvz
    Contributor

    Thanks. This is a duplicate of microsoft/TypeScript#14056 being tracked on the TypeScript side

  3. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

upstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions