microsoft / microsoft/TypeScript

VSCode ignores JSDoc's @property when specify @typedef type in 1.43.2 and 1.44.0-insider

Open
#37,714 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Seems like VSCode ignores @property when specify type inside @typedef in 1.43.2 and 1.44.0-insider. It cause type hint to show not so correct type information and also not detected inside autocomplete/intellisense.

  • VSCode Version: 1.43.2 and 1.44.0-insider
  • OS Version: Ubuntu 18.04 x86_64

Steps to Reproduce:

  1. Create JSDoc type definition file, for example types.js.
  2. Import the type into form.js.
  3. Ensure the type hint for the specified JSDoc is working properly (no any) and the type is detected available inside autocomplete/intellisense.

Temporary Solution:

  • Remove type from @typedef, such us from @typedef {Object<string, any>} Person into @typedef Person.
  • Or, remove <string, any> from Object, such us @typedef {Object<string, any>} Person into @typedef {Object} Person.

Reproduce Repo: https://github.com/jeffryang24/sandbox/tree/master/javascript/vscode-jsdoc-type-hint-issue

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the linked sandbox, using its types.js and form.js examples and the reported VS Code versions or an available equivalent. Then trace the TypeScript JSDoc handling for @typedef, @property, and generic Object types; done means property type hints and autocomplete work without any while the existing reproduction remains covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript, vscode
Domain
developer-experience, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.