-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Description
- VSCode Version: 1.8.1 vommit ee428b
- OS Version: Windows 10
Steps to Reproduce:
- Create a function that returns something that TS thinks it can figure out a signature for
- Add jsdoc with
@returns
- 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.
Using this function:
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.