From 3f300fc71445acd56b70ebc10255eab160b9c458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 24 Jun 2021 21:44:24 +0800 Subject: [PATCH] fix #550 --- changelog.md | 3 +++ script/core/completion.lua | 3 --- test/completion/init.lua | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 119050e36..7b74d910a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 2.0.4 +* `FIX` [#550](https://github.com/sumneko/lua-language-server/issues/550) + ## 2.0.3 `2021-6-24` * `CHG` improve memory usage diff --git a/script/core/completion.lua b/script/core/completion.lua index 5e98aa15c..2975634c9 100644 --- a/script/core/completion.lua +++ b/script/core/completion.lua @@ -1389,9 +1389,6 @@ local function checkTableLiteralFieldByCall(ast, text, offset, call, defs, index and (not source.parent or source.parent.type ~= 'table') then return end - if call.node and call.node.type == 'getmethod' then - index = index + 1 - end local mark = {} local fields = {} local tbl = source diff --git a/test/completion/init.lua b/test/completion/init.lua index dde4b5597..80a4aae52 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -2463,6 +2463,17 @@ api({$}) ]] (EXISTS) +TEST [[ +---@class A +---@field a '"hello"'|'"world"' + +---@param t A +function m:api(t) end + +m:api({$}) +]] +(EXISTS) + TEST [[ ---@class AAA.BBB