summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-12 16:32:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-12 16:32:28 +0800
commitf0d3ef728726217a791764bdfc2d2375e1217afb (patch)
tree640713cbeaec527d4d40bc4cf67797225813af1f /script/core
parent84cd1c05f26842c2ae72238ec5d68bba8464ef4d (diff)
downloadlua-language-server-f0d3ef728726217a791764bdfc2d2375e1217afb.zip
unnecessary tag
Diffstat (limited to 'script/core')
-rw-r--r--script/core/diagnostics/unreachable-code.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/script/core/diagnostics/unreachable-code.lua b/script/core/diagnostics/unreachable-code.lua
index 28aee6ea..a386198c 100644
--- a/script/core/diagnostics/unreachable-code.lua
+++ b/script/core/diagnostics/unreachable-code.lua
@@ -3,6 +3,7 @@ local guide = require 'parser.guide'
local vm = require 'vm'
local lang = require 'language'
local await = require 'await'
+local define = require 'proto.define'
---@param block parser.object
---@return boolean
@@ -56,8 +57,9 @@ return function (uri, callback)
and hasReturn(action) then
if i < #source then
callback {
- start = source[i+1].start,
- finish = source[#source].finish,
+ start = source[i+1].start,
+ finish = source[#source].finish,
+ tags = { define.DiagnosticTag.Unnecessary },
message = lang.script('DIAG_UNREACHABLE_CODE'),
}
end