diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-14 20:53:34 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-14 20:53:34 +0800 |
commit | bfa16248754205f363134e61f930ebca16a2d21b (patch) | |
tree | f7a1c1bb9f8f1cd11d9e0910d91f5a459d3c05ca /server-beta | |
parent | 1e6387f2602329cd0bfa33b80e551be4c7cadfeb (diff) | |
download | lua-language-server-bfa16248754205f363134e61f930ebca16a2d21b.zip |
先测试 reference
Diffstat (limited to 'server-beta')
-rw-r--r-- | server-beta/src/parser/compile.lua | 5 | ||||
-rw-r--r-- | server-beta/test.lua | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/server-beta/src/parser/compile.lua b/server-beta/src/parser/compile.lua index 2fdab43d..48cebcad 100644 --- a/server-beta/src/parser/compile.lua +++ b/server-beta/src/parser/compile.lua @@ -453,7 +453,10 @@ local function compileGoTo(obj) } return end - label.ref = obj + if not label.ref then + label.ref = {} + end + label.ref[#label.ref+1] = obj -- 如果有局部变量在 goto 与 label 之间声明, -- 并在 label 之后使用,则算作语法错误 diff --git a/server-beta/test.lua b/server-beta/test.lua index ad282687..ffe9402d 100644 --- a/server-beta/test.lua +++ b/server-beta/test.lua @@ -36,9 +36,9 @@ local function main() print(('测试[%s]用时[%.3f]'):format(name, os.clock() - clock)) end + test 'references' test 'definition' test 'diagnostics' - test 'references' --test 'highlight' --test 'rename' --test 'type_inference' |