-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Support @typedef as member of namespace #25579
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
Comments
@Andy-MS Thanks for moving my report here. I am currently seeing the behavior that also the part that you claim works, doesn't work. In my report I stated that I tried different reference/namespace patterns. Leaving out any namespace was one of them. I never got intellisense to show me the correct return type when using /**
* @typedef {object} CancelReservationResult
* @property {number} updated 1 if the vehicle was updated, zero otherwise
* @property {boolean} [vehicle] - The updated vehicle
* @property {boolean} [reservation] - The former reservation of the updated vehicle
*/
//some code in between
/**
* @summary Remove a reservation from a vehicle if that reservation is owned by the given user
*
* @param {Object} params
* @param {Number} vehicleId The vehicle that will have its reservation removed
* @param {Number} userId The user holding the reservation
* @returns {CancelReservationResult}
*/
// service method declaration... |
I followed instructions to update to the latest typescript version ([email protected] |
@bennidi Could you post a complete example? Just that code works for me: |
Thanks for checking it out. I think I was not precise enough about what works and what doesn't work. What I expect intellisense to do is to show me details about the return type, when I hover over the function. I do receive the same results as you get, when I type Maybe this is a VSCODE config thing. Also the variable shows the correct type declaration. I am missing something else, so maybe I am reporting a feature request and you can redirect me instead. Here is what I see with the It is correct information but I don't see what this type looks like at all. While not giving any type info I receive I find this much more useful than just seeing the name of the type. If you think that this could be a relevant feature request for VSCODE, how should I proceed? And thanks for your support and sorry for not being so precise/clear enough in the beginning. |
I think that's working as intended, since we prefer to show the name of a type instead of the contents of a type. (Imagine if the return type had a property that contained another type, would we expand that too?) Also, completions are different depending on whether you have |
For what it's worth I still get the original issue, basically TypeScript does not recognise the |
I just realized this doesn't have a trackback to #28730. The fact that it's in a namespace is a special case but I think general support for the |
TypeScript Version: 3.0.0-dev.20180711
Code
Expected behavior:
No error.
Actual behavior:
C.N
andC.M
don't exist.The text was updated successfully, but these errors were encountered: