From f0d3ef728726217a791764bdfc2d2375e1217afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 12 Jul 2022 16:32:28 +0800 Subject: unnecessary tag --- script/core/diagnostics/unreachable-code.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'script/core') 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 -- cgit v1.2.3