From 399b06f07224bf8666440b7bb83fa32f458b6edf Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 19 Apr 2019 15:46:08 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=BA=9B=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/publishDiagnostics.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/src/method') diff --git a/server/src/method/textDocument/publishDiagnostics.lua b/server/src/method/textDocument/publishDiagnostics.lua index fbe65bb3..3a4e4658 100644 --- a/server/src/method/textDocument/publishDiagnostics.lua +++ b/server/src/method/textDocument/publishDiagnostics.lua @@ -43,7 +43,7 @@ local function getRange(start, finish, lines) } end -local function createInfo(data, lines) +local function createInfo(lsp, data, lines) local diagnostic = { source = lang.script.DIAG_DIAGNOSTICS, range = getRange(data.start, data.finish, lines), @@ -54,6 +54,7 @@ local function createInfo(data, lines) if data.related then local related = {} for i, info in ipairs(data.related) do + local _, lines = lsp:getVM(info.uri) local message = info.message if not message then local start_line = lines:rowcol(info.start) @@ -144,7 +145,7 @@ return function (lsp, params) if vm then local datas = core.diagnostics(vm, lines, uri) for _, data in ipairs(datas) do - diagnostics[#diagnostics+1] = createInfo(data, lines) + diagnostics[#diagnostics+1] = createInfo(lsp, data, lines) end end if errs then -- cgit v1.2.3