summaryrefslogtreecommitdiff
path: root/script-beta/core/diagnostics/code-after-break.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/core/diagnostics/code-after-break.lua')
-rw-r--r--script-beta/core/diagnostics/code-after-break.lua34
1 files changed, 0 insertions, 34 deletions
diff --git a/script-beta/core/diagnostics/code-after-break.lua b/script-beta/core/diagnostics/code-after-break.lua
deleted file mode 100644
index a2bac8a4..00000000
--- a/script-beta/core/diagnostics/code-after-break.lua
+++ /dev/null
@@ -1,34 +0,0 @@
-local files = require 'files'
-local guide = require 'parser.guide'
-local lang = require 'language'
-local define = require 'proto.define'
-
-return function (uri, callback)
- local state = files.getAst(uri)
- if not state then
- return
- end
-
- local mark = {}
- guide.eachSourceType(state.ast, 'break', function (source)
- local list = source.parent
- if mark[list] then
- return
- end
- mark[list] = true
- for i = #list, 1, -1 do
- local src = list[i]
- if src == source then
- if i == #list then
- return
- end
- callback {
- start = list[i+1].start,
- finish = list[#list].range or list[#list].finish,
- tags = { define.DiagnosticTag.Unnecessary },
- message = lang.script.DIAG_CODE_AFTER_BREAK,
- }
- end
- end
- end)
-end