Skip to content

Commit 0f2d789

Browse files
committedMar 7, 2023
search full refs for global
fix #1914
1 parent 81cffaa commit 0f2d789

File tree

3 files changed

+36
-22
lines changed

3 files changed

+36
-22
lines changed
 

‎changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
## 3.6.14
44
* `FIX` [#1753]
5+
* `FIX` [#1914]
56

67
[#1753]: https://github.com/LuaLS/lua-language-server/issues/1753
8+
[#1914]: https://github.com/LuaLS/lua-language-server/issues/1914
79

810
## 3.6.13
911
`2023-3-2`

‎script/vm/ref.lua

+21-22
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,28 @@ local function searchWord(source, pushResult, defMap, fileNotify)
107107
await.delay()
108108
end
109109
end)
110-
else
111-
---@async
112-
guide.eachSourceTypes(state.ast, {'getfield', 'setfield'}, function (src)
113-
if src.field and src.field[1] == key then
114-
checkDef(src)
115-
await.delay()
116-
end
117-
end)
118-
---@async
119-
guide.eachSourceTypes(state.ast, {'getmethod', 'setmethod'}, function (src)
120-
if src.method and src.method[1] == key then
121-
checkDef(src)
122-
await.delay()
123-
end
124-
end)
125-
---@async
126-
guide.eachSourceTypes(state.ast, {'getindex', 'setindex'}, function (src)
127-
if src.index and src.index.type == 'string' and src.index[1] == key then
128-
checkDef(src)
129-
await.delay()
130-
end
131-
end)
132110
end
111+
---@async
112+
guide.eachSourceTypes(state.ast, {'getfield', 'setfield'}, function (src)
113+
if src.field and src.field[1] == key then
114+
checkDef(src)
115+
await.delay()
116+
end
117+
end)
118+
---@async
119+
guide.eachSourceTypes(state.ast, {'getmethod', 'setmethod'}, function (src)
120+
if src.method and src.method[1] == key then
121+
checkDef(src)
122+
await.delay()
123+
end
124+
end)
125+
---@async
126+
guide.eachSourceTypes(state.ast, {'getindex', 'setindex'}, function (src)
127+
if src.index and src.index.type == 'string' and src.index[1] == key then
128+
checkDef(src)
129+
await.delay()
130+
end
131+
end)
133132
end
134133

135134
searchInAllFiles(guide.getUri(source), findWord, fileNotify)

‎test/references/all.lua

+13
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,16 @@ end
126126
local v1 = Master:foobar("", Dog)
127127
v1.<!eat!>()
128128
]]
129+
130+
TEST [[
131+
---@class A
132+
A = {}
133+
134+
function A:<~TestA~>()
135+
end
136+
137+
---@param param A
138+
function TestB(param)
139+
param:<!TestA!>()
140+
end
141+
]]

0 commit comments

Comments
 (0)