diff options
-rw-r--r-- | server/src/core/completion.lua | 14 | ||||
-rw-r--r-- | server/test/completion/init.lua | 17 |
2 files changed, 31 insertions, 0 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 34eecb0e..3575622e 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -76,6 +76,20 @@ local function getDucumentation(name, value) value = text, } end + local lib = value:getLib() + if lib then + return { + kind = 'markdown', + value = lib.description, + } + end + local comment = value:getComment() + if comment then + return { + kind = 'markdown', + value = comment, + } + end return nil end diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua index 2b63358e..c60e8ea0 100644 --- a/server/test/completion/init.lua +++ b/server/test/completion/init.lua @@ -1321,3 +1321,20 @@ JustTest }, } } + +TEST [[ +--- abc +zzz = 1 +zz$ +]] +{ + { + label = 'zzz', + kind = CompletionItemKind.Enum, + detail = '(number) = 1', + documentation = { + kind = 'markdown', + value = 'abc', + } + } +} |