From 86a9b83d68da99f26a56ce914c65698a3714f0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 26 Dec 2018 14:12:57 +0800 Subject: =?UTF-8?q?=E8=B7=A8=E6=96=87=E4=BB=B6=E8=BD=AC=E5=88=B0=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E6=89=BE=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/matcher/implementation.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'server/src/matcher/implementation.lua') diff --git a/server/src/matcher/implementation.lua b/server/src/matcher/implementation.lua index 6f90484e..9ff3fdca 100644 --- a/server/src/matcher/implementation.lua +++ b/server/src/matcher/implementation.lua @@ -2,7 +2,7 @@ local function parseResultAcrossUri(positions, vm, result) -- 跨越文件时,遍历的是值的绑定信息 for _, info in ipairs(result.value) do if info.type == 'set' and info.source.uri == result.value.uri then - positions[#positions+1] = { + positions[1] = { info.source.start, info.source.finish, info.source.uri, @@ -12,7 +12,7 @@ local function parseResultAcrossUri(positions, vm, result) if #positions == 0 then for _, info in ipairs(result.value) do if info.type == 'return' and info.source.uri == result.value.uri then - positions[#positions+1] = { + positions[1] = { info.source.start, info.source.finish, info.source.uri, @@ -20,6 +20,12 @@ local function parseResultAcrossUri(positions, vm, result) end end end + if #positions == 0 then + positions[1] = { + 0, 0, + result.value.uri, + } + end end local function parseResult(vm, result) -- cgit v1.2.3