You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't seem to be able to get good completions inside of a @returns.
We don't do this for regular types either.
Based on what I've seen of completions.ts, it handles a few special cases (right of dot, JSX tag) and then calls tryGetGlobalSymbols(). There's a comment in that function saying /// TODO filter meaning based on the current context. This should be doable based on the parent node. In your example the parent node is a JSDocTypeExpression, so it has to be a type. In an expression it has to be a value, except in a type assertion expression.
We should also prefer local symbols first. E.g.:
I'm obviously trying to print x, not __dirname!
So there are 2 issues blocking getting useful completions in a non-foo. context:
@sheetalkamat this looks related to your change to filter completions based on location. we probably should filter completions in a jsdoc comment between {} to types and namespaces only.
TypeScript Version: 2.2.0
Code
Expected behavior:
Requesting a completion inside the
{}
after@param
should return type name completionActual behavior:
No suggestions besides text suggestions are available.
Note that suggestions do work inside the
{}
after@returns
.The text was updated successfully, but these errors were encountered: