Skip to content

Commit

Permalink
fix(43254): show named tuple member type (#43273)
Browse files Browse the repository at this point in the history
a-tarasyuk authored Mar 16, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent ae884b1 commit 3da5982
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/services.ts
Original file line number Diff line number Diff line change
@@ -1619,6 +1619,9 @@ namespace ts {
if (isNewExpression(node.parent) && node.pos === node.parent.pos) {
return node.parent.expression;
}
if (isNamedTupleMember(node.parent) && node.pos === node.parent.pos) {
return node.parent;
}
return node;
}

@@ -1633,6 +1636,7 @@ namespace ts {
case SyntaxKind.ThisKeyword:
case SyntaxKind.ThisType:
case SyntaxKind.SuperKeyword:
case SyntaxKind.NamedTupleMember:
return true;
default:
return false;
5 changes: 5 additions & 0 deletions tests/cases/fourslash/quickInfoForNamedTupleMember.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="fourslash.ts" />

////type foo = [/**/x: string];

verify.quickInfoAt("", "string");

0 comments on commit 3da5982

Please sign in to comment.