Handle null values for comment data

This commit is contained in:
Deukhoofd 2018-11-27 15:54:41 +01:00
parent 0619fe3d21
commit fdd97fa9b3
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
3 changed files with 9 additions and 3 deletions

View File

@ -123,9 +123,15 @@ namespace UpsilonLanguageServer.Services
if (variableSymbol.VariableSymbol is TableVariableSymbol tableSymbol)
{
return new CompletionList(
tableSymbol.Variables.Select(x => new CompletionItem(x.Key,
CompletionItemKind.Variable, x.Value.Type.ToString(),
$"\n\n{string.Join(" \n", x.Value.CommentValue)}")));
tableSymbol.Variables.Select(x =>
{
var (key, value) = x;
return new CompletionItem(key,
CompletionItemKind.Variable, value.Type.ToString(),
x.Value.CommentValue == null
? ""
: $"\n\n{string.Join(" \n", value.CommentValue)}");
}));
}
return new CompletionList(
new[]