From bf8399c9057927d6746b47915a7b79c62d1082bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 31 Dec 2018 11:11:59 +0800 Subject: =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=AD=E6=B3=95=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/publishDiagnostics.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'server/src/method/textDocument') diff --git a/server/src/method/textDocument/publishDiagnostics.lua b/server/src/method/textDocument/publishDiagnostics.lua index 6e2f437a..c0d86845 100644 --- a/server/src/method/textDocument/publishDiagnostics.lua +++ b/server/src/method/textDocument/publishDiagnostics.lua @@ -87,11 +87,8 @@ local function buildError(err, lines) diagnostic.severity = DiagnosticSeverity.Warning end local startrow, startcol = lines:rowcol(err.start) - local endrow, endcol - if err.finish then - endrow, endcol = lines:rowcol(err.finish) - else - endrow = startrow + local endrow, endcol = lines:rowcol(err.finish) + if err.type == 'UNKNOWN' then local _, max = lines:range(endrow) endcol = max end -- cgit v1.2.3