Skip to content

Commit

Permalink
Merge pull request #2840 from NeOzay/fix-autocompletion-arg-for-func-…
Browse files Browse the repository at this point in the history
…overload

Fix correctly display enums for function overload arguments
  • Loading branch information
sumneko authored Sep 9, 2024
2 parents d1320ae + 7784a06 commit a126e9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* `FIX` Fix `VM.OnCompileFunctionParam` function in plugins
* `FIX` Lua 5.1: fix incorrect warning when using setfenv with an int as first parameter
* `FIX` Improve type narrow by checking exact match on literal type params
* `FIX` Correctly list enums for function overload arguments [#2840](https://github.com/LuaLS/lua-language-server/pull/2840)
* `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)

## 3.10.5
Expand Down
4 changes: 3 additions & 1 deletion script/core/completion/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ local function findNearestSource(state, position)
---@type parser.object
local source
guide.eachSourceContain(state.ast, position, function (src)
source = src
if not source or source.start <= src.start then
source = src
end
end)
return source
end
Expand Down

0 comments on commit a126e9c

Please sign in to comment.