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

Remove @type tag from hover info #57819

Open
6 tasks done
remcohaszing opened this issue Mar 18, 2024 · 0 comments
Open
6 tasks done

Remove @type tag from hover info #57819

remcohaszing opened this issue Mar 18, 2024 · 0 comments
Labels
Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@remcohaszing
Copy link

πŸ” Search Terms

jsdoc tag @type remove

βœ… Viability Checklist

⭐ Suggestion

TypeScript should strip the @type JSDoc annotation from the description in tooltips such as hover information and autocompletion.

TypeScript already strips type information from other JSDoc tags such as @typedef, @property, @param, and @returns, but not for @type. For example, try hovering over various tokens in this playground.

A tooltip from hovering over an @type annotated variable

A tooltip from hovering over a function

πŸ“ƒ Motivating Example

TypeScript already stripped type information in various JSDoc tags in editor descriptions. Now it also strips the @type tag.

Try it in this playground

/**
 * @typedef Person
 * Person description.
 * 
 * @property {string} name
 *   Name description.
 */

/**
 * Variable description.
 *
 * @type {string}
 */
let variable;

/**
 * @param {string} param
 *   Param description.
 * @returns {string}
 *   Return value description.
 */
function fn(param) {
  return param
}

πŸ’» Use Cases

  1. What do you want to use this for?
    To provide a better DX for libraries developed in JSDoc.
  2. What shortcomings exist with current approaches?
    The inclusion of the @type tag in descriptions looks weird. Also the information is shown twice, as TypeScript also shows the processed type information.
  3. What workarounds are you using in the meantime?
    There aren’t any.
@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Help Wanted You can do this Experience Enhancement Noncontroversial enhancements labels Mar 20, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants