mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
make sure activeParameter isn't larger then aviablable parameters, fixes #4618
This commit is contained in:
parent
d9b4e4d625
commit
e9564ddeb0
|
@ -38,7 +38,15 @@ export default class TypeScriptSignatureHelpProvider implements SignatureHelpPro
|
|||
result.activeSignature = info.selectedItemIndex;
|
||||
result.activeParameter = info.argumentIndex;
|
||||
|
||||
info.items.forEach(item => {
|
||||
if (info.items[info.selectedItemIndex].isVariadic) {
|
||||
}
|
||||
|
||||
info.items.forEach((item, i) => {
|
||||
|
||||
// keep active parameter in bounds
|
||||
if (i === info.selectedItemIndex && item.isVariadic) {
|
||||
result.activeParameter = Math.min(info.argumentIndex, item.parameters.length - 1);
|
||||
}
|
||||
|
||||
let signature = new SignatureInformation('');
|
||||
signature.label += Previewer.plain(item.prefixDisplayParts);
|
||||
|
|
Loading…
Reference in a new issue