diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 17:05:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 17:05:57 +0800 |
commit | 891ebf5760d7c7ac39cdcfa7042b33e93f4e9ade (patch) | |
tree | 2bac552396500cf912214d876c3d16670b64943e | |
parent | 0cf988c135cb2a94cda80cfbca187a3b58b2eee6 (diff) | |
download | lua-language-server-891ebf5760d7c7ac39cdcfa7042b33e93f4e9ade.zip |
#306
-rw-r--r-- | script/files.lua | 1 | ||||
-rw-r--r-- | script/parser/guide.lua | 2 | ||||
-rw-r--r-- | script/vm/getDocs.lua | 3 |
3 files changed, 5 insertions, 1 deletions
diff --git a/script/files.lua b/script/files.lua index 71981a83..eb9fe97c 100644 --- a/script/files.lua +++ b/script/files.lua @@ -210,6 +210,7 @@ function m.removeAllClosed() end --- 遍历文件 +--- TODO: 协程不安全 function m.eachFile() return pairs(m.fileMap) end diff --git a/script/parser/guide.lua b/script/parser/guide.lua index ba858eaf..1f1ab48a 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -2263,7 +2263,7 @@ function m.pushResult(status, mode, ref, simple) end end if m.isLiteral(ref) - and ref.parent.type == 'callargs' + and ref.parent and ref.parent.type == 'callargs' and ref ~= simple.node then results[#results+1] = ref end diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua index 1c54d593..632dd1c2 100644 --- a/script/vm/getDocs.lua +++ b/script/vm/getDocs.lua @@ -51,6 +51,9 @@ local function getDocTypes(name) end function vm.getDocEnums(doc, mark, results) + if not doc then + return nil + end mark = mark or {} if mark[doc] then return nil |