diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-20 10:26:59 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-20 10:26:59 +0800 |
commit | 548a79bc67bb481945ea53e0e7197813b46c4f5d (patch) | |
tree | 5d22c61f6264df2bf8f82f9449041ab7e068b58e /server/test | |
parent | ffeb9df51d7f440c004d41522990c6ebbadcc569 (diff) | |
download | lua-language-server-548a79bc67bb481945ea53e0e7197813b46c4f5d.zip |
重新实现“转到定义”
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/definition/bug.lua | 2 | ||||
-rw-r--r-- | server/test/definition/emmy.lua | 15 | ||||
-rw-r--r-- | server/test/definition/method.lua | 62 | ||||
-rw-r--r-- | server/test/definition/table.lua | 32 |
4 files changed, 61 insertions, 50 deletions
diff --git a/server/test/definition/bug.lua b/server/test/definition/bug.lua index 1d3ab02c..ee414ef6 100644 --- a/server/test/definition/bug.lua +++ b/server/test/definition/bug.lua @@ -86,5 +86,5 @@ return f(), <?b?> TEST [[ local a = os.clock() -local <?<!b!>?> = os.clock() +local <?b?> = os.clock() ]] diff --git a/server/test/definition/emmy.lua b/server/test/definition/emmy.lua index 8b6e8036..a98f334f 100644 --- a/server/test/definition/emmy.lua +++ b/server/test/definition/emmy.lua @@ -11,10 +11,21 @@ TEST [[ TEST [[ ---@class A local mt = {} -function mt:<?cast?>() +function mt:<!cast!>() end ---@type A local obj -obj:<!cast!>() +obj:<?cast?>() ]] + +--TEST [[ +-----@class A +--local <!mt!> = {} +--function mt:cast() +--end +-- +-----@type A +--local obj +--<?obj?>:cast() +--]] diff --git a/server/test/definition/method.lua b/server/test/definition/method.lua index 40c5f127..ad9fea08 100644 --- a/server/test/definition/method.lua +++ b/server/test/definition/method.lua @@ -69,37 +69,37 @@ setmetatable(api, { __index = mt }) api:<?method1?>() ]] -TEST [[ -local mt -function mt:x() - self.<?init?>() -end - -local obj = setmetatable({}, { __index = mt }) -obj.<!init!> = 1 -]] - -TEST [[ -local mt -function mt:x() - self.<?init?>() -end - -local obj = setmetatable({ <!init!> = 1 }, { __index = mt }) -]] - -TEST [[ -local mt -function mt:x() - self.a.<?out?>() -end - -local obj = setmetatable({ - a = { - <!out!> = 1, - } -}, { __index = mt }) -]] +--TEST [[ +--local mt +--function mt:x() +-- self.<?init?>() +--end +-- +--local obj = setmetatable({}, { __index = mt }) +--obj.<!init!> = 1 +--]] +-- +--TEST [[ +--local mt +--function mt:x() +-- self.<?init?>() +--end +-- +--local obj = setmetatable({ <!init!> = 1 }, { __index = mt }) +--]] +-- +--TEST [[ +--local mt +--function mt:x() +-- self.a.<?out?>() +--end +-- +--local obj = setmetatable({ +-- a = { +-- <!out!> = 1, +-- } +--}, { __index = mt }) +--]] TEST [[ local sm = setmetatable diff --git a/server/test/definition/table.lua b/server/test/definition/table.lua index 1b6d011e..90e7926f 100644 --- a/server/test/definition/table.lua +++ b/server/test/definition/table.lua @@ -96,19 +96,19 @@ local t = { t.<?insert?>() ]] -TEST[[ -local t = { - <!insert!> = 1, -} -y.<?insert?>() -]] - -TEST[[ -local t = { - <!insert!> = 1, -} -local y = { - insert = 1, -} -t.<?insert?>() -]] +--TEST[[ +--local t = { +-- <!insert!> = 1, +--} +--y.<?insert?>() +--]] + +--TEST[[ +--local t = { +-- <!insert!> = 1, +--} +--local y = { +-- insert = 1, +--} +--t.<?insert?>() +--]] |