diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/proto/diagnostic.lua | 22 |
2 files changed, 13 insertions, 10 deletions
diff --git a/changelog.md b/changelog.md index e8e60de6..2ef6643d 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ * `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409) * `FIX` [#1422](https://github.com/sumneko/lua-language-server/issues/1422) * `FIX` [#1425](https://github.com/sumneko/lua-language-server/issues/1425) +* `FIX` [#1428](https://github.com/sumneko/lua-language-server/issues/1428) ## 3.5.2 `2022-8-1` 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) |