summaryrefslogtreecommitdiff
path: root/server-beta/src/core/diagnostics/global-in-nil-env.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-05 19:31:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-05 19:31:38 +0800
commitc844e46ae97f28ec928db6b701fdf5f2eea2664d (patch)
tree938d77a0aadb6a3975d146659302137f58d9babc /server-beta/src/core/diagnostics/global-in-nil-env.lua
parent5d4d2ccd06d56bb92219baf3825c5786efdf906c (diff)
downloadlua-language-server-c844e46ae97f28ec928db6b701fdf5f2eea2664d.zip
更新诊断实现
Diffstat (limited to 'server-beta/src/core/diagnostics/global-in-nil-env.lua')
-rw-r--r--server-beta/src/core/diagnostics/global-in-nil-env.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/server-beta/src/core/diagnostics/global-in-nil-env.lua b/server-beta/src/core/diagnostics/global-in-nil-env.lua
index a19a341f..72375ea5 100644
--- a/server-beta/src/core/diagnostics/global-in-nil-env.lua
+++ b/server-beta/src/core/diagnostics/global-in-nil-env.lua
@@ -40,14 +40,25 @@ return function (uri, callback)
local mode, pathA = guide.getPath(nilDef, source)
if mode == 'before'
and mayRun(pathA) then
- callback {
- start = source.start,
- finish = source.finish,
- uri = uri,
- message = lang.script.DIAG_GLOBAL_IN_NIL_ENV,
- }
+ ok = nilDef
+ break
end
end
+ if ok then
+ callback {
+ start = source.start,
+ finish = source.finish,
+ uri = uri,
+ message = lang.script.DIAG_GLOBAL_IN_NIL_ENV,
+ relative = {
+ {
+ start = ok.start,
+ finish = ok.finish,
+ uri = uri,
+ }
+ }
+ }
+ end
end
end