diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-02-22 14:44:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-02-22 14:44:13 +0800 |
commit | 73457819ac49560aaed802e455a743d136c76e6d (patch) | |
tree | 0478dd175948a6d69a0a20188bca0e1eabf0a8c6 /script | |
parent | 2e57e65b6fa218d9de47473628940f8d2db43f79 (diff) | |
download | lua-language-server-73457819ac49560aaed802e455a743d136c76e6d.zip |
fix interface in nested table
Diffstat (limited to 'script')
-rw-r--r-- | script/core/completion.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua index 17ccb817..4d8c77b2 100644 --- a/script/core/completion.lua +++ b/script/core/completion.lua @@ -1370,6 +1370,9 @@ local function checkTableLiteralField(ast, text, offset, call, funcs, index, res if source.type ~= 'table' then tbl = source.parent end + if tbl.parent ~= call.args then + return + end for _, field in ipairs(vm.getDefFields(tbl, 0)) do local name = guide.getKeyName(field) if name then @@ -1403,7 +1406,7 @@ local function checkTableLiteralField(ast, text, offset, call, funcs, index, res results[#results+1] = { label = guide.getKeyName(field), kind = define.CompletionItemKind.Property, - insertText = ('%s = $0,'):format(guide.getKeyName(field)), + insertText = ('%s = $0'):format(guide.getKeyName(field)), id = stack(function () return { detail = buildDetail(field), |