diff options
Diffstat (limited to 'script/core/diagnostics/deprecated.lua')
-rw-r--r-- | script/core/diagnostics/deprecated.lua | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/script/core/diagnostics/deprecated.lua b/script/core/diagnostics/deprecated.lua index 12b5ddce..0aeac9e9 100644 --- a/script/core/diagnostics/deprecated.lua +++ b/script/core/diagnostics/deprecated.lua @@ -35,14 +35,24 @@ return function (uri, callback) return end - if cache[id] then + if cache[id] == false then return end + if cache[id] then + callback { + start = src.start, + finish = src.finish, + tags = { define.DiagnosticTag.Deprecated }, + message = cache[id].message, + data = cache[id].data, + } + end + await.delay() if not vm.isDeprecated(src, true) then - cache[id] = true + cache[id] = false return end @@ -75,6 +85,12 @@ return function (uri, callback) message = ('%s(%s)'):format(message, lang.script('DIAG_DEFINED_VERSION', table.concat(versions, '/'), config.get 'Lua.runtime.version')) end end + cache[id] = { + message = message, + data = { + versions = versions, + }, + } callback { start = src.start, |