Skip to content

Commit 7cc86b4

Browse files
committed
fix #1428
1 parent 034dc50 commit 7cc86b4

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409)
55
* `FIX` [#1422](https://github.com/sumneko/lua-language-server/issues/1422)
66
* `FIX` [#1425](https://github.com/sumneko/lua-language-server/issues/1425)
7+
* `FIX` [#1428](https://github.com/sumneko/lua-language-server/issues/1428)
78

89
## 3.5.2
910
`2022-8-1`

script/proto/diagnostic.lua

+12-10
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,20 @@ function m.getDiagAndErrNameMap()
244244
for name in pairs(m.getDefaultSeverity()) do
245245
names[name] = true
246246
end
247-
local path = package.searchpath('parser.compile', package.path)
248-
if path then
249-
local f = io.open(path)
250-
if f then
251-
for line in f:lines() do
252-
local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=])
253-
if name then
254-
local id = name:lower():gsub('_', '-')
255-
names[id] = true
247+
for _, fileName in ipairs {'parser.compile', 'parser.luadoc'} do
248+
local path = package.searchpath(fileName, package.path)
249+
if path then
250+
local f = io.open(path)
251+
if f then
252+
for line in f:lines() do
253+
local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=])
254+
if name then
255+
local id = name:lower():gsub('_', '-')
256+
names[id] = true
257+
end
256258
end
259+
f:close()
257260
end
258-
f:close()
259261
end
260262
end
261263
table.sort(names)

0 commit comments

Comments
 (0)