summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-11 19:32:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-11 19:32:31 +0800
commitd587d5c381c9cf8c59fb6aa0caf26fc7288ed550 (patch)
treec81c50e5b078d179027c5d6166d2e3e3efde584f /script
parent4df0ae57a2486d1f8e3329e244aedfddeacafc12 (diff)
downloadlua-language-server-d587d5c381c9cf8c59fb6aa0caf26fc7288ed550.zip
fix
Diffstat (limited to 'script')
-rw-r--r--script/core/noder.lua3
-rw-r--r--script/core/searcher.lua2
-rw-r--r--script/vm/getDocs.lua6
3 files changed, 8 insertions, 3 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 1e62ed2e..d68cc3ba 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -528,6 +528,9 @@ function m.compileNode(noders, source)
end
end
if source.type == 'call' then
+ if not id then
+ return
+ end
local node = source.node
local nodeID = getID(node)
if not nodeID then
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index eaef5102..0d59932d 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -522,7 +522,7 @@ function m.searchRefsByID(status, uri, expect, mode)
local stepCount = 0
function searchStep(id, field)
stepCount = stepCount + 1
- --status.count = status.count + 1
+ status.count = status.count + 1
if stepCount > 1000
or status.count > 10000 then
if TEST then
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index bc7df626..0f12c763 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -25,8 +25,10 @@ end
function vm.getDocDefines(name)
local results = {}
for uri in files.eachFile() do
- local ast = files.getState(uri)
- getDocDefinesInAst(results, ast.ast, name)
+ local state = files.getState(uri)
+ if state then
+ getDocDefinesInAst(results, state.ast, name)
+ end
end
return results
end