From 1a627adcaf11c4a60f625fc21138f717308cc207 Mon Sep 17 00:00:00 2001 From: halflifefan Date: Mon, 1 Dec 2025 00:06:47 +0500 Subject: [PATCH 1/3] Made the hardcoded completion field limit configurable --- script/config/template.lua | 1 + script/core/completion/completion.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/script/config/template.lua b/script/config/template.lua index fd723db52..b9e18155a 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -347,6 +347,7 @@ local template = { 'Disable', }, ['Lua.completion.autoRequire'] = Type.Boolean >> true, + ['Lua.completion.maxFieldCount'] = Type.Integer >> 100, ['Lua.completion.showParams'] = Type.Boolean >> true, ['Lua.completion.requireSeparator'] = Type.String >> '.', ['Lua.completion.postfix'] = Type.String >> '@', diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index f751e53d5..b3447007e 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -565,8 +565,9 @@ local function checkFieldOfRefs(refs, state, word, startPos, position, parent, o local fields = {} local funcs = {} local count = 0 + local maxFieldCount = config.get(state.uri, 'Lua.completion.maxFieldCount') for _, src in ipairs(refs) do - if count > 100 then + if count > maxFieldCount then results.incomplete = true break end From 77201d63b8c8ae76c5df34673b060d7da5b90228 Mon Sep 17 00:00:00 2001 From: halflifefan Date: Tue, 2 Dec 2025 21:02:37 +0500 Subject: [PATCH 2/3] description for 'completion.maxFieldCount' --- locale/en-us/setting.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locale/en-us/setting.lua b/locale/en-us/setting.lua index 0c136333a..1abdf5519 100644 --- a/locale/en-us/setting.lua +++ b/locale/en-us/setting.lua @@ -178,6 +178,8 @@ config.completion.showWord.Disable = "Do not display context words." config.completion.autoRequire = "When the input looks like a file name, automatically `require` this file." +config.completion.maxFieldCount = +"Maximum number of fields to analyze for completions. When an object has more fields than this limit, completions will require more specific input to appear." config.completion.showParams = "Display parameters in completion list. When the function has multiple definitions, they will be displayed separately." config.completion.requireSeparator = From 7eff34d534a2a5eebc2c7a5ae4560a40f356cc90 Mon Sep 17 00:00:00 2001 From: halflifefan Date: Tue, 2 Dec 2025 21:23:31 +0500 Subject: [PATCH 3/3] Changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index b6caa5050..b49689f5f 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## Unreleased +* `NEW` Added `completion.maxFieldCount` which lets you increase the amount of fields to analyze before requiring more specific input ## 3.16.0 `2025-12-2`