diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-20 13:44:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-20 13:44:31 +0800 |
commit | 8d5bc3299d3bc02f3ff295efc22d9b00f373af7f (patch) | |
tree | 23cb8c5da7ab32337607f7aa8a469192962065ef /src/matcher | |
parent | c6e00ba82ab0e15fbbaad59ef91cfb08caeb6f7d (diff) | |
download | lua-language-server-8d5bc3299d3bc02f3ff295efc22d9b00f373af7f.zip |
先取最后一个实现
Diffstat (limited to 'src/matcher')
-rw-r--r-- | src/matcher/implementation.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/matcher/implementation.lua b/src/matcher/implementation.lua index 2d601bde..3bb37d25 100644 --- a/src/matcher/implementation.lua +++ b/src/matcher/implementation.lua @@ -67,12 +67,14 @@ local function checkImplementation(name, p) local list = scopeGet(name) if list then result = {} - for i, obj in ipairs(list) do + for i = #list, 1, -1 do + local obj = list[i] local name, start, finish = obj[1], obj[2], obj[3] if not finish then finish = start + #name - 1 end - result[i] = {start, finish} + result[#result+1] = {start, finish} + break end else result = false |