diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-08-18 14:49:41 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-08-18 14:49:41 +0800 |
commit | f0b9fdb56762a95bdb568e2fcc15ce96bb97ca7c (patch) | |
tree | f5e868739e19ab99afe59fb77f7f1ca815c2415d /script/core | |
parent | e3b50c1af79dac4892cc0a4725c39da187142cc6 (diff) | |
download | lua-language-server-f0b9fdb56762a95bdb568e2fcc15ce96bb97ca7c.zip |
`Lua.hint.paramName` supports all params
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/hint.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/script/core/hint.lua b/script/core/hint.lua index fe86c2a3..41f59d02 100644 --- a/script/core/hint.lua +++ b/script/core/hint.lua @@ -98,7 +98,8 @@ local function hasLiteralArgInCall(call) end local function paramName(uri, edits, start, finish) - if not config.get 'Lua.hint.paramName' then + local paramConfig = config.get 'Lua.hint.paramName' + if not paramConfig or paramConfig == 'None' then return end local ast = files.getState(uri) @@ -110,7 +111,7 @@ local function paramName(uri, edits, start, finish) if source.type ~= 'call' then return end - if not hasLiteralArgInCall(source) then + if paramConfig == 'Literal' and not hasLiteralArgInCall(source) then return end await.delay() @@ -137,7 +138,8 @@ local function paramName(uri, edits, start, finish) table.remove(args, 1) end for i, arg in ipairs(source.args) do - if not mark[arg] and guide.isLiteral(arg) then + if not mark[arg] + and (paramConfig ~= 'Literal' or guide.isLiteral(arg)) then mark[arg] = true if args[i] and args[i] ~= '' then edits[#edits+1] = { |