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
TypeScript: JSDoc tooltips are shared between types and values, but not functions #43889
Comments
Please share example code (as text) that demonstrates the issue |
@mjbvz I have! |
This is a story, not a bug report. What is the defect? |
It should only display the JSDoc comment for the thing being hovered over, no? |
Also, why is this an issue in TypeScript now? I’m confused. |
TypeScript provides intellisense data to VS Code There are a decent number of things where there's a value and a type with the same name but there's only documentation on one or the other, but users expect to see documentation regardless of which kind of identifier they're hovering on, so we show both. I'm not sure why that doesn't happen in the |
Well, I believe the correct behavior should be one of the following:
|
I believe the different behavior with functions might be because TS hoists the function first, which moves it to the front of the tooltip. |
In my opinion, the fact that the function tooltip only shows the function’s doc comment demonstrates that it’s possible to isolate the comments based on token type, and I believe that the second behavior I listed is unequivocally the better one. |
I thought this was unintended behavior. Maybe it’s better to mark this as a feature request? I still believe the current implementation is unintuitive. |
TS Template added by @mjbvz
TypeScript Version: 4.2.4
Search Terms
Issue Type: Bug
Steps to reproduce
Reference file
Screenshots
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
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
The text was updated successfully, but these errors were encountered: