Skip to content

Commit 202bc99

Browse files
committed
fix #923
1 parent f5991c0 commit 202bc99

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 2.6.3
44
* `FIX` new files are not loaded correctly
5+
* `FIX` [#923](https://github.com/sumneko/lua-language-server/issues/923)
56
* `FIX` [#926](https://github.com/sumneko/lua-language-server/issues/926)
67

78
## 2.6.2

script/core/searcher.lua

+7-7
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ local function pushResult(status, mode, source, force)
219219
end
220220
end
221221

222-
local parent = source.parent
223-
if parent.type == 'return' then
224-
if source ~= status.source then
225-
results[#results+1] = source
226-
return true
227-
end
228-
end
222+
--local parent = source.parent
223+
--if parent.type == 'return' then
224+
-- if source ~= status.source then
225+
-- results[#results+1] = source
226+
-- return true
227+
-- end
228+
--end
229229

230230
return false
231231
end

test/crossfile/definition.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ config.set(nil, 'Lua.runtime.pathStrict', false)
149149
TEST {
150150
{
151151
path = 'a.lua',
152-
content = 'local <!t!> = 1; return <!t!>',
152+
content = 'local <!t!> = 1; return t',
153153
},
154154
{
155155
path = 'b.lua',
@@ -160,7 +160,7 @@ TEST {
160160
TEST {
161161
{
162162
path = 'a.lua',
163-
content = 'local <!t!> = 1; return <!t!>',
163+
content = 'local <!t!> = 1; return t',
164164
},
165165
{
166166
path = 'b.lua',
@@ -188,7 +188,7 @@ local <~t~>
188188
TEST {
189189
{
190190
path = 'a.lua',
191-
content = 'local <!t!> = 1; return <!t!>',
191+
content = 'local <!t!> = 1; return t',
192192
},
193193
{
194194
path = 'b.lua',
@@ -254,7 +254,7 @@ TEST {
254254
{
255255
path = 'a.lua',
256256
content = [[
257-
return <!a():b():c()!>
257+
return a():b():c()
258258
]],
259259
},
260260
{
@@ -397,7 +397,7 @@ TEST {
397397
content = [[
398398
local function <!f!>()
399399
end
400-
return <!f!>
400+
return f
401401
]]
402402
},
403403
{

test/definition/bug.lua

+9-9
Original file line numberDiff line numberDiff line change
@@ -178,42 +178,42 @@ local A, B
178178
179179
function A:get1()
180180
local <!a!> = B:get()
181-
return <!a!>
181+
return a
182182
end
183183
184184
function A:get2()
185185
local <!a!> = B:get()
186-
return <!a!>
186+
return a
187187
end
188188
189189
function A:get3()
190190
local <!a!> = B:get()
191-
return <!a!>
191+
return a
192192
end
193193
194194
function A:get4()
195195
local <!a!> = B:get()
196-
return <!a!>
196+
return a
197197
end
198198
199199
function A:get5()
200200
local <!a!> = B:get()
201-
return <!a!>
201+
return a
202202
end
203203
204204
function A:get6()
205205
local <!a!> = B:get()
206-
return <!a!>
206+
return a
207207
end
208208
209209
function A:get7()
210210
local <!a!> = B:get()
211-
return <!a!>
211+
return a
212212
end
213213
214214
function A:get8()
215215
local <!a!> = B:get()
216-
return <!a!>
216+
return a
217217
end
218218
219219
function B:get()
@@ -226,7 +226,7 @@ function B:get()
226226
<!b!> = A:get6()
227227
<!b!> = A:get7()
228228
<!b!> = A:get8()
229-
return <!b!>
229+
return b
230230
end
231231
232232
local <!b!> = B:get()

test/definition/call.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
TEST [[
22
function f()
33
local <!x!>
4-
return <!x!>
4+
return x
55
end
66
local <!y!> = f()
77
print(<?y?>)

0 commit comments

Comments
 (0)