From 1a627adcaf11c4a60f625fc21138f717308cc207 Mon Sep 17 00:00:00 2001 From: halflifefan Date: Mon, 1 Dec 2025 00:06:47 +0500 Subject: [PATCH 1/4] 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/4] 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/4] 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` From b6f5daaa104aa69701a984abb63fcf61a3a2b32e Mon Sep 17 00:00:00 2001 From: halflifefan Date: Tue, 16 Dec 2025 19:34:26 +0500 Subject: [PATCH 4/4] Renamed 'maxFieldsCount' to 'maxSuggestCount' --- changelog.md | 2 +- locale/en-us/setting.lua | 2 +- script/config/template.lua | 2 +- script/core/completion/completion.lua | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index c9b891c9e..e9e8992e6 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,7 @@ ## Unreleased -* `NEW` Added `completion.maxFieldCount` which lets you increase the amount of fields to analyze before requiring more specific input +* `NEW` Added `completion.maxSuggestCount` which lets you increase the amount of fields to analyze before requiring more specific input * `New` Omit parameter hints when the argument name matches * `FIX` Fix a typo in `no-unknown` diagnostic message * `FIX` Autodoc generation so it does not include documentation for builtin Lua language features diff --git a/locale/en-us/setting.lua b/locale/en-us/setting.lua index 1abdf5519..c831497ed 100644 --- a/locale/en-us/setting.lua +++ b/locale/en-us/setting.lua @@ -178,7 +178,7 @@ 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 = +config.completion.maxSuggestCount = "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." diff --git a/script/config/template.lua b/script/config/template.lua index b9e18155a..cf7df030c 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -347,7 +347,7 @@ local template = { 'Disable', }, ['Lua.completion.autoRequire'] = Type.Boolean >> true, - ['Lua.completion.maxFieldCount'] = Type.Integer >> 100, + ['Lua.completion.maxSuggestCount'] = 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 8071744de..8176c8840 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -565,9 +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') + local maxSuggestCount = config.get(state.uri, 'Lua.completion.maxSuggestCount') for _, src in ipairs(refs) do - if count > maxFieldCount then + if count > maxSuggestCount then results.incomplete = true break end