Skip to content

Commit aaaae40

Browse files
committed
Fix extended params args initial display
1 parent fbd7c48 commit aaaae40

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Source/ExcelDna.IntelliSense/IntelliSenseDisplay.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,7 @@ FormattedText GetFunctionIntelliSense(FunctionInfo functionInfo, int currentArgI
553553
// Note: Using params for the last argument
554554
if (functionInfo.ArgumentList.Count > 1 &&
555555
functionInfo.ArgumentList[functionInfo.ArgumentList.Count - 1].Name == "..." &&
556-
functionInfo.ArgumentList[functionInfo.ArgumentList.Count - 2].Name.EndsWith("1") && // Note: Need both the Arg1 and the ... to trigger the expansion in the function wizard?
557-
currentArgIndex >= functionInfo.ArgumentList.Count - 2)
556+
functionInfo.ArgumentList[functionInfo.ArgumentList.Count - 2].Name.EndsWith("1")) // Note: Need both the Arg1 and the ... to trigger the expansion in the function wizard?
558557
{
559558
var paramsIndex = functionInfo.ArgumentList.Count - 2;
560559

@@ -565,8 +564,11 @@ FormattedText GetFunctionIntelliSense(FunctionInfo functionInfo, int currentArgI
565564

566565
// Omit last two entries ("Arg1" and "...") from the original argument list
567566
var newList = new List<FunctionInfo.ArgumentInfo>(functionInfo.ArgumentList.Take(paramsIndex));
568-
// Now if we're at Arg3 (currentParamsIndex=2) then add "[Arg1],[Arg2],[Arg3],[Arg4],..."
569-
for (int i = 1; i <= currentParamsArgIndex + 1; i++)
567+
// Add back with parens the "[Arg1]"
568+
newList.Add(new FunctionInfo.ArgumentInfo { Name = $"[{paramsBaseName + 1}]", Description = paramsDesc });
569+
570+
// Now if we're at Arg4 (currentParamsIndex=3) then add "[Arg2],[Arg3],[Arg4],[Arg5],..."
571+
for (int i = 2; i <= currentParamsArgIndex + 2; i++)
570572
{
571573
newList.Add(new FunctionInfo.ArgumentInfo { Name = $"[{paramsBaseName + i}]", Description = paramsDesc });
572574
}

Source/ExcelDna.IntelliSense/ToolTipForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ protected override void OnPaint(PaintEventArgs e)
347347
if (run.IsLink && _linkActive)
348348
{
349349
font = _fonts[FontStyle.Underline];
350-
color = _linkColor;C:\Work\Excel-DNA\IntelliSense\Source\ExcelDna.IntelliSense.Host\ExcelDna.IntelliSense.Host-AddIn.xll.config
350+
color = _linkColor;
351351
}
352352
else
353353
{

0 commit comments

Comments
 (0)