diff --git a/UpsilonLanguageServer/Lib/Upsilon.dll b/UpsilonLanguageServer/Lib/Upsilon.dll index 3569c49..5dce67a 100644 Binary files a/UpsilonLanguageServer/Lib/Upsilon.dll and b/UpsilonLanguageServer/Lib/Upsilon.dll differ diff --git a/UpsilonLanguageServer/Lib/Upsilon.pdb b/UpsilonLanguageServer/Lib/Upsilon.pdb index e685368..e4c45e8 100644 Binary files a/UpsilonLanguageServer/Lib/Upsilon.pdb and b/UpsilonLanguageServer/Lib/Upsilon.pdb differ diff --git a/UpsilonLanguageServer/UpsilonLanguageServer/Services/TextDocumentServer.cs b/UpsilonLanguageServer/UpsilonLanguageServer/Services/TextDocumentServer.cs index 8dace7b..b350447 100644 --- a/UpsilonLanguageServer/UpsilonLanguageServer/Services/TextDocumentServer.cs +++ b/UpsilonLanguageServer/UpsilonLanguageServer/Services/TextDocumentServer.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Text; using System.Threading; using System.Threading.Tasks; using JsonRpc.Standard.Contracts; @@ -6,6 +7,7 @@ using LanguageServer.VsCode; using LanguageServer.VsCode.Contracts; using LanguageServer.VsCode.Server; using Upsilon.Binder; +using Upsilon.Parser; namespace UpsilonLanguageServer.Services { @@ -25,15 +27,23 @@ namespace UpsilonLanguageServer.Services var findNode = doc.Bound.GetNodeAtPosition(linePos + position.Character); if (findNode != null) { - var contents = $"Kind: {findNode.Kind}"; + var contents = new StringBuilder($"Kind: {findNode.Kind}"); if (findNode is BoundExpression expression) { - contents += $"\n\nType: {expression.Type}"; + contents.Append($"\n\nType: {expression.Type}"); + } + + if (findNode is BoundVariableSymbol varSymbol) + { + if (varSymbol.VariableSymbol.CommentValue != null) + { + contents.Append($"\n\n{string.Join(" \n", varSymbol.VariableSymbol.CommentValue)}"); + } } return new Hover() { - Contents = contents + Contents = contents.ToString() }; } }