summaryrefslogtreecommitdiff
path: root/script/vm/getDocs.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-02 20:11:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-02 20:11:30 +0800
commit830be2cab0d5e45a32606bb33eba216c72a9ca66 (patch)
tree9e400ab0c69e238d5966d9f23918e4353c5ff09e /script/vm/getDocs.lua
parent5833c2aef04bd4704c86104275411ef330981f85 (diff)
downloadlua-language-server-830be2cab0d5e45a32606bb33eba216c72a9ca66.zip
fully support Doc.type.array
Diffstat (limited to 'script/vm/getDocs.lua')
-rw-r--r--script/vm/getDocs.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 0f4b537d..62e12d18 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -84,6 +84,22 @@ function vm.getDocTypes(name)
return cache
end
+function vm.getDocClass(name)
+ local cache = vm.getCache('getDocClass')[name]
+ if cache ~= nil then
+ return cache
+ end
+ cache = {}
+ local results = getDocTypes(name)
+ for _, doc in ipairs(results) do
+ if doc.type == 'doc.class.name' then
+ cache[#cache+1] = doc
+ end
+ end
+ vm.getCache('getDocClass')[name] = cache
+ return cache
+end
+
function vm.isMetaFile(uri)
local status = files.getAst(uri)
if not status then