summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-30 14:08:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-30 14:08:00 +0800
commit03b17aa9307b1c418e9bfa30545142b29ce8233d (patch)
tree9b583e26edecd275ad8a77c5ec5ccdcf2f9373d1 /script
parente44142d13914bc98a4f9af0029cfadbc16e222a4 (diff)
downloadlua-language-server-03b17aa9307b1c418e9bfa30545142b29ce8233d.zip
cleanup
Diffstat (limited to 'script')
-rw-r--r--script/core/infer.lua19
-rw-r--r--script/proto/define.lua2
-rw-r--r--script/vm/getDocs.lua6
3 files changed, 6 insertions, 21 deletions
diff --git a/script/core/infer.lua b/script/core/infer.lua
index b42859c6..997df9a3 100644
--- a/script/core/infer.lua
+++ b/script/core/infer.lua
@@ -20,21 +20,6 @@ local TypeSort = {
['nil'] = 999,
}
-local innerTypeMap = {
- ['unknown'] = true,
- ['any'] = true,
- ['nil'] = true,
- ['boolean'] = true,
- ['number'] = true,
- ['integer'] = true,
- ['thread'] = true,
- ['table'] = true,
- ['string'] = true,
- ['userdata'] = true,
- ['lightuserdata'] = true,
- ['function'] = true,
-}
-
local m = {}
local function mergeTable(a, b)
@@ -663,8 +648,4 @@ function m.getClass(source)
return view
end
-function m.isInnerType(typeName)
- return innerTypeMap[typeName] == true
-end
-
return m
diff --git a/script/proto/define.lua b/script/proto/define.lua
index 825e757c..f14117ab 100644
--- a/script/proto/define.lua
+++ b/script/proto/define.lua
@@ -260,7 +260,7 @@ m.BuiltIn = {
['utf8'] = 'default',
}
-m.BuiltinClass = {
+m.BuiltinType = {
['unknown'] = true,
['any'] = true,
['nil'] = true,
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 0c6b1695..2fb2bda9 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -45,7 +45,7 @@ function vm.getDocDefines(name)
end
function vm.isDocDefined(name)
- if define.BuiltinClass[name] then
+ if define.BuiltinType[name] then
return true
end
local id = 'def:dn:' .. name
@@ -55,6 +55,10 @@ function vm.isDocDefined(name)
return false
end
+function vm.isBuiltinType(name)
+ return define.BuiltinType[name] == true
+end
+
function vm.getDocEnums(doc)
if not doc then
return nil