summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-06-24 21:44:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-06-24 21:44:24 +0800
commit3f300fc71445acd56b70ebc10255eab160b9c458 (patch)
tree19e2d6b8e9dd2a11490ecb0f7a6b1fb96f435688
parented32c90938dc1f44c8faa8a58fd3c4c4ad0c85e3 (diff)
downloadlua-language-server-3f300fc71445acd56b70ebc10255eab160b9c458.zip
fix #550
-rw-r--r--changelog.md3
-rw-r--r--script/core/completion.lua3
-rw-r--r--test/completion/init.lua11
3 files changed, 14 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md
index 119050e3..7b74d910 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 5e98aa15..2975634c 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 dde4b559..80a4aae5 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -2464,6 +2464,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
---@type AAA.$