diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/core/searcher.lua | 14 | ||||
-rw-r--r-- | test/crossfile/definition.lua | 10 | ||||
-rw-r--r-- | test/definition/bug.lua | 18 | ||||
-rw-r--r-- | test/definition/call.lua | 2 |
5 files changed, 23 insertions, 22 deletions
diff --git a/changelog.md b/changelog.md index 53b04ad0..acf13ee6 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## 2.6.3 * `FIX` new files are not loaded correctly +* `FIX` [#923](https://github.com/sumneko/lua-language-server/issues/923) * `FIX` [#926](https://github.com/sumneko/lua-language-server/issues/926) ## 2.6.2 diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 17e14b9c..eb70c349 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -219,13 +219,13 @@ local function pushResult(status, mode, source, force) end end - local parent = source.parent - if parent.type == 'return' then - if source ~= status.source then - results[#results+1] = source - return true - end - end + --local parent = source.parent + --if parent.type == 'return' then + -- if source ~= status.source then + -- results[#results+1] = source + -- return true + -- end + --end return false end diff --git a/test/crossfile/definition.lua b/test/crossfile/definition.lua index ecd6f98e..eaf12b73 100644 --- a/test/crossfile/definition.lua +++ b/test/crossfile/definition.lua @@ -149,7 +149,7 @@ config.set(nil, 'Lua.runtime.pathStrict', false) TEST { { path = 'a.lua', - content = 'local <!t!> = 1; return <!t!>', + content = 'local <!t!> = 1; return t', }, { path = 'b.lua', @@ -160,7 +160,7 @@ TEST { TEST { { path = 'a.lua', - content = 'local <!t!> = 1; return <!t!>', + content = 'local <!t!> = 1; return t', }, { path = 'b.lua', @@ -188,7 +188,7 @@ local <~t~> TEST { { path = 'a.lua', - content = 'local <!t!> = 1; return <!t!>', + content = 'local <!t!> = 1; return t', }, { path = 'b.lua', @@ -254,7 +254,7 @@ TEST { { path = 'a.lua', content = [[ - return <!a():b():c()!> + return a():b():c() ]], }, { @@ -397,7 +397,7 @@ TEST { content = [[ local function <!f!>() end - return <!f!> + return f ]] }, { diff --git a/test/definition/bug.lua b/test/definition/bug.lua index 4a755170..77797f40 100644 --- a/test/definition/bug.lua +++ b/test/definition/bug.lua @@ -178,42 +178,42 @@ local A, B function A:get1() local <!a!> = B:get() - return <!a!> + return a end function A:get2() local <!a!> = B:get() - return <!a!> + return a end function A:get3() local <!a!> = B:get() - return <!a!> + return a end function A:get4() local <!a!> = B:get() - return <!a!> + return a end function A:get5() local <!a!> = B:get() - return <!a!> + return a end function A:get6() local <!a!> = B:get() - return <!a!> + return a end function A:get7() local <!a!> = B:get() - return <!a!> + return a end function A:get8() local <!a!> = B:get() - return <!a!> + return a end function B:get() @@ -226,7 +226,7 @@ function B:get() <!b!> = A:get6() <!b!> = A:get7() <!b!> = A:get8() - return <!b!> + return b end local <!b!> = B:get() diff --git a/test/definition/call.lua b/test/definition/call.lua index 42502f40..15364396 100644 --- a/test/definition/call.lua +++ b/test/definition/call.lua @@ -1,7 +1,7 @@ TEST [[ function f() local <!x!> - return <!x!> + return x end local <!y!> = f() print(<?y?>) |