Skip to content

Interactive type inlay hints - #55141

Merged
Maria Solano (MariaSolOs) merged 4 commits into
microsoft:mainfrom
MariaSolOs:type-hints
Sep 20, 2023
Merged

Interactive type inlay hints#55141
Maria Solano (MariaSolOs) merged 4 commits into
microsoft:mainfrom
MariaSolOs:type-hints

Conversation

@MariaSolOs

Copy link
Copy Markdown
Contributor

Second iteration of #47693

@typescript-bot

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Comment thread src/services/inlayHints.ts Outdated
Comment thread src/services/inlayHints.ts Outdated
Comment thread src/services/inlayHints.ts Outdated

const parts: InlayHintDisplayPart[] = [];
visitDisplayPart(typeNode);
function visitDisplayPart(node: Node) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you're not visiting display parts, you're visiting nodes to aggregate display parts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I just didn't want to call it visitor to differentiate it from the one at the top of provideInlayHints. Suggestions of a better name?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visitForDisplayParts?

parts.push({ text: ">" });
}
// TODO: Parameters.
parts.push({ text: " => " });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating objects on the fly, I'm pretty sure we have display part functions that construct these. They have the benefit that they can include a display part kind as well if I recall correctly.

On that note, I think spaces are typically their own display part.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but those are for SymbolDisplayParts, and I have InlayHintDisplayParts here.

@MariaSolOs

Copy link
Copy Markdown
Contributor Author

Jake Bailey (@jakebailey) should I rebase this PR to include the new formatting setup?

Comment thread src/services/inlayHints.ts
Comment thread src/services/inlayHints.ts
Comment thread src/services/inlayHints.ts Outdated
@RyanCavanaugh

Copy link
Copy Markdown
Member

Jake Bailey (@jakebailey) can you review the latest commit? Thanks!

@jakebailey

Copy link
Copy Markdown
Member

The changes look good, I was just waiting on #55141 (comment) as that was in my review comments from the last batch.

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course I don't really mind the name either way.

@Gawd71730

Copy link
Copy Markdown

Hints

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants