Skip to content

fix(55945): Inlay hints don't work for bigint literals#55947

Merged
MariaSolOs merged 9 commits intomicrosoft:mainfrom
a-tarasyuk:fix/55945
Oct 4, 2023
Merged

fix(55945): Inlay hints don't work for bigint literals#55947
MariaSolOs merged 9 commits intomicrosoft:mainfrom
a-tarasyuk:fix/55945

Conversation

@a-tarasyuk
Copy link
Copy Markdown
Contributor

Fixes #55945

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Oct 2, 2023
@MariaSolOs
Copy link
Copy Markdown
Contributor

MariaSolOs commented Oct 2, 2023

I would prefer adding an extra check before the switch to handle literal nodes:

if (tokenString) {
  parts.push({ text: tokenString });
  return;
}

if (isLiteralExpression(node)) { // New check
  parts.push({ text: node.text });
  return;
}

switch (node.kind) { ...

We can then remove these cases:

case SyntaxKind.NumericLiteral:
parts.push({ text: (node as NumericLiteral).text });
break;
case SyntaxKind.StringLiteral:
parts.push({ text: `"${(node as StringLiteral).text}"` });
break;

@MariaSolOs
Copy link
Copy Markdown
Contributor

LGTM! I'll merge this now since you've addressed @DanielRosenwasser's (and my) suggestions.

Thanks again for the fix @a-tarasyuk (and your patience 😅)

@MariaSolOs MariaSolOs merged commit 6ec5547 into microsoft:main Oct 4, 2023
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inlay type hints don't work for bigint literals

4 participants