diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-30 21:21:56 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-30 21:21:56 +0800 |
commit | 15046d0a3e7bac87402f60e9a4861964c1aa2068 (patch) | |
tree | 37a5b8b40f13d585671937cd3d057d8d6f65a332 | |
parent | 9140dfc8fcf4f9dd4b28a8928fcf2ddcf977f9c7 (diff) | |
download | lua-language-server-15046d0a3e7bac87402f60e9a4861964c1aa2068.zip |
only show param name of literal
-rw-r--r-- | script/core/hint.lua | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/script/core/hint.lua b/script/core/hint.lua index 0504735a..d4ace5b7 100644 --- a/script/core/hint.lua +++ b/script/core/hint.lua @@ -103,12 +103,19 @@ local function paramName(uri, edits, start, finish) table.remove(args, 1) end for i, arg in ipairs(source.args) do - if args[i] and args[i] ~= '' then - edits[#edits+1] = { - newText = ('%s:'):format(args[i]), - start = arg.start, - finish = arg.start - 1, - } + if arg.type == 'nil' + or arg.type == 'number' + or arg.type == 'string' + or arg.type == 'boolean' + or arg.type == 'table' + or arg.type == 'function' then + if args[i] and args[i] ~= '' then + edits[#edits+1] = { + newText = ('%s:'):format(args[i]), + start = arg.start, + finish = arg.start - 1, + } + end end end end) |