Skip to content
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

Show jsdoc typedef details in suggestions / intelliSense #41096

Closed
AoDev opened this issue Oct 4, 2020 · 4 comments
Closed

Show jsdoc typedef details in suggestions / intelliSense #41096

AoDev opened this issue Oct 4, 2020 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@AoDev
Copy link

AoDev commented Oct 4, 2020

If a type is defined through typedef (given a name), then description / suggestions only show the name.
But to be useful, it should show the details of the type.

I'll make a code comparison and show the different results:

The variant I'd like to improve

We define a type through typedef

/**
 * @typedef {object} myOptions
 * @property {number} option1
 * @property {string} option2
 */

/**
 * @param {myOptions} options
 */
function doSomethingElse (options) {
  // ...
}

Hovering the function call will only give us the typedef name. We have no idea what the actual options are.

Screenshot 2020-10-04 at 12 08 33

I thought I could maybe ctrl/cmd click on the type name in the description to go to the definition, but nothing happens.

Same while typing, we have no information.

Screenshot 2020-10-04 at 12 09 19

Compare to inline jsdoc (best description result)

/**
 * @param {{option1: number, option2: string}} options
 */
function doSomething (options) {
  // ...
}

Hovering the function call, we have a nice description of the options argument.

Screenshot 2020-10-04 at 12 02 19

Same while typing, we have details about the options.
Screenshot 2020-10-04 at 12 02 48

Side note: strange that we don't have a nice syntax highlighting while typing, seems it would be easier to reuse the hovering logic and show the same thing.

Feature request

So, what I'd like is vscode to show the same thing for the @typedef case than for the inline jsdoc case.

@mjbvz mjbvz transferred this issue from microsoft/vscode Oct 14, 2020
@mjbvz mjbvz removed their assignment Oct 14, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Oct 14, 2020

Potential duplicate of #25784

@AoDev
Copy link
Author

AoDev commented Oct 14, 2020

@mjbvz Just checked, they are definitely related. The other one is 2 years older though.
The summary of it is to have always the full type / data structure information available, regardless of how the jsdoc type is declared.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 16, 2020
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@brillout
Copy link

brillout commented Oct 6, 2023

Related feature request: #56010.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants