Skip to content

Wrong/missing quick info in JSDoc @implements tag #55650

Closed
@evgenymarkov

Description

@evgenymarkov

Type: Bug

Hello! I found that JSDoc tags @implements are handled by VSCode differently than tsc does:

  • VSCode cannot parse a string like import('./protocol.js ').ClientProtocol inside @implements tag.
  • VSCode does not understand a string like /** @implements {_protocol.ClientProtocol} */ and shows that the ClientProtocol has type any.

I have prepared a repository with a bug demonstration – https://github.com/evgenymarkov/implements-example.

You can open it in VSCode, exec npm install and look at the IDE hints in the file ./lib/client.js.

Hint for type inside @implements tag:
image

Hint for type inside @typedef:
image

I think the behavior of the IDE for the @implements tag and for @typedef should be the same.

I also double-checked that tsc understands @implements correctly and throws an error if the class does not satisfy the interface:
image

VS Code version: Code 1.81.1 (Universal) (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:20:33.924Z)
OS version: Darwin arm64 22.6.0
Modes:

System Info
Item Value
CPUs Apple M1 (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 1, 2, 2
Memory (System) 16.00GB (1.58GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (31)
Extension Author (truncated) Version
unique-lines bib 1.0.0
vscode-eslint dba 2.4.2
EditorConfig Edi 0.16.4
prettier-vscode esb 10.1.0
shell-format fox 7.2.5
copilot Git 1.108.376
go gol 0.39.1
hcl has 0.3.2
terraform has 2.27.1
prettier-sql-vscode inf 1.6.0
git-graph mhu 1.30.0
vscode-docker ms- 1.26.0
black-formatter ms- 2023.4.1
isort ms- 2023.10.1
python ms- 2023.14.0
vscode-pylance ms- 2023.8.50
jupyter ms- 2023.7.1002162226
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.17
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
remote-ssh ms- 0.102.0
remote-ssh-edit ms- 0.86.0
remote-explorer ms- 0.4.1
vscode-yaml red 1.14.0
LiveServer rit 5.7.9
partial-diff ryu 1.4.3
vscode-stylelint sty 1.2.4
even-better-toml tam 0.19.2
vscode-task tas 0.3.1
vitest-explorer Zix 0.2.42

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationDomain: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion InfoEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Fix AvailableA PR has been opened for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions