summaryrefslogtreecommitdiff
path: root/server/src/method
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-19 15:46:08 +0800
committersumneko <sumneko@hotmail.com>2019-04-19 15:46:08 +0800
commit399b06f07224bf8666440b7bb83fa32f458b6edf (patch)
tree55e2d39911f1ce519fe2898942bbd919b3b2b6ff /server/src/method
parent46936f5d383d3a1e71c16c4907c7b7eacd3a9f1e (diff)
downloadlua-language-server-399b06f07224bf8666440b7bb83fa32f458b6edf.zip
修正一些诊断问题
Diffstat (limited to 'server/src/method')
-rw-r--r--server/src/method/textDocument/publishDiagnostics.lua5
1 files changed, 3 insertions, 2 deletions
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