Skip to content

Commit bd754b0

Browse files
committed
fix #294
1 parent d3ba148 commit bd754b0

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* `FIX` completion: require path broken
1313
* `FIX` hover: document uri
1414
* `FIX` [#291](https://github.com/sumneko/lua-language-server/issues/291)
15+
* `FIX` [#294](https://github.com/sumneko/lua-language-server/issues/294)
1516

1617
## 1.6.0
1718
`2020-12-14`

script/parser/guide.lua

+11-2
Original file line numberDiff line numberDiff line change
@@ -2312,9 +2312,13 @@ function m.pushResult(status, mode, ref, simple)
23122312
or ref.type == 'getmethod' then
23132313
results[#results+1] = ref
23142314
elseif ref.type == 'setindex'
2315-
or ref.type == 'getindex'
23162315
or ref.type == 'tableindex' then
23172316
results[#results+1] = ref
2317+
elseif ref.type == 'getindex' then
2318+
-- do not trust `t[1]`
2319+
if ref.index.type == 'string' then
2320+
results[#results+1] = ref
2321+
end
23182322
elseif ref.type == 'setglobal'
23192323
or ref.type == 'getglobal' then
23202324
results[#results+1] = ref
@@ -2440,12 +2444,17 @@ function m.searchSameFields(status, simple, mode)
24402444
}
24412445
end
24422446
local max = 0
2443-
local lock = {}
2447+
local locks = {}
24442448
for i = 1, 1e6 do
24452449
local data = queue[i]
24462450
if not data then
24472451
return
24482452
end
2453+
local lock = locks[data.start]
2454+
if not lock then
2455+
lock = {}
2456+
locks[data.start] = lock
2457+
end
24492458
if not lock[data.obj] then
24502459
lock[data.obj] = true
24512460
max = max + 1

test/definition/luadoc.lua

+12
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,15 @@ end
157157
158158
---@see loli#<?pants?>
159159
]]
160+
161+
TEST [[
162+
---@class AAAA
163+
---@field a AAAA
164+
AAAA = {};
165+
166+
function AAAA:<!SSDF!>()
167+
168+
end
169+
170+
AAAA.a.<?SSDF?>
171+
]]

0 commit comments

Comments
 (0)