summaryrefslogtreecommitdiff
path: root/server/src/matcher
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-06 15:05:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-06 15:05:08 +0800
commitf85f60c41a33ea562081d19aeba64fbe4400d905 (patch)
tree4b7f9735ec22d2556562f73df795749bd697eece /server/src/matcher
parentfaffcd9d8d94ddc965adce302850195d8390d170 (diff)
downloadlua-language-server-f85f60c41a33ea562081d19aeba64fbe4400d905.zip
不要code了
Diffstat (limited to 'server/src/matcher')
-rw-r--r--server/src/matcher/diagnostics.lua20
1 files changed, 8 insertions, 12 deletions
diff --git a/server/src/matcher/diagnostics.lua b/server/src/matcher/diagnostics.lua
index 62bc3cd1..39465e73 100644
--- a/server/src/matcher/diagnostics.lua
+++ b/server/src/matcher/diagnostics.lua
@@ -109,33 +109,30 @@ end
return function (ast, results, lines)
local datas = {}
-- 未使用的局部变量
- searchUnusedLocals(results, function (start, finish, code)
+ searchUnusedLocals(results, function (start, finish, key)
datas[#datas+1] = {
start = start,
finish = finish,
level = 'Warning',
- code = code,
- message = 'Unused local', -- LOCALE
+ message = ('Unused local `%s`'):format(key), -- LOCALE
}
end)
-- 读取未定义全局变量
- searchUndefinedGlobal(results, function (start, finish, code)
+ searchUndefinedGlobal(results, function (start, finish, key)
datas[#datas+1] = {
start = start,
finish = finish,
level = 'Warning',
- code = code,
- message = 'Undefined global', -- LOCALE
+ message = ('Undefined global `%s`'):format(key), -- LOCALE
}
end)
-- 未使用的Label
- searchUnusedLabel(results, function (start, finish, code)
+ searchUnusedLabel(results, function (start, finish, key)
datas[#datas+1] = {
start = start,
finish = finish,
level = 'Warning',
- code = code,
- message = 'Unused label', -- LOCALE
+ message = ('Unused label `%s`'):format(key), -- LOCALE
}
end)
-- 只有空格与制表符的行,以及后置空格
@@ -148,13 +145,12 @@ return function (ast, results, lines)
}
end)
-- 重定义局部变量
- searchRedefinition(results, function (start, finish, code)
+ searchRedefinition(results, function (start, finish, key)
datas[#datas+1] = {
start = start,
finish = finish,
level = 'Warning',
- code = code,
- message = 'Redefined local',
+ message = ('Redefined local `%s`'):format(key),
}
end)
return datas