diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-12 15:04:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-12 15:04:07 +0800 |
commit | 5eb3ac474afd0b78929617ffd485054104dc780e (patch) | |
tree | 5f49ac8d45868e55f0ecd729e36af38752561ff8 /server-beta/src/core | |
parent | 48b2f21602b5c041843125a071e50dde94527fa9 (diff) | |
download | lua-language-server-5eb3ac474afd0b78929617ffd485054104dc780e.zip |
支持goto
Diffstat (limited to 'server-beta/src/core')
-rw-r--r-- | server-beta/src/core/engineer.lua | 2 | ||||
-rw-r--r-- | server-beta/src/core/goto.lua | 13 | ||||
-rw-r--r-- | server-beta/src/core/label.lua | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/server-beta/src/core/engineer.lua b/server-beta/src/core/engineer.lua index 036095dc..9171af39 100644 --- a/server-beta/src/core/engineer.lua +++ b/server-beta/src/core/engineer.lua @@ -25,6 +25,8 @@ mt['boolean'] = require 'core.boolean' mt['string'] = require 'core.string' mt['table'] = require 'core.table' mt['select'] = require 'core.select' +mt['goto'] = require 'core.goto' +mt['label'] = require 'core.label' local specials = { ['_G'] = true, diff --git a/server-beta/src/core/goto.lua b/server-beta/src/core/goto.lua new file mode 100644 index 00000000..4652f8be --- /dev/null +++ b/server-beta/src/core/goto.lua @@ -0,0 +1,13 @@ +local guide = require 'parser.guide' + +local m = {} + +function m:def(source, callback) + local name = source[1] + local label = guide.getLabel(source, name) + if label then + callback(label) + end +end + +return m diff --git a/server-beta/src/core/label.lua b/server-beta/src/core/label.lua new file mode 100644 index 00000000..f05a57e6 --- /dev/null +++ b/server-beta/src/core/label.lua @@ -0,0 +1,3 @@ +local m = {} + +return m |