summaryrefslogtreecommitdiff
path: root/server-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-14 20:53:34 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-14 20:53:34 +0800
commitbfa16248754205f363134e61f930ebca16a2d21b (patch)
treef7a1c1bb9f8f1cd11d9e0910d91f5a459d3c05ca /server-beta
parent1e6387f2602329cd0bfa33b80e551be4c7cadfeb (diff)
downloadlua-language-server-bfa16248754205f363134e61f930ebca16a2d21b.zip
先测试 reference
Diffstat (limited to 'server-beta')
-rw-r--r--server-beta/src/parser/compile.lua5
-rw-r--r--server-beta/test.lua2
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'