summaryrefslogtreecommitdiff
path: root/script/core/completion
diff options
context:
space:
mode:
authorDCsunset <DCsunset@protonmail.com>2024-06-28 18:08:53 -0400
committerDCsunset <DCsunset@protonmail.com>2024-06-28 18:23:47 -0400
commit1abd6b3d87739c05328e06e391bab0c056823b77 (patch)
tree5be818988ab47c9939e2b610b31a121650810fb3 /script/core/completion
parent3886d2ede3345296fbadc96c09d42cca96affa77 (diff)
downloadlua-language-server-1abd6b3d87739c05328e06e391bab0c056823b77.zip
fix: respect showParams config for local function completion
Diffstat (limited to 'script/core/completion')
-rw-r--r--script/core/completion/completion.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 3a76472a..866d6590 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -343,6 +343,7 @@ end
local function checkLocal(state, word, position, results)
local locals = guide.getVisibleLocals(state.ast, position)
+ local showParams = config.get(state.uri, 'Lua.completion.showParams')
for name, source in util.sortPairs(locals) do
if isSameSource(state, source, position) then
goto CONTINUE
@@ -372,7 +373,12 @@ local function checkLocal(state, word, position, results)
for _, def in ipairs(defs) do
if (def.type == 'function' and not vm.isVarargFunctionWithOverloads(def))
or def.type == 'doc.type.function' then
- local funcLabel = name .. getParams(def, false)
+ local funcLabel
+ if showParams then
+ funcLabel = name .. getParams(def, false)
+ else
+ funcLabel = name
+ end
buildFunction(results, source, def, false, {
label = funcLabel,
match = name,