summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-05-31 19:54:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-05-31 19:54:19 +0800
commitfea027821633ef07c5f702a9fe7eb65952f5a4b2 (patch)
tree4f25ba25a34e4efe1784189ff6465c9a9b8aa9da /script/core
parentfaa16704fb8ce52dbc67a92834bf4bba9cc989e1 (diff)
downloadlua-language-server-fea027821633ef07c5f702a9fe7eb65952f5a4b2.zip
update
Diffstat (limited to 'script/core')
-rw-r--r--script/core/hover/label.lua4
-rw-r--r--script/core/noder.lua7
-rw-r--r--script/core/searcher.lua4
3 files changed, 5 insertions, 10 deletions
diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua
index 73d924e1..ce77dfe6 100644
--- a/script/core/hover/label.lua
+++ b/script/core/hover/label.lua
@@ -49,11 +49,11 @@ local function asValue(source, title)
local type = infer.searchAndViewInfers(source)
local literal = infer.searchAndViewLiterals(source)
local cont
- if not infer.hasType(source, 'string', 0)
+ if not infer.hasType(source, 'string')
and not type:find('%[%]$')
and not type:find('%w%<') then
if #vm.getRefs(source, '*') > 0
- or infer.hasType(source, 'table', 0) then
+ or infer.hasType(source, 'table') then
cont = buildTable(source)
end
end
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 86dafff3..e6c7581f 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -464,7 +464,6 @@ function m.compileNode(noders, source)
if source.extends then
for _, ext in ipairs(source.extends) do
pushBackward(noders, id, getID(ext))
- pushBackward(noders, getID(ext), id)
end
end
if source.bindSources then
@@ -655,9 +654,6 @@ function m.compileNode(noders, source)
rtn.returnIndex
)
pushForward(noders, fullID, getID(rtn))
- for _, typeUnit in ipairs(rtn.types) do
- pushBackward(noders, getID(typeUnit), fullID)
- end
hasDocReturn[rtn.returnIndex] = true
end
end
@@ -743,7 +739,6 @@ function m.compileNode(noders, source)
)
local returnID = getID(rtn)
pushForward(noders, closureID, returnID)
- pushBackward(noders, returnID, closureID)
end
end
if source.type == 'generic.value' then
@@ -903,7 +898,7 @@ function m.compileNodes(source)
end)
-- Special rule: ('').XX -> stringlib.XX
pushBackward(noders, 'str:', 'dn:stringlib')
- --pushBackward(noders, 'dn:string', 'dn:stringlib')
+ pushBackward(noders, 'dn:string', 'dn:stringlib')
return noders
end
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 20fd600f..4063426d 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -227,7 +227,7 @@ function m.searchRefsByID(status, uri, expect, mode)
mark[id] = cmark
end
log.debug('search:', id, field)
- if field then
+ if field then
if cmark[field] then
return
end
@@ -354,7 +354,7 @@ function m.searchRefsByID(status, uri, expect, mode)
end
local function checkBackward(id, node, field)
- if mode ~= 'ref' and not field or ignoredIDs[id] then
+ if mode ~= 'ref' and not field then
return
end
for _, backwardID in ipairs(node.backward) do