question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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® Core™ 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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RyanCavanaughcommented, Apr 29, 2021

This is a story, not a bug report. What is the defect?

1reaction
mjbvzcommented, Apr 29, 2021

Please share example code (as text) that demonstrates the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support tooltip for @yields JSDoc · Issue #50080 - GitHub
When hover Token in @yields {Token} , we can not see the object structure ... TypeScript is synthesizing type info from your JSDoc...
Read more >
JSDoc Reference - TypeScript: Documentation
JSDoc Reference. The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files.
Read more >
How do I document "provider-pattern" functions with JSDoc in ...
1 Answer 1 ... You can do that by putting the JSDoc inside the function, annotating the returned function: export const callEndpointProvider =...
Read more >
Discussing the over-engineering trap in TypeScript
Before I start the discussion of over-engineering in TypeScript, I want to give a basic overview of how JavaScript and more strongly-typed ...
Read more >
The power of jsDoc - DEV Community ‍ ‍
That's why we've seen the rise of Typescript. ... allow you to specify what parameters with what type (or types) are expect by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found