Skip to content

Intellisense can't be overridden by JSDoc in normal Javascript #18229

@jamietre

Description

@jamietre
  • VSCode Version: 1.8.1 vommit ee428b
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create a function that returns something that TS thinks it can figure out a signature for
  2. Add jsdoc with @returns
  3. Use the function elsewhere

TSServer does a great job with signatures when using plain javascript - sometimes. But often I want to just use JSDoc to explicitly provide a signature, because it's indetermine or TS can't figure it out correctly.

e.g.

image

Using this function:

image

I would expect to see the signature I defined in @returns. ("bind" actually seems to have another issue too -- I would think it knows to return the same sig of what you invoked "bind" on, but that's a different story, in this case I just want it to use my explicitly described signature).

This seems to happen if Typescript thinks it knows the signature of what I'm returning. It doesn't happen if I return something it truly doesn't know about - e.g. a property of an object that's not defined yet; in that case it always uses my JSDoc.

I would think that JSDoc should always supercede what TS Server thinks the signature is, if present.

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions