Skip to content

Intellisense derived from JSDoc does not function correctly when imported #20238

Closed

Description

@just-nick
  • VSCode Version: 1.9.0
  • OS Version: Windows 10

When using an ES2015 class as a type in JSDoc it does not appear to work correctly in files that import that class via a require statement.

While working within the same file that the class was defined in, everything works as expected. (shown below).

An example of JSDoc typing working correctly in the same file

While working within a different file the class appears to import correctly and show its constructor typing (shown below).

An example of an imported class working correctly

But when I try to use the class for typing (As done in the first image) it no longer considers my class as a valid type.

An example of an imported class not being accepted as a type

Here is the jsconfig I was using for this example

{
    "compilerOptions": {
        "target": "es6",
        "module": "commonjs",
        "allowSyntheticDefaultImports": true
    }
}

Apologies if this has been submitted before. I couldn't seem to find it in the issue search.

Activity

  1. mjbvz commented on Feb 14, 2017

    @mjbvz
    Contributor

    Thanks for the report. Opened this bug against TypeScript: microsoft/TypeScript#14056

    One possible workaround is using import:

    import {ExampleType} from './class'

    Closing as upstream

  2. 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

javascriptJavaScript support issuesupstreamIssue 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