Only automatically fill out the parameters that are not optionals

This commit is contained in:
Deukhoofd 2018-12-13 19:08:05 +01:00
parent 37b3fe3680
commit bab3cff7df
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ namespace UpsilonLanguageServer.Services
switch (fun) switch (fun)
{ {
case InternalFunctionVariableSymbol internalFunctionVariableSymbol: case InternalFunctionVariableSymbol internalFunctionVariableSymbol:
data.Add("varCount", internalFunctionVariableSymbol.FunctionParameters.Length); data.Add("varCount", internalFunctionVariableSymbol.FunctionParameters.Count(x => !x.IsOptional));
break; break;
case ScriptFunctionVariableSymbol scriptFunctionVariableSymbol: case ScriptFunctionVariableSymbol scriptFunctionVariableSymbol:
data.Add("varCount", scriptFunctionVariableSymbol.Parameters.Length); data.Add("varCount", scriptFunctionVariableSymbol.Parameters.Length);
@ -268,7 +268,7 @@ namespace UpsilonLanguageServer.Services
{ {
var fun = (UserDataBoundMethod)property; var fun = (UserDataBoundMethod)property;
kind = CompletionItemKind.Function; kind = CompletionItemKind.Function;
data.Add("varCount", fun.Parameters.Length); data.Add("varCount", fun.Parameters.Count(x => !x.IsOptional));
} }
const string documentation = ""; const string documentation = "";