Skip to content
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

JSDoc type assertions not working #41911

Closed
dimensi opened this issue Jan 20, 2018 · 3 comments
Closed

JSDoc type assertions not working #41911

dimensi opened this issue Jan 20, 2018 · 3 comments
Assignees
Labels
javascript JavaScript support issues *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@dimensi
Copy link

dimensi commented Jan 20, 2018

  • VSCode Version: 1.19.2
  • OS Version: Arch

Steps to Reproduce:

  1. add // @ts-check
  2. write jsdoc type assertion
  3. alt + hover on variable

image

Does this issue occur when all extensions are disabled?: No

@vscodebot vscodebot bot added the javascript JavaScript support issues label Jan 20, 2018
@usernamehw
Copy link
Contributor

Duplicate of microsoft/TypeScript#18212 ?

In a nutshell, it is designed that way - you should add parentheses around your expression:

this.el = /** @type {HTMLImageElement} */ (el);
this.el

@dimensi
Copy link
Author

dimensi commented Jan 20, 2018

Oh, now working. I can't find in docs about jsdoc type assertions, only in update release note https://code.visualstudio.com/updates/v1_16#_jsdoc-type-assertions. I look on code 100 times and first time notice parentheses

@mjbvz
Copy link
Collaborator

mjbvz commented Jan 22, 2018

Closing as question / dup

@mjbvz mjbvz closed this as completed Jan 22, 2018
@mjbvz mjbvz added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Jan 22, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

3 participants