diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-07-01 15:06:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 15:06:15 +0800 |
commit | a7dc2dc9eebfdfa4a8c224db801fd60794843135 (patch) | |
tree | a425dde30a599f9fd561a3737d27335238c9b2d2 /script | |
parent | ebbc372f6754f458e7ac9b08655ce79737868aea (diff) | |
parent | 4c03394901e88e9c09a40667e561093a155fa169 (diff) | |
download | lua-language-server-a7dc2dc9eebfdfa4a8c224db801fd60794843135.zip |
Merge pull request #2735 from DCsunset/fix-params
fix: respect showParams config for local function completion
Diffstat (limited to 'script')
-rw-r--r-- | script/core/completion/completion.lua | 8 |
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, |