Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
* `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
Expand Down
2 changes: 2 additions & 0 deletions locale/en-us/setting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.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."
config.completion.requireSeparator =
Expand Down
1 change: 1 addition & 0 deletions script/config/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ local template = {
'Disable',
},
['Lua.completion.autoRequire'] = Type.Boolean >> true,
['Lua.completion.maxSuggestCount'] = Type.Integer >> 100,
['Lua.completion.showParams'] = Type.Boolean >> true,
['Lua.completion.requireSeparator'] = Type.String >> '.',
['Lua.completion.postfix'] = Type.String >> '@',
Expand Down
3 changes: 2 additions & 1 deletion script/core/completion/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,9 @@ local function checkFieldOfRefs(refs, state, word, startPos, position, parent, o
local fields = {}
local funcs = {}
local count = 0
local maxSuggestCount = config.get(state.uri, 'Lua.completion.maxSuggestCount')
for _, src in ipairs(refs) do
if count > 100 then
if count > maxSuggestCount then
results.incomplete = true
break
end
Expand Down
Loading