-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional parameter with jsdoc does not be respected by salsa intellisense #6992
Comments
Testing with the latest Please try again with the latest bits in the Thanks! |
@billti I think you may misunderstand the issue a little The problem is registering intellisense to constructor Here is the code I use for test
And this is result. When parameter is missing it then make an object created from that constructor to not know what it is |
@RyanCavanaugh @billti If you close issue then does you get notification? |
Yes, but it is the weekend (and Monday is a holiday). |
@billti OK then I'm apologize. Just not sure that it is or not. Because it still closed |
Currently in TypeScript if you try to invoke a function (or constructor) and zero signatures match, we issue an error and return However, if there are any appropriate signatures, we could give a better Salsa (and arguably a better TypeScript) experience by choosing the last signature in the set instead of This is probably the right thing to do everywhere. e.g. today, even in TypeScript, if you say function makeString(n: number) {
return 'the number is ' + n;
}
let j = makeString(); // j: any
let k = j.subtr(4); you get an error on the initializer for @ahejlsberg any thoughts on this change and/or this pattern in general? |
Open question with this approach: what to do about generic signatures? function fn<T>(x: T, y: T): T { ... }
let x = fn(3, ""); // was x: any, now x: ?? |
When I use jsdoc to create constructor the intellisense work well. Except a bug that it must obey parameter. It will not know type if the parameter is not all passed in. even it marked as optional by jsdoc
As the screenshot. air is optional by jsdoc
this work but
not
The text was updated successfully, but these errors were encountered: