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

Be able to configure what quick info IntelliSense shows on hover (e.g. whether to expand) #56010

Closed
5 tasks done
brillout opened this issue Oct 6, 2023 · 5 comments
Closed
5 tasks done
Labels
Duplicate An existing issue was already created

Comments

@brillout
Copy link

brillout commented Oct 6, 2023

πŸ” Search Terms

quick info, hover, IntelliSense, type hint, tsserver, VSCode

βœ… Viability Checklist

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

⭐ Suggestion

As a library author, I want to control what the user sees when he hovers over a type.

Most notably, I want to control whether the type should be expanded.

Tell TypeScript to show { n: number } when the user hovers over B:

type A = { n: number }
// @ts-quickinfo-expand true
type B = A

Tell TypeScript to show A when the user hovers over B:

type A = { n: number }
// @ts-quickinfo-expand false
type B = A

πŸ“ƒ Motivating Example

Library authors increasingly use TypeScript to document their library. It's a powerful way to add documentation right inside the user's source code. Being able to control TypeScript's quickinfo IntelliSense is a boon for library authors.

This is helpful not only for library authors, but also for large scale projects.

πŸ’» Use Cases

1. What do you want to use this for?

For Vike (a next-generation frontend framework).

2. What shortcomings exist with current approaches?

See above.

3. What workarounds are you using in the meantime?

None that I'm aware of.

@MartinJohns
Copy link
Contributor

Essentially a duplicate of #34556.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 6, 2023
@RyanCavanaugh
Copy link
Member

I think of it more like #38040 - we clearly need a way for QuickInfo to show a structural view rather than nominal view

@brillout
Copy link
Author

brillout commented Oct 7, 2023

While these tickets are related, none of them suggest adding the capability of configuring TypeScript's QuickInfo. That's why I was under the impression that creating this ticket wouldn't be a duplicate.

we clearly need a way for QuickInfo to show a structural view rather than nominal view

It's nice to hear that improving QuickInfo is being considered πŸ‘Œ

@MartinJohns
Copy link
Contributor

While these tickets are related, none of them suggest adding the capability of configuring TypeScript's QuickInfo.

That's an implementation detail. A different suggestion on how to solve a problem usually does not warrant a new issue, when the problem it tries to solve is still the same. You can add that as a comment to the existing issues.

@typescript-bot
Copy link
Collaborator

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

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

4 participants