From 7cfc2aad9ee1bc2ebaba563c8a7c8f5a4f1c64f6 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, 11 Nov 2019 13:28:17 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=87=A0=E4=B8=AA=E8=AF=8A=E6=96=ADb?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/core/diagnostics/newline-call.lua | 2 +- server-beta/src/core/diagnostics/undefined-global.lua | 4 +--- server-beta/src/provider/init.lua | 2 ++ server-beta/test/diagnostics/init.lua | 7 +++++++ 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'server-beta') diff --git a/server-beta/src/core/diagnostics/newline-call.lua b/server-beta/src/core/diagnostics/newline-call.lua index 52b84197..cb318380 100644 --- a/server-beta/src/core/diagnostics/newline-call.lua +++ b/server-beta/src/core/diagnostics/newline-call.lua @@ -21,7 +21,7 @@ return function (uri, callback) return end - local nodeRow = guide.positionOf(lines, node.start) + local nodeRow = guide.positionOf(lines, node.finish) local argRow = guide.positionOf(lines, args.start) if nodeRow == argRow then return diff --git a/server-beta/src/core/diagnostics/undefined-global.lua b/server-beta/src/core/diagnostics/undefined-global.lua index 921ba086..c3fbccbf 100644 --- a/server-beta/src/core/diagnostics/undefined-global.lua +++ b/server-beta/src/core/diagnostics/undefined-global.lua @@ -43,15 +43,13 @@ return function (uri, callback) end end globalCache[key] = false - local message + local message = lang.script('DIAG_UNDEF_GLOBAL', skey) local otherVersion = library.other[skey] local customVersion = library.custom[skey] if otherVersion then message = ('%s(%s)'):format(message, lang.script('DIAG_DEFINED_VERSION', table.concat(otherVersion, '/'), config.config.runtime.version)) elseif customVersion then message = ('%s(%s)'):format(message, lang.script('DIAG_DEFINED_CUSTOM', table.concat(customVersion, '/'))) - else - message = lang.script('DIAG_UNDEF_GLOBAL', skey) end for _, info in ipairs(infos) do callback { diff --git a/server-beta/src/provider/init.lua b/server-beta/src/provider/init.lua index c4835dce..5f3d2db4 100644 --- a/server-beta/src/provider/init.lua +++ b/server-beta/src/provider/init.lua @@ -7,6 +7,7 @@ local proto = require 'proto.proto' local define = require 'proto.define' local workspace = require 'workspace' local config = require 'config' +local library = require 'library' local function updateConfig() local configs = proto.awaitRequest('workspace/configuration', { @@ -38,6 +39,7 @@ local function updateConfig() local newConfig = config.config local newOther = config.other if not util.equal(oldConfig.runtime, newConfig.runtime) then + library.reload() end if not util.equal(oldConfig.diagnostics, newConfig.diagnostics) then end diff --git a/server-beta/test/diagnostics/init.lua b/server-beta/test/diagnostics/init.lua index 1493494d..aaf51987 100644 --- a/server-beta/test/diagnostics/init.lua +++ b/server-beta/test/diagnostics/init.lua @@ -202,6 +202,13 @@ print() ('string') ]] +TEST [[ +local x +return x + : f(1) + : f(1) +]] + TEST [[ return {