blob: 9e492a29439f676207cf9f95ddb1e2cd03b8b501 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
local files = require 'files'
local lang = require 'language'
local define = require 'proto.define'
return function (uri, callback)
local state = files.getState(uri)
if not state then
return
end
if not state.ast.docs then
return
end
for _, doc in ipairs(state.ast.docs) do
if doc.type == 'doc.diagnostic' then
if doc.names then
for _, nameUnit in ipairs(doc.names) do
local code = nameUnit[1]
if not define.DiagnosticDefaultSeverity[code] then
callback {
start = nameUnit.start,
finish = nameUnit.finish,
message = lang.script('DIAG_UNKNOWN_DIAG_CODE', code),
}
end
end
end
end
end
end
|