Skip to content

Commit dfaa1b5

Browse files
committed
Just change the type
1 parent f6803c6 commit dfaa1b5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/services/signatureHelp.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ namespace ts.SignatureHelp {
154154
const tagExpression = <TaggedTemplateExpression>templateExpression.parent;
155155
Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression);
156156

157-
const argumentIndex = 1;
157+
const argumentIndex = isInsideTemplateLiteral(node, position) ? 0 : 1;
158158

159159
return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile);
160160
}
@@ -165,7 +165,7 @@ namespace ts.SignatureHelp {
165165
Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression);
166166

167167
// If we're just after a template tail, don't show signature help.
168-
if (node.kind === SyntaxKind.TemplateTail) {
168+
if (node.kind === SyntaxKind.TemplateTail && !isInsideTemplateLiteral(node, position)) {
169169
return undefined;
170170
}
171171

src/services/utilities.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ namespace ts {
955955
return SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation;
956956
}
957957

958-
export function isInsideTemplateLiteral(node: LiteralExpression, position: number) {
958+
export function isInsideTemplateLiteral(node: LiteralLikeNode, position: number) {
959959
return isTemplateLiteralKind(node.kind)
960960
&& (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd());
961961
}

0 commit comments

Comments
 (0)