summaryrefslogtreecommitdiff
path: root/server/src/core/library.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-15 18:54:18 +0800
committersumneko <sumneko@hotmail.com>2019-05-15 18:54:18 +0800
commit935faea26c5f148651d1371e6979f016a14c3aa0 (patch)
tree804549ff7a45d2b700ece0164a485c6386b9fb90 /server/src/core/library.lua
parentb95cc831ecc0d75ffdc3a875df792ec45571a2da (diff)
downloadlua-language-server-935faea26c5f148651d1371e6979f016a14c3aa0.zip
库函数支持外联文档
Diffstat (limited to 'server/src/core/library.lua')
-rw-r--r--server/src/core/library.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/src/core/library.lua b/server/src/core/library.lua
index f0c292aa..d5edad66 100644
--- a/server/src/core/library.lua
+++ b/server/src/core/library.lua
@@ -88,6 +88,9 @@ local function insertGlobal(tbl, key, value)
if not isMatchVersion(value.version) then
return false
end
+ if not value.doc then
+ value.doc = key
+ end
tbl[key] = value
return true
end
@@ -175,6 +178,9 @@ local function insertChild(tbl, name, key, value)
if not isMatchVersion(value.version) then
return
end
+ if not value.doc then
+ value.doc = ('%s.%s'):format(name, key)
+ end
if not tbl[name] then
tbl[name] = {
type = name,
@@ -189,7 +195,7 @@ local function mergeParent(alllibs, name, lib, libName)
for _, parent in ipairs(lib.parent) do
if parent.type == 'global' then
if isEnableGlobal(libName) then
- insertChild(alllibs.global, parent.name, name, lib)
+ insertChild(alllibs.global, parent.name, name, lib)
end
elseif parent.type == 'library' then
insertChild(alllibs.library, parent.name, name, lib)