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

Inlay hints for type parameters on type arguments #55591

Open
jonlepage opened this issue Aug 25, 2023 · 9 comments
Open

Inlay hints for type parameters on type arguments #55591

jonlepage opened this issue Aug 25, 2023 · 9 comments
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@jonlepage
Copy link

hi, can we support ts generic for editor.inlayHints ?
I love this feature with a shortcut , but it seem missing ts support .
thanks


actually
image


expected result (photoshoped)

image

@jrieken jrieken assigned mjbvz and unassigned jrieken Aug 28, 2023
@mjbvz mjbvz transferred this issue from microsoft/vscode Aug 31, 2023
@mjbvz mjbvz removed their assignment Aug 31, 2023
@andrewbranch andrewbranch changed the title can we support ts generic for editor.inlayHints ? Inlay hints for type parameters on type arguments Sep 1, 2023
@andrewbranch andrewbranch added Suggestion An idea for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature labels Sep 1, 2023
@andrewbranch
Copy link
Member

@MariaSolOs might have opinions.

@MariaSolOs
Copy link
Contributor

@andrewbranch @djmisterjon This has already been implemented in #55141, it's just waiting for a review.

@andrewbranch
Copy link
Member

I might be missing it, but I don’t see any type arguments in any of those tests 🤔

@MariaSolOs
Copy link
Contributor

I might be missing it, but I don’t see any type arguments in any of those tests 🤔

I think you're right. But after reading this issue better I'm a bit unsure of what the ask is? Where exactly would the hint be?

@jonlepage
Copy link
Author

jonlepage commented Sep 1, 2023

I might be missing it, but I don’t see any type arguments in any of those tests 🤔

I think you're right. But after reading this issue better I'm a bit unsure of what the ask is? Where exactly would the hint be?

sorry , in this context the params are upper and args at bottom
A would like to know if your arch allow possibility to expose args names in params for ts generics.
image

i probably use a different theme design who add confusion sry, in js you can expose args in params like this :)
4t2w4ghwhw

it this help to understand the request ?

@MariaSolOs
Copy link
Contributor

@djmisterjon It does! Thank you for the example :)
This does sound like a new feature request indeed. The PR I linked previously is adding support for interacting with existing inlay hints, but you're suggesting a new case in where to display them.

@jonlepage
Copy link
Author

@djmisterjon It does! Thank you for the example :) This does sound like a new feature request indeed. The PR I linked previously is adding support for interacting with existing inlay hints, but you're suggesting a new case in where to display them.

I'm not very familiar with the ts project architecture, but yes, I believe it was indeed a new feature and not a modification of an existing one.
Or is it out of scope of ts ?

maybe i would be better to transfer the request to the side of vscode team ?
i was not sure if it a vscode feature or ts support or both !?

@MariaSolOs
Copy link
Contributor

@djmisterjon no worries! Yes this issue is in the right place :)

@jonlepage
Copy link
Author

Hmm, i ask myself if the reason why this feature was not implemented at the same time as JavaScript's Hints is probably because it's more complicated to achieve due to the freedom of syntax and formatting complexity that TypeScript allows, unlike JavaScript.

I remember encountering a similar issue with some other libraries in a similar context.
for example: where ESLint stopped supporting the INDENT RULE for TypeScript generics because TypeScript offers too much syntax freedom and formatting flexibility.
typescript-eslint/typescript-eslint#1824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants