Merge pull request #2236 from Microsoft/signatureHelp
Signature help diagnostics
This commit is contained in:
commit
af41be88a1
|
@ -264,12 +264,16 @@ module ts.SignatureHelp {
|
||||||
// the comma. That amounts to taking the ceiling of half the index.
|
// the comma. That amounts to taking the ceiling of half the index.
|
||||||
var argumentIndex = (listItemInfo.listItemIndex + 1) >> 1;
|
var argumentIndex = (listItemInfo.listItemIndex + 1) >> 1;
|
||||||
|
|
||||||
|
var argumentCount = getCommaBasedArgCount(list);
|
||||||
|
|
||||||
|
Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, `argumentCount < argumentIndex, ${argumentCount} < ${argumentIndex}`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
kind: isTypeArgList ? ArgumentListKind.TypeArguments : ArgumentListKind.CallArguments,
|
kind: isTypeArgList ? ArgumentListKind.TypeArguments : ArgumentListKind.CallArguments,
|
||||||
invocation: callExpression,
|
invocation: callExpression,
|
||||||
argumentsSpan: getApplicableSpanForArguments(list),
|
argumentsSpan: getApplicableSpanForArguments(list),
|
||||||
argumentIndex: argumentIndex,
|
argumentIndex: argumentIndex,
|
||||||
argumentCount: getCommaBasedArgCount(list)
|
argumentCount: argumentCount
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,6 +351,8 @@ module ts.SignatureHelp {
|
||||||
? 1
|
? 1
|
||||||
: (<TemplateExpression>tagExpression.template).templateSpans.length + 1;
|
: (<TemplateExpression>tagExpression.template).templateSpans.length + 1;
|
||||||
|
|
||||||
|
Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, `argumentCount < argumentIndex, ${argumentCount} < ${argumentIndex}`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
kind: ArgumentListKind.TaggedTemplateArguments,
|
kind: ArgumentListKind.TaggedTemplateArguments,
|
||||||
invocation: tagExpression,
|
invocation: tagExpression,
|
||||||
|
@ -512,6 +518,8 @@ module ts.SignatureHelp {
|
||||||
selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount);
|
selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, `argumentCount < argumentIndex, ${argumentCount} < ${argumentIndex}`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items,
|
items,
|
||||||
applicableSpan,
|
applicableSpan,
|
||||||
|
|
Loading…
Reference in a new issue