blob: 5d9488a123a51b365b975a01a36e1a7e9324b06f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
local files = require 'files'
local searcher = require 'core.searcher'
local define = require 'proto.define'
local lang = require 'language'
return function (uri, callback)
local ast = files.getAst(uri)
if not ast then
return
end
searcher.eachSourceType(ast.ast, 'label', function (source)
if not source.ref then
callback {
start = source.start,
finish = source.finish,
tags = { define.DiagnosticTag.Unnecessary },
message = lang.script('DIAG_UNUSED_LABEL', source[1]),
}
end
end)
end
|