-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Add inlay hints support #42089
Add inlay hints support #42089
Conversation
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary |
@mjbvz |
@typescript-bot pack this. |
Hey @Kingwl, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
The TypeScript team hasn't accepted the linked issue #42073. If you can get it accepted, this PR will have a better chance of being reviewed. |
Well, let me think about some examples: f(1);
f(1 + 2);
f("Some String");
f("Some String".toLowerCase());
f(someString);
f(someString.toLowerCase());
f([0, 1, 2]);
f([0, 1, 2].map(processNumber));
f(integers);
f(integers.map(processNumber)); In these cases, I feel like the literal arguments and the expressions made up of literals convey the same amount of semantic information. I don’t think the That said, |
Thanks for the review. I've updated followed the comments. |
I haven't tried this out yet to see how it actually plays. I assume I need vscode insiders? |
@jessetrinity you need a local build of microsoft/vscode#113412 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bearing with us on the last-minute updates, @Kingwl 🌟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InlayHintKind
was changed to
export const enum InlayHintKind {
Type = "Type",
Parameter = "Parameter",
Enum = "Enum",
}
in protocol.ts
but nowhere else.
Thanks! |
Thanks for creating such a great feature! I have a question, why is there a limit on the hint length? Specifically, why is |
Fixes #42073
Features:
Something need to consider:
Type Parameter: The root cause is we could inference type fromI thinktype node
ortype
. Which one should we take?type
is better.Thanks!