Skip to content

Commit a126e9c

Browse files
authored
Merge pull request #2840 from NeOzay/fix-autocompletion-arg-for-func-overload
Fix correctly display enums for function overload arguments
2 parents d1320ae + 7784a06 commit a126e9c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* `FIX` Fix `VM.OnCompileFunctionParam` function in plugins
99
* `FIX` Lua 5.1: fix incorrect warning when using setfenv with an int as first parameter
1010
* `FIX` Improve type narrow by checking exact match on literal type params
11+
* `FIX` Correctly list enums for function overload arguments [#2840](https://github.com/LuaLS/lua-language-server/pull/2840)
1112
* `FIX` Incorrect function params' type infer when there is only `@overload` [#2509](https://github.com/LuaLS/lua-language-server/issues/2509) [#2708](https://github.com/LuaLS/lua-language-server/issues/2708) [#2709](https://github.com/LuaLS/lua-language-server/issues/2709)
1213

1314
## 3.10.5

script/core/completion/completion.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ local function findNearestSource(state, position)
7878
---@type parser.object
7979
local source
8080
guide.eachSourceContain(state.ast, position, function (src)
81-
source = src
81+
if not source or source.start <= src.start then
82+
source = src
83+
end
8284
end)
8385
return source
8486
end

0 commit comments

Comments
 (0)