Skip to content

Commit 1abd6b3

Browse files
committed
fix: respect showParams config for local function completion
1 parent 3886d2e commit 1abd6b3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

script/core/completion/completion.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ end
343343

344344
local function checkLocal(state, word, position, results)
345345
local locals = guide.getVisibleLocals(state.ast, position)
346+
local showParams = config.get(state.uri, 'Lua.completion.showParams')
346347
for name, source in util.sortPairs(locals) do
347348
if isSameSource(state, source, position) then
348349
goto CONTINUE
@@ -372,7 +373,12 @@ local function checkLocal(state, word, position, results)
372373
for _, def in ipairs(defs) do
373374
if (def.type == 'function' and not vm.isVarargFunctionWithOverloads(def))
374375
or def.type == 'doc.type.function' then
375-
local funcLabel = name .. getParams(def, false)
376+
local funcLabel
377+
if showParams then
378+
funcLabel = name .. getParams(def, false)
379+
else
380+
funcLabel = name
381+
end
376382
buildFunction(results, source, def, false, {
377383
label = funcLabel,
378384
match = name,

0 commit comments

Comments
 (0)