microsoft / microsoft/TypeScript

TypeScript: JSDoc tooltips are shared between types and values, but not functions

Open
#43,889 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

TS Template added by @mjbvz

TypeScript Version: 4.2.4

Search Terms

  • quickinfo
  • jsdoc

Issue Type: Bug

Steps to reproduce

  • Create a TypeScript file.
  • Create a type alias with some name, and write a JSDoc comment for it.
  • For types and functions:
    • Create a function with the same name, write a different JSDoc comment.
    • Hover over the type name. You will see the function’s comment, followed by the type’s comment.
    • Hover over the function. You will only see the function’s comment.
  • For types and values:
    • Create a value identifier with the same name, write a different JSDoc comment.
    • Hover over the type name. You will see the type’s comment, followed by the value’s comment.
    • Hover over the value identifier. You will see the type’s comment, followed by the value’s comment.

Reference file

/** A */
type X = null
/** B */
let X = null
/** C */
type Y = null
/** D */
function Y() {}
Screenshots

vscode-jsdoc-issue-type-x
vscode-jsdoc-issue-let-x
vscode-jsdoc-issue-type-y
vscode-jsdoc-issue-function-y

System and version info

VS Code version: Code - Insiders 1.56.0-insider (0123d26aaa393bccf99f31f1eac07df6c9e218ce, 2021-04-29T05:12:38.091Z)
OS version: Linux x64 5.11.0-7614-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz (8 x 2300)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 7.64GB (0.18GB free)
Process Argv --no-sandbox --unity-launch --crash-reporter-id dbbd25fe-3f4e-426a-9c89-45e060834124
Screen Reader no
VM 0%
DESKTOP_SESSION pop
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP pop
XDG_SESSION_TYPE x11
Extensions: none

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

Start by reproducing the reference TypeScript file and compare quickinfo results for the type/value pair with the type/function pair. Trace the quickinfo and JSDoc handling involved in those hovers, then add regression coverage for the expected tooltip comments and verify that each declaration shows the appropriate documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.