summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-07 02:58:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-07 02:58:03 +0800
commit84441873f6b0e4a75ee9b9d96d88c5609c7a48dc (patch)
tree6f390e1e74cca7a0b0bb70a7680519af0fa43c04 /script
parente9975c2081dfe2f42392a7612b2a3862e513e45e (diff)
downloadlua-language-server-84441873f6b0e4a75ee9b9d96d88c5609c7a48dc.zip
update
Diffstat (limited to 'script')
-rw-r--r--script/core/hover/description.lua16
-rw-r--r--script/vm/compiler.lua3
-rw-r--r--script/vm/infer.lua3
3 files changed, 8 insertions, 14 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua
index d3d24a75..8fe2eb4f 100644
--- a/script/core/hover/description.lua
+++ b/script/core/hover/description.lua
@@ -125,24 +125,14 @@ end
local function tryDocClassComment(source)
for _, def in ipairs(vm.getDefs(source)) do
- if def.type == 'doc.class.name'
- or def.type == 'doc.alias.name' then
- local class = noder.getDocState(def)
- local comment = getBindComment(class, class.bindGroup, class)
+ if def.type == 'doc.class'
+ or def.type == 'doc.alias' then
+ local comment = getBindComment(def, def.bindGroup, def)
if comment then
return comment
end
end
end
- if source.bindDocs then
- for _, doc in ipairs(source.bindDocs) do
- if doc.type == 'doc.class'
- or doc.type == 'doc.alias' then
- local comment = getBindComment(doc, source.bindDocs, doc)
- return comment
- end
- end
- end
end
local function tryDocModule(source)
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index e244c6c3..8ee35ad4 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -720,7 +720,8 @@ local compilerSwitch = util.switch()
compileByLocalID(source)
local key = guide.getKeyName(source)
m.compileByParentNode(source.node, key, function (src)
- if src.type == 'doc.type.field' then
+ if src.type == 'doc.type.field'
+ or src.type == 'doc.field' then
nodeMgr.setNode(source, m.compileNode(src))
end
end)
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index e6ca14e2..853bd7de 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -81,6 +81,9 @@ local viewNodeSwitch = util.switch()
: call(function (source, infer)
if source.cate == 'type' then
infer._hasClass = true
+ if source.name == 'number' then
+ infer._hasNumber = true
+ end
return source.name
end
end)