summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-11 13:28:17 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-11 13:28:17 +0800
commit7cfc2aad9ee1bc2ebaba563c8a7c8f5a4f1c64f6 (patch)
tree1d7d7e573d658ac75304b382eb09f251db76b622
parent57b8f00759bedec39cd22b7deeb22e59de80fabc (diff)
downloadlua-language-server-7cfc2aad9ee1bc2ebaba563c8a7c8f5a4f1c64f6.zip
修正几个诊断bug
-rw-r--r--server-beta/src/core/diagnostics/newline-call.lua2
-rw-r--r--server-beta/src/core/diagnostics/undefined-global.lua4
-rw-r--r--server-beta/src/provider/init.lua2
-rw-r--r--server-beta/test/diagnostics/init.lua7
4 files changed, 11 insertions, 4 deletions
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
@@ -203,6 +203,13 @@ print()
]]
TEST [[
+local x
+return x
+ : f(1)
+ : f(1)
+]]
+
+TEST [[
return {
<!print
'string'!>