diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-15 18:54:18 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-15 18:54:18 +0800 |
commit | 935faea26c5f148651d1371e6979f016a14c3aa0 (patch) | |
tree | 804549ff7a45d2b700ece0164a485c6386b9fb90 /server/src/core/library.lua | |
parent | b95cc831ecc0d75ffdc3a875df792ec45571a2da (diff) | |
download | lua-language-server-935faea26c5f148651d1371e6979f016a14c3aa0.zip |
库函数支持外联文档
Diffstat (limited to 'server/src/core/library.lua')
-rw-r--r-- | server/src/core/library.lua | 8 |
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) |