diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-08-13 00:08:42 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-08-13 00:08:42 +0800 |
commit | 7cc86b43e1284bf173f46c3e3ba760551831ddf1 (patch) | |
tree | 3e62afa996569f693630b135b9234aec420d69d7 /script/proto/diagnostic.lua | |
parent | 034dc50f68d9d58b4a45b91d41d37eb682800f9b (diff) | |
download | lua-language-server-7cc86b43e1284bf173f46c3e3ba760551831ddf1.zip |
fix #1428
Diffstat (limited to 'script/proto/diagnostic.lua')
-rw-r--r-- | script/proto/diagnostic.lua | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/script/proto/diagnostic.lua b/script/proto/diagnostic.lua index 9b0303cc..f6645e89 100644 --- a/script/proto/diagnostic.lua +++ b/script/proto/diagnostic.lua @@ -244,18 +244,20 @@ function m.getDiagAndErrNameMap() for name in pairs(m.getDefaultSeverity()) do names[name] = true end - local path = package.searchpath('parser.compile', package.path) - if path then - local f = io.open(path) - if f then - for line in f:lines() do - local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=]) - if name then - local id = name:lower():gsub('_', '-') - names[id] = true + for _, fileName in ipairs {'parser.compile', 'parser.luadoc'} do + local path = package.searchpath(fileName, package.path) + if path then + local f = io.open(path) + if f then + for line in f:lines() do + local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=]) + if name then + local id = name:lower():gsub('_', '-') + names[id] = true + end end + f:close() end - f:close() end end table.sort(names) |