Tweaks to how data is read

This commit is contained in:
Deukhoofd 2019-01-13 18:53:18 +01:00
parent dd223d8909
commit 18f4b1a25f
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
3 changed files with 10 additions and 2 deletions

View File

@ -30,8 +30,8 @@ namespace UpsilonLanguageServer
BoundTypeHandler.LoadUserDataTypeDefinition(new UserDataBoundEnumDefinition(values, typeName));
continue;
}
var innerProperties = obj.Properties();
foreach (var innerProperty in innerProperties)
var innerProperties = (JObject)obj.GetValue("Properties", StringComparison.InvariantCultureIgnoreCase);
foreach (var innerProperty in innerProperties.Properties())
{
var propertyName = innerProperty.Name;
if (!(innerProperty.Value is JObject value))
@ -174,6 +174,8 @@ namespace UpsilonLanguageServer
return Type.Table;
if (string.Equals(input, "function", StringComparison.InvariantCultureIgnoreCase))
return Type.Function;
if (string.Equals(input, "unknown", StringComparison.InvariantCultureIgnoreCase))
return Type.Unknown;
return Type.UserData;
}

View File

@ -53,6 +53,12 @@ namespace UpsilonLanguageServer.Services
{
contents.Append($"\n\nReturns: {fe.ReturnType}");
}
else if (findNode is BoundFunctionCallExpression functionCall)
{
contents.Append(
$"\n\nParameters: {string.Join(", ", functionCall.Parameters.Select(x => x.Type))}");
contents.Append($"\n\nReturns: {functionCall.Type}");
}
return new Hover()
{