summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-15 14:47:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-15 14:47:18 +0800
commitdc2cb90f2b22b67b8cebc4996cec4f6c3e5c37dd (patch)
tree0a6c84c13aae06c5786da63e7104f34d1e6f02cc
parent4701342d87327310fa99b0926d02eaedaaecc590 (diff)
downloadlua-language-server-dc2cb90f2b22b67b8cebc4996cec4f6c3e5c37dd.zip
completion: displaying `@fenv` in `Lua 5.1`
-rw-r--r--changelog.md1
-rw-r--r--script/core/completion.lua3
2 files changed, 4 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md
index 2e3eb6a6..4dcf075f 100644
--- a/changelog.md
+++ b/changelog.md
@@ -7,6 +7,7 @@
* `FIX` `debug.getuservalue` and `debug.setuservalue` should not exist in `Lua 5.1`
* `FIX` infer of `---@type class[][]`
* `FIX` infer of `---@type {}[]`
+* `FIX` completion: displaying `@fenv` in `Lua 5.1`
* `FIX` [#596](https://github.com/sumneko/lua-language-server/issues/596)
* `FIX` [#597](https://github.com/sumneko/lua-language-server/issues/597)
diff --git a/script/core/completion.lua b/script/core/completion.lua
index 986f6696..7a60ab69 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -290,6 +290,9 @@ local function checkLocal(ast, word, offset, results)
if not matchKey(word, name) then
goto CONTINUE
end
+ if name:sub(1, 1) == '@' then
+ goto CONTINUE
+ end
if infer.hasType(source, 'function') then
for _, def in ipairs(vm.getDefs(source)) do
if def.type == 'function'