diff options
author | Paul Emmerich <emmerich@google.com> | 2024-09-01 12:32:33 +0200 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-09-05 18:28:37 +0800 |
commit | 5083f1cd9438da23f1022327ea24e7044bcc2f49 (patch) | |
tree | 735becc28cb3795fe2605f75ff8db8e1190151bc | |
parent | eb0bf985b4b22e529cfb75b88d7e8c6814acacea (diff) | |
download | lua-language-server-5083f1cd9438da23f1022327ea24e7044bcc2f49.zip |
Fix setfenv definition
The first parameter got parsed as `async fun(...):(...|integer)` which triggered an incorrect warning when using it as `setfenv(2, env)`
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | meta/template/basic.lua | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md index dd5dd5c4..18c85610 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ <!-- Add all new changes here. They will be moved under a version at release --> * `NEW` Custom documentation exporter * `NEW` Setting: `Lua.docScriptPath`: Path to a script that overrides `cli.doc.export`, allowing user-specified documentation exporting. +* `FIX` Lua 5.1: fix incorrect warning when using setfenv with an int as first parameter ## 3.10.5 `2024-8-19` diff --git a/meta/template/basic.lua b/meta/template/basic.lua index 75cd1dee..70303ca0 100644 --- a/meta/template/basic.lua +++ b/meta/template/basic.lua @@ -210,7 +210,7 @@ function select(index, ...) end ---@version 5.1 ---#DES 'setfenv' ----@param f async fun(...):...|integer +---@param f (async fun(...):...)|integer ---@param table table ---@return function function setfenv(f, table) end |