From 76b3927c1c4574a64d3e56368753e429a912de75 Mon Sep 17 00:00:00 2001 From: NeOzay Date: Fri, 6 Sep 2024 17:32:36 +0200 Subject: fix autocompletion --- script/core/completion/completion.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 866d6590..43b5d5ce 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -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 -- cgit v1.2.3 From 0cbaf86b58942da5644377a4a6198ed8f8b5eee3 Mon Sep 17 00:00:00 2001 From: NeOzay Date: Fri, 6 Sep 2024 18:10:01 +0200 Subject: update changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 38d9aeb7..2f1f2e6c 100644 --- a/changelog.md +++ b/changelog.md @@ -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) ## 3.10.5 `2024-8-19` -- cgit v1.2.3