summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCppCXY <812125110@qq.com>2022-05-31 20:07:46 +0800
committerCppCXY <812125110@qq.com>2022-05-31 20:07:46 +0800
commitb406413b059843ced4f3dcf4c0c9d041eb78ef05 (patch)
treeb6c9b5a40a025b4fe0011eec9965de9557441aa0
parent5eef995bdc9e9450f1803fb0f54cdea1025d6e10 (diff)
parent496b61d601003619aeb6243300b9b3b0f5be944a (diff)
downloadlua-language-server-b406413b059843ced4f3dcf4c0c9d041eb78ef05.zip
Merge branch 'master' of https://github.com/sumneko/lua-language-server into HEAD
-rw-r--r--.vscode/launch.json4
m---------3rd/bee.lua0
m---------3rd/lovr-api0
-rw-r--r--changelog.md16
-rw-r--r--locale/en-us/script.lua4
-rw-r--r--locale/en-us/setting.lua4
-rw-r--r--locale/pt-br/script.lua4
-rw-r--r--locale/pt-br/setting.lua4
-rw-r--r--locale/zh-cn/script.lua4
-rw-r--r--locale/zh-cn/setting.lua4
-rw-r--r--locale/zh-tw/meta.lua236
-rw-r--r--locale/zh-tw/script.lua110
-rw-r--r--locale/zh-tw/setting.lua54
-rw-r--r--meta/3rd/love2d/library/love.audio.lua58
-rw-r--r--meta/3rd/love2d/library/love.data.lua39
-rw-r--r--meta/3rd/love2d/library/love.event.lua79
-rw-r--r--meta/3rd/love2d/library/love.filesystem.lua40
-rw-r--r--meta/3rd/love2d/library/love.font.lua27
-rw-r--r--meta/3rd/love2d/library/love.graphics.lua320
-rw-r--r--meta/3rd/love2d/library/love.image.lua210
-rw-r--r--meta/3rd/love2d/library/love.joystick.lua70
-rw-r--r--meta/3rd/love2d/library/love.keyboard.lua679
-rw-r--r--meta/3rd/love2d/library/love.math.lua11
-rw-r--r--meta/3rd/love2d/library/love.mouse.lua33
-rw-r--r--meta/3rd/love2d/library/love.physics.lua59
-rw-r--r--meta/3rd/love2d/library/love.sound.lua4
-rw-r--r--meta/3rd/love2d/library/love.system.lua10
-rw-r--r--meta/3rd/love2d/library/love.thread.lua3
-rw-r--r--meta/3rd/love2d/library/love.window.lua26
-rw-r--r--meta/3rd/lovr/library/lovr.audio.lua58
-rw-r--r--meta/3rd/lovr/library/lovr.data.lua35
-rw-r--r--meta/3rd/lovr/library/lovr.event.lua173
-rw-r--r--meta/3rd/lovr/library/lovr.graphics.lua335
-rw-r--r--meta/3rd/lovr/library/lovr.headset.lua94
-rw-r--r--meta/3rd/lovr/library/lovr.math.lua35
-rw-r--r--meta/3rd/lovr/library/lovr.physics.lua18
-rw-r--r--meta/3rd/lovr/library/lovr.system.lua2
-rw-r--r--script/config/config.lua12
-rw-r--r--script/core/code-action.lua4
-rw-r--r--script/core/folding.lua12
-rw-r--r--script/glob/gitignore.lua6
-rw-r--r--script/lclient.lua1
-rw-r--r--script/library.lua3
-rw-r--r--script/proto/define.lua1
-rw-r--r--script/provider/diagnostic.lua146
-rw-r--r--script/provider/formatting.lua3
-rw-r--r--script/provider/provider.lua102
-rw-r--r--script/vm/compiler.lua2
-rw-r--r--script/vm/generic.lua3
-rw-r--r--script/vm/ref.lua20
-rw-r--r--script/workspace/workspace.lua19
-rw-r--r--test/references/common.lua10
-rw-r--r--test/type_inference/init.lua26
-rw-r--r--tools/love-api.lua32
-rw-r--r--tools/lovr-api.lua32
55 files changed, 1866 insertions, 1430 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 777fef18..7c4a7b19 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -13,7 +13,6 @@
"arg": [
],
"luaVersion": "5.4",
- "consoleCoding": "utf8",
"sourceCoding": "utf8",
"console": "internalConsole",
"outputCapture": [
@@ -47,7 +46,6 @@
"arg": [
],
"luaVersion": "latest",
- "consoleCoding": "utf8",
"sourceCoding": "utf8",
"outputCapture": [
"print",
@@ -67,7 +65,6 @@
"${workspaceRoot}",
],
"luaVersion": "5.4",
- "consoleCoding": "utf8",
"sourceCoding": "utf8",
"outputCapture": [
"print",
@@ -85,7 +82,6 @@
"arg": [
],
"luaVersion": "latest",
- "consoleCoding": "utf8",
"sourceCoding": "utf8",
"outputCapture": [
"print",
diff --git a/3rd/bee.lua b/3rd/bee.lua
-Subproject f26e3cf9b7ed13d2cde202205c2a6a61a63a55d
+Subproject a399203e6de55768749a470e245070fee888bfd
diff --git a/3rd/lovr-api b/3rd/lovr-api
-Subproject 910ede83e8834fcc2ee38f03d7eab6b7733a29c
+Subproject e5fb83281cba97f44fbdc45e8dec021236193a1
diff --git a/changelog.md b/changelog.md
index 54b0a129..0071cc00 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,9 +1,25 @@
# changelog
+## 3.2.5
+* `FIX` [#1149](https://github.com/sumneko/lua-language-server/issues/1149)
+
## 3.2.4
+`2022-5-25`
+* `NEW` settings:
+ + `workspace.supportScheme`: `["file", "untitled", "git"]`
+ + `diagnostics.disableScheme`: `["git"]`
+* `NEW` folding: support folding `---@alias`
+* `CHG` if `rootUri` or `workspaceFolder` is set to `ROOT` or `HOME`, this extension will refuse to load these directories and show an error message.
+* `CHG` show warning message when scanning more than 100,000 files.
+* `CHG` upgrade [LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) to `3.17`
* `FIX` hover: can not union `table` with other basic types
* `FIX` [#1125](https://github.com/sumneko/lua-language-server/issues/1125)
* `FIX` [#1131](https://github.com/sumneko/lua-language-server/issues/1131)
+* `FIX` [#1134](https://github.com/sumneko/lua-language-server/issues/1134)
+* `FIX` [#1141](https://github.com/sumneko/lua-language-server/issues/1141)
+* `FIX` [#1144](https://github.com/sumneko/lua-language-server/issues/1144)
+* `FIX` [#1150](https://github.com/sumneko/lua-language-server/issues/1150)
+* `FIX` [#1155](https://github.com/sumneko/lua-language-server/issues/1155)
## 3.2.3
`2022-5-16`
diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua
index 2d972f18..6f01c520 100644
--- a/locale/en-us/script.lua
+++ b/locale/en-us/script.lua
@@ -142,6 +142,10 @@ WORKSPACE_DIAGNOSTIC =
'Diagnosing workspace'
WORKSPACE_SKIP_HUGE_FILE =
'For performance reasons, the parsing of this file has been stopped: {}'
+WORKSPACE_NOT_ALLOWED =
+'Your workspace is set to `{}`. Lua language server refused to load this directory. Please check your configuration.[learn more here](https://github.com/sumneko/lua-language-server/wiki/Why-scanning-home-folder)'
+WORKSPACE_SCAN_TOO_MUCH =
+'More than {} files have been scanned. The current scanned directory is `{}`. Please confirm whether the configuration is correct.'
PARSER_CRASH =
'Parser crashed! Last words:{}'
diff --git a/locale/en-us/setting.lua b/locale/en-us/setting.lua
index 4f9bf18a..adb5579f 100644
--- a/locale/en-us/setting.lua
+++ b/locale/en-us/setting.lua
@@ -64,6 +64,8 @@ config.diagnostics.files.Opened =
"Only when these files are opened will it be diagnosed."
config.diagnostics.files.Disable =
"These files are not diagnosed."
+config.diagnostics.disableScheme =
+'Do not diagnose Lua files that use the following scheme.'
config.workspace.ignoreDir =
"Ignored files and directories (Use `.gitignore` grammar)."-- .. example.ignoreDir,
config.workspace.ignoreSubmodules =
@@ -89,6 +91,8 @@ Automatic detection and adaptation of third-party libraries, currently supported
]]
config.workspace.userThirdParty =
'Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)'
+config.workspace.supportScheme =
+'Provide language server for the Lua files of the following scheme.'
config.completion.enable =
'Enable completion.'
config.completion.callSnippet =
diff --git a/locale/pt-br/script.lua b/locale/pt-br/script.lua
index 21d8ea55..a5342e1f 100644
--- a/locale/pt-br/script.lua
+++ b/locale/pt-br/script.lua
@@ -142,6 +142,10 @@ WORKSPACE_DIAGNOSTIC =
'Diagnóstico de espaço de trabalho.'
WORKSPACE_SKIP_HUGE_FILE =
'Por motivos de desempenho, a análise deste arquivo foi interrompida: {}'
+WORKSPACE_NOT_ALLOWED = -- TODO: need translate!
+'Your workspace is set to `{}`. Lua language server refused to load this directory. Please check your configuration.[learn more here](https://github.com/sumneko/lua-language-server/wiki/Why-scanning-home-folder)'
+WORKSPACE_SCAN_TOO_MUCH = -- TODO: need translate!
+'More than {} files have been scanned. The current scanned directory is `{}`. Please confirm whether the configuration is correct.'
PARSER_CRASH =
'Parser quebrou! Últimas palavras: {}'
diff --git a/locale/pt-br/setting.lua b/locale/pt-br/setting.lua
index 501236f0..443539be 100644
--- a/locale/pt-br/setting.lua
+++ b/locale/pt-br/setting.lua
@@ -64,6 +64,8 @@ config.diagnostics.files.Opened = -- TODO: need translate!
"Only when these files are opened will it be diagnosed."
config.diagnostics.files.Disable = -- TODO: need translate!
"These files are not diagnosed."
+config.diagnostics.disableScheme = -- TODO: need translate!
+'Do not diagnose Lua files that use the following scheme.'
config.workspace.ignoreDir = -- TODO: need translate!
"Ignored files and directories (Use `.gitignore` grammar)."-- .. example.ignoreDir,
config.workspace.ignoreSubmodules = -- TODO: need translate!
@@ -89,6 +91,8 @@ Automatic detection and adaptation of third-party libraries, currently supported
]]
config.workspace.userThirdParty = -- TODO: need translate!
'Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)'
+config.workspace.supportScheme = -- TODO: need translate!
+'Provide language server for the Lua files of the following scheme.'
config.completion.enable = -- TODO: need translate!
'Enable completion.'
config.completion.callSnippet = -- TODO: need translate!
diff --git a/locale/zh-cn/script.lua b/locale/zh-cn/script.lua
index 10a703c7..24bd02bd 100644
--- a/locale/zh-cn/script.lua
+++ b/locale/zh-cn/script.lua
@@ -142,6 +142,10 @@ WORKSPACE_DIAGNOSTIC =
'正在对工作目录进行诊断'
WORKSPACE_SKIP_HUGE_FILE =
'出于性能考虑,已停止对此文件解析:{}'
+WORKSPACE_NOT_ALLOWED =
+'你的工作目录被设置为了 `{}`,Lua语言服务拒绝加载此目录,请检查你的配置。[了解更多](https://github.com/sumneko/lua-language-server/wiki/Why-scanning-home-folder)'
+WORKSPACE_SCAN_TOO_MUCH =
+'已扫描了超过 {} 个文件,当前扫描的目录为 `{}`,请确认配置是否正确。'
PARSER_CRASH =
'语法解析崩溃了!遗言:{}'
diff --git a/locale/zh-cn/setting.lua b/locale/zh-cn/setting.lua
index 7592414a..4c4f8e4b 100644
--- a/locale/zh-cn/setting.lua
+++ b/locale/zh-cn/setting.lua
@@ -64,6 +64,8 @@ config.diagnostics.files.Opened =
"只有打开这些文件时才会诊断。"
config.diagnostics.files.Disable =
"不诊断这些文件。"
+config.diagnostics.disableScheme =
+'不诊断使用以下 scheme 的lua文件。'
config.workspace.ignoreDir =
"忽略的文件与目录(使用 `.gitignore` 语法)。"
config.workspace.ignoreSubmodules =
@@ -89,6 +91,8 @@ config.workspace.checkThirdParty =
]]
config.workspace.userThirdParty =
'在这里添加私有的第三方库适配文件路径,请参考内置的[配置文件路径](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)'
+config.workspace.supportScheme =
+'为以下 scheme 的lua文件提供语言服务。'
config.completion.enable =
'启用自动完成。'
config.completion.callSnippet =
diff --git a/locale/zh-tw/meta.lua b/locale/zh-tw/meta.lua
index f7816129..12e0e7e6 100644
--- a/locale/zh-tw/meta.lua
+++ b/locale/zh-tw/meta.lua
@@ -1,10 +1,10 @@
---@diagnostic disable: undefined-global, lowercase-global
arg =
-'獨立版Lua的啟動參數。'
+'獨立版Lua的啟動引數。'
assert =
-'如果其參數 `v` 的值為假(`nil` 或 `false`), 它就呼叫 $error; 否則,回傳所有的參數。 在錯誤情況時, `message` 指那個錯誤對象; 如果不提供這個參數,參數預設為 `"assertion failed!"` 。'
+'如果其引數 `v` 的值為假( `nil` 或 `false` ),它就呼叫 $error ;否則,回傳所有的引數。在錯誤情況時, `message` 指那個錯誤對象;如果不提供這個引數,預設為 `"assertion failed!"` 。'
cgopt.collect =
'做一次完整的垃圾回收循環。'
@@ -28,34 +28,34 @@ cgopt.isrunning =
'回傳表示回收器是否在工作的布林值。'
collectgarbage =
-'這個函式是垃圾回收器的通用介面。 透過參數 opt 它提供了一組不同的功能。'
+'這個函式是垃圾回收器的一般介面。透過引數 opt 它提供了一組不同的功能。'
dofile =
-'打開該名字的檔案,並執行檔案中的 Lua 程式碼區塊。 不帶參數呼叫時, `dofile` 執行標準輸入的內容(`stdin`)。 回傳該程式碼區塊的所有回傳值。 對於有錯誤的情況,`dofile` 將錯誤反饋給呼叫者 (即,`dofile` 沒有執行在保護模式下)。'
+'打開該名字的檔案,並執行檔案中的 Lua 程式碼區塊。不帶引數呼叫時, `dofile` 執行標準輸入的內容(`stdin` )。回傳該程式碼區塊的所有回傳值。對於有錯誤的情況, `dofile` 將錯誤回饋給呼叫者(即 `dofile` 沒有執行在保護模式下)。'
error =
[[
-中止上一次保護函式呼叫, 將錯誤對象 `message` 回傳。 函式 `error` 永遠不會回傳。
+中止上一次保護函式呼叫,將錯誤對象 `message` 回傳。函式 `error` 永遠不會回傳。
-當 `message` 是一個字串時,通常 `error` 會把一些有關出錯位置的資訊附加在資訊的前頭。 level 參數指明了怎樣獲得出錯位置。
+當 `message` 是一個字串時,通常 `error` 會把一些有關出錯位置的資訊附加在訊息的前頭。 `level` 引數指明了怎樣獲得出錯位置。
]]
_G =
-'一個全域變數(非函式), 內部儲存有全域環境(參見 §2.2)。 Lua 自己不使用這個變數; 改變這個變數的值不會對任何環境造成影響,反之亦然。'
+'一個全域變數(非函式),內部儲存有全域環境(參見 §2.2)。 Lua 自己不使用這個變數;改變這個變數的值不會對任何環境造成影響,反之亦然。'
getfenv =
-'回傳給定函式的環境。`f` 可以是一個Lua函式,也可是一個表示呼叫堆疊層級的數字。'
+'回傳給定函式的環境。 `f` 可以是一個Lua函式,也可是一個表示呼叫堆疊層級的數字。'
getmetatable =
-'如果 `object` 不包含元表,回傳 `nil` 。 否則,如果在該對象的元表中有 `"__metatable"` 域時回傳其關聯值, 沒有時回傳該對象的元表。'
+'如果 `object` 不包含元表,回傳 `nil` 。否則,如果在該物件的元表中有 `"__metatable"` 域時回傳其關聯值,沒有時回傳該對象的元表。'
ipairs =
[[
-回傳三個值(疊代函式、表 `t` 以及 `0` ), 如此,以下程式碼
+回傳三個值(疊代函式、表 `t` 以及 `0` ),如此,以下程式碼
```lua
for i,v in ipairs(t) do body end
```
-將疊代鍵值對 `(1,t[1]) ,(2,t[2]), ...` ,直到第一個空值。
+將疊代鍵值對 `(1,t[1])、(2,t[2])...` ,直到第一個空值。
]]
loadmode.b =
@@ -66,12 +66,12 @@ loadmode.bt =
'可以是二進制也可以是文字。'
load['<5.1'] =
-'使用 `func` 分段載入程式碼區塊。 每次呼叫 `func` 必須回傳一個字串用於連接前文。'
+'使用 `func` 分段載入程式碼區塊。每次呼叫 `func` 必須回傳一個字串用於連接前文。'
load['>5.2'] =
[[
載入一個程式碼區塊。
-如果 `chunk` 是一個字串,程式碼區塊指這個字串。 如果 `chunk` 是一個函式, `load` 不斷地呼叫它獲取程式碼區塊的片段。 每次對 `chunk` 的呼叫都必須回傳一個字串緊緊連接在上次呼叫的回傳串之後。 當回傳空串、`nil`、或是不回傳值時,都表示程式碼區塊結束。
+如果 `chunk` 是一個字串,程式碼區塊指這個字串。如果 `chunk` 是一個函式, `load` 不斷地呼叫它獲取程式碼區塊的片段。每次對 `chunk` 的呼叫都必須回傳一個字串緊緊連接在上次呼叫的回傳串之後。當回傳空串、 `nil` 、或是不回傳值時,都表示程式碼區塊結束。
]]
loadfile =
@@ -81,22 +81,22 @@ loadstring =
'使用給定字串載入程式碼區塊。'
module =
-'新增一個模組。'
+'建立一個模組。'
next =
[[
-執行程式來走訪表中的所有域。 第一個參數是要走訪的表,第二個參數是表中的某個鍵。 `next` 回傳該鍵的下一個鍵及其關聯的值。 如果用 `nil` 作為第二個參數呼叫 `next` 將回傳初始鍵及其關聯值。 當以最後一個鍵去呼叫,或是以 `nil` 呼叫一張空表時, `next` 回傳 `nil`。 如果不提供第二個參數,將預設它就是 `nil`。 特別指出,你可以用 `next(t)` 來判斷一張表是否是空的。
+執行程式來走訪表中的所有域。第一個引數是要走訪的表,第二個引數是表中的某個鍵。 `next` 回傳該鍵的下一個鍵及其關聯的值。如果用 `nil` 作為第二個引數呼叫 `next` 將回傳初始鍵及其關聯值。當以最後一個鍵去呼叫,或是以 `nil` 呼叫一張空表時, `next` 回傳 `nil`。如果不提供第二個引數,將預設它就是 `nil`。特別指出,你可以用 `next(t)` 來判斷一張表是否是空的。
-索引在走訪過程中的順序無定義, 即使是數字索引也是這樣。 (如果想按數字順序走訪表,可以使用數字形式的 `for` 。)
+索引在走訪過程中的順序無定義,即使是數字索引也是這樣。(如果想按數字順序走訪表,可以使用數字形式的 `for` 。)
-當在走訪過程中你給表中並不存在的域賦值, `next` 的行為是未定義的。 然而你可以去修改那些已存在的域。 特別指出,你可以清除一些已存在的域。
+當在走訪過程中你給表中並不存在的域賦值, `next` 的行為是未定義的。然而你可以去修改那些已存在的域。特別指出,你可以清除一些已存在的域。
]]
pairs =
[[
-如果 `t` 有元方法 `__pairs`, 以 `t` 為參數呼叫它,並回傳其回傳的前三個值。
+如果 `t` 有元方法 `__pairs` ,以 `t` 為引數呼叫它,並回傳其回傳的前三個值。
-否則,回傳三個值:`next` 函式, 表 `t`,以及 `nil`。 因此以下程式碼
+否則,回傳三個值: `next` 函式,表 `t` ,以及 `nil` 。因此以下程式碼
```lua
for k,v in pairs(t) do body end
```
@@ -106,69 +106,69 @@ pairs =
]]
pcall =
-'傳入參數,以 *保護模式* 呼叫函式 `f` 。 這意味著 `f` 中的任何錯誤不會拋出; 取而代之的是,`pcall` 會將錯誤捕獲到,並回傳一個狀態碼。 第一個回傳值是狀態碼(一個布林值), 當沒有錯誤時,其為真。 此時,`pcall` 同樣會在狀態碼後回傳所有呼叫的結果。 在有錯誤時,`pcall` 回傳 `false` 加錯誤訊息。'
+'透過將函式 `f` 傳入引數,以 *保護模式* 呼叫 `f` 。這意味著 `f` 中的任何錯誤不會擲回;取而代之的是, `pcall` 會將錯誤捕獲到,並回傳一個狀態碼。第一個回傳值是狀態碼(一個布林值),當沒有錯誤時,其為 `true` 。此時, `pcall` 同樣會在狀態碼後回傳所有呼叫的結果。在有錯誤時,`pcall` 回傳 `false` 加錯誤訊息。'
print =
-'接收任意數量的參數,並將它們的值列印到 `stdout`。 它用 `tostring` 函式將每個參數都轉換為字串。 `print` 不用於做格式化輸出。僅作為看一下某個值的快捷方式。 多用於除錯。 完整的對輸出的控制,請使用 $string.format 以及 $io.write。'
+'接收任意數量的引數,並將它們的值列印到 `stdout`。它用 `tostring` 函式將每個引數都轉換為字串。 `print` 不用於做格式化輸出。僅作為看一下某個值的快捷方式,多用於除錯。完整的對輸出的控制,請使用 $string.format 以及 $io.write。'
rawequal =
-'在不觸發任何元方法的情況下 檢查 `v1` 是否和 `v2` 相等。 回傳一個布林值。'
+'在不觸發任何元方法的情況下,檢查 `v1` 是否和 `v2` 相等。回傳一個布林值。'
rawget =
-'在不觸發任何元方法的情況下 獲取 `table[index]` 的值。 `table` 必須是一張表; `index` 可以是任何值。'
+'在不觸發任何元方法的情況下,獲取 `table[index]` 的值。 `table` 必須是一張表; `index` 可以是任何值。'
rawlen =
-'在不觸發任何元方法的情況下 回傳對象 `v` 的長度。 `v` 可以是表或字串。 它回傳一個整數。'
+'在不觸發任何元方法的情況下,回傳物件 `v` 的長度。 `v` 可以是表或字串。它回傳一個整數。'
rawset =
[[
-在不觸發任何元方法的情況下 將 `table[index]` 設為 `value。` `table` 必須是一張表, `index` 可以是 `nil` 與 `NaN` 之外的任何值。 `value` 可以是任何 Lua 值。
+在不觸發任何元方法的情況下,將 `table[index]` 設為 `value`。 `table` 必須是一張表, `index` 可以是 `nil` 與 `NaN` 之外的任何值。 `value` 可以是任何 Lua 值。
這個函式回傳 `table`。
]]
select =
-'如果 `index` 是個數字, 那麼回傳參數中第 `index` 個之後的部分; 負的數字會從後向前索引(`-1` 指最後一個參數)。 否則,`index` 必須是字串 `"#"`, 此時 `select` 回傳參數的個數。'
+'如果 `index` 是個數字,那麼回傳引數中第 `index` 個之後的部分;負的數字會從後向前索引(`-1` 指最後一個引數)。否則, `index` 必須是字串 `"#"` ,此時 `select` 回傳引數的個數。'
setfenv =
'設定給定函式的環境。'
setmetatable =
[[
-給指定表設定元表。 (你不能在 Lua 中改變其它類型值的元表,那些只能在 C 裡做。) 如果 `metatable` 是 `nil`, 將指定表的元表移除。 如果原來那張元表有 `"__metatable"` 域,拋出一個錯誤。
+給指定表設定元表。(你不能在 Lua 中改變其它型別值的元表,那些只能在 C 裡做。)如果 `metatable` 是 `nil`,將指定表的元表移除。如果原來那張元表有 `"__metatable"` 域,擲回一個錯誤。
]]
tonumber =
[[
-如果呼叫的時候沒有 `base`, `tonumber` 嘗試把參數轉換為一個數字。 如果參數已經是一個數字,或是一個可以轉換為數字的字串, `tonumber` 就回傳這個數字; 否則回傳 `nil`。
+如果呼叫的時候沒有 `base` , `tonumber` 嘗試把引數轉換為一個數字。如果引數已經是一個數字,或是一個可以轉換為數字的字串, `tonumber` 就回傳這個數字,否則回傳 `nil`。
-字串的轉換結果可能是整數也可能是浮點數, 這取決於 Lua 的轉換文法(參見 §3.1)。 (字串可以有前置和後置的空格,可以帶符號。)
+字串的轉換結果可能是整數也可能是浮點數,這取決於 Lua 的轉換文法(參見 §3.1)。(字串可以有前置和後置的空格,可以帶符號。)
]]
tostring =
[[
-可以接收任何類型,它將其轉換為人可閲讀的字串形式。 浮點數總被轉換為浮點數的表現形式(小數點形式或是指數形式)。 (如果想完全控制數字如何被轉換,可以使用 $string.format。)
-如果 `v` 有 `"__tostring"` 域的元表, `tostring` 會以 `v` 為參數呼叫它。 並用它的結果作為回傳值。
+可以接收任何型別,它將其轉換為人可閲讀的字串形式。浮點數總被轉換為浮點數的表現形式(小數點形式或是指數形式)。(如果想完全控制數字如何被轉換,可以使用 $string.format 。)
+如果 `v` 有 `"__tostring"` 域的元表, `tostring` 會以 `v` 為引數呼叫它。並用它的結果作為回傳值。
]]
type =
[[
-將參數的類型編碼為一個字串回傳。 函式可能的回傳值有 `"nil"` (一個字串,而不是 `nil` 值), `"number"`, `"string"`, `"boolean"`, `"table"`, `"function"`, `"thread"`, `"userdata"`。
+將引數的型別編碼為一個字串回傳。 函式可能的回傳值有 `"nil"` (一個字串,而不是 `nil` 值)、 `"number"` 、 `"string"` 、 `"boolean"` 、 `"table"` 、 `"function"` 、 `"thread"` 和 `"userdata"`。
]]
_VERSION =
'一個包含有目前直譯器版本號的全域變數(並非函式)。'
warn =
-'使用所有參數組成的字串訊息來發送警告。'
+'使用所有引數組成的字串訊息來發送警告。'
xpcall['=5.1'] =
-'傳入參數,以 *保護模式* 呼叫函式 `f` 。這個函式和 `pcall` 類似。 不過它可以額外設定一個訊息處理器 `err`。'
+'透過將函式 `f` 傳入引數,以 *保護模式* 呼叫 `f` 。這個函式和 `pcall` 類似。不過它可以額外設定一個訊息處理器 `err`。'
xpcall['>5.2'] =
-'傳入參數,以 *保護模式* 呼叫函式 `f` 。這個函式和 `pcall` 類似。 不過它可以額外設定一個訊息處理器 `msgh`。'
+'透過將函式 `f` 傳入引數,以 *保護模式* 呼叫 `f` 。這個函式和 `pcall` 類似。不過它可以額外設定一個訊息處理器 `msgh`。'
unpack =
[[
-回傳給定 `list` 中的所有元素。 該函式等價於
+回傳給定 `list` 中的所有元素。該函式等價於
```lua
return list[i], list[i+1], ···, list[j]
```
@@ -227,21 +227,21 @@ assert(bit32.lshift(b, disp) ==
coroutine =
''
coroutine.create =
-'新增一個主體函式為 `f` 的新共常式。 f 必須是一個 Lua 的函式。 回傳這個新共常式,它是一個類型為 `"thread"` 的對象。'
+'建立一個主體函式為 `f` 的新共常式。 f 必須是一個 Lua 的函式。回傳這個新共常式,它是一個型別為 `"thread"` 的物件。'
coroutine.isyieldable =
'如果正在執行的共常式可以讓出,則回傳真。'
coroutine.isyieldable['>5.4'] =
-'如果共常式 `co` 可以讓出,則回傳真。`co` 預設為正在執行的共常式。'
+'如果共常式 `co` 可以讓出,則回傳真。 `co` 預設為正在執行的共常式。'
coroutine.close =
-'關閉共常式 `co`,並關閉它所有等待 *to-be-closed* 的變數,並將共常式狀態設為 `dead` 。'
+'關閉共常式 `co` ,並關閉它所有等待 *to-be-closed* 的變數,並將共常式狀態設為 `dead` 。'
coroutine.resume =
'開始或繼續共常式 `co` 的執行。'
coroutine.running =
-'回傳目前正在執行的共常式加一個布林值。 如果目前執行的共常式是主執行緒,其為真。'
+'回傳目前正在執行的共常式加一個布林值。如果目前執行的共常式是主執行緒,其為真。'
coroutine.status =
'以字串形式回傳共常式 `co` 的狀態。'
coroutine.wrap =
-'新增一個主體函式為 `f` 的新共常式。 f 必須是一個 Lua 的函式。 回傳一個函式, 每次呼叫該函式都會延續該共常式。'
+'建立一個主體函式為 `f` 的新共常式。 f 必須是一個 Lua 的函式。回傳一個函式,每次呼叫該函式都會延續該共常式。'
coroutine.yield =
'懸置正在呼叫的共常式的執行。'
@@ -257,11 +257,11 @@ costatus.dead =
debug =
''
debug.debug =
-'進入一個使用者交互模式,執行使用者輸入的每個字串。'
+'進入一個使用者互動模式,執行使用者輸入的每個字串。'
debug.getfenv =
-'回傳對象 `o` 的環境。'
+'回傳物件 `o` 的環境。'
debug.gethook =
-'回傳三個表示執行緒鉤子設定的值: 目前鉤子函式,目前鉤子掩碼,目前鉤子計數 。'
+'回傳三個表示執行緒攔截設定的值:目前攔截函式,目前鉤子遮罩,目前鉤子計數。'
debug.getinfo =
'回傳關於一個函式資訊的表。'
debug.getlocal['<5.1'] =
@@ -277,23 +277,23 @@ debug.getupvalue =
debug.getuservalue['<5.3']=
'回傳關聯在 `u` 上的 `Lua` 值。'
debug.getuservalue['>5.4']=
-'回傳關聯在 `u` 上的第 `n` 個 `Lua` 值,以及一個布林,`false`表示值不存在。'
+'回傳關聯在 `u` 上的第 `n` 個 `Lua` 值,以及一個布林, `false` 表示值不存在。'
debug.setcstacklimit =
[[
### **已在 `Lua 5.4.2` 中廢棄**
-設定新的C堆疊限制。該限制控制Lua中嵌套呼叫的深度,以避免堆疊溢出。
+設定新的C堆疊限制。該限制控制Lua中巢狀呼叫的深度,以避免堆疊溢出。
如果設定成功,該函式回傳之前的限制;否則回傳`false`。
]]
debug.setfenv =
'將 `table` 設定為 `object` 的環境。'
debug.sethook =
-'將一個函式作為鉤子函式設入。'
+'將一個函式作為攔截函式設入。'
debug.setlocal =
'將 `value` 賦給 堆疊上第 `level` 層函式的第 `local` 個區域變數。'
debug.setmetatable =
-'將 `value` 的元表設為 `table` (可以是 `nil`)。'
+'將 `value` 的元表設為 `table` (可以是 `nil` )。'
debug.setupvalue =
'將 `value` 設為函式 `f` 的第 `up` 個上值。'
debug.setuservalue['<5.3']=
@@ -301,16 +301,16 @@ debug.setuservalue['<5.3']=
debug.setuservalue['>5.4']=
'將 `value` 設為 `udata` 的第 `n` 個關聯值。'
debug.traceback =
-'回傳呼叫堆疊的堆疊回溯資訊。 字串可選項 `message` 被添加在堆疊回溯資訊的開頭。'
+'回傳呼叫堆疊的堆疊回溯資訊。字串可選項 `message` 被添加在堆疊回溯資訊的開頭。'
debug.upvalueid =
-'回傳指定函式第 `n` 個上值的唯一識別符(一個輕量使用者資料)。'
+'回傳指定函式第 `n` 個上值的唯一識別字(一個輕量使用者資料)。'
debug.upvaluejoin =
'讓 Lua 閉包 `f1` 的第 `n1` 個上值 引用 `Lua` 閉包 `f2` 的第 `n2` 個上值。'
infowhat.n =
'`name` 和 `namewhat`'
infowhat.S =
-'`source`,`short_src`,`linedefined`,`lalinedefined`,和 `what`'
+'`source` 、 `short_src` 、 `linedefined` 、 `lalinedefined` 和 `what`'
infowhat.l =
'`currentline`'
infowhat.t =
@@ -318,7 +318,7 @@ infowhat.t =
infowhat.u['<5.1'] =
'`nups`'
infowhat.u['>5.2'] =
-'`nups`、`nparams` 和 `isvararg`'
+'`nups` 、 `nparams` 和 `isvararg`'
infowhat.f =
'`func`'
infowhat.r =
@@ -349,13 +349,13 @@ end
```
]]
file[':read'] =
-'讀檔案 `file`, 指定的格式決定了要讀什麼。'
+'讀取檔案 `file` ,指定的格式決定了要讀取什麼。'
file[':seek'] =
'設定及獲取基於檔案開頭處計算出的位置。'
file[':setvbuf'] =
'設定輸出檔案的緩衝模式。'
file[':write'] =
-'將參數的值逐個寫入 `file`。'
+'將引數的值逐個寫入 `file` 。'
readmode.n =
'讀取一個數字,根據 Lua 的轉換文法回傳浮點數或整數。'
@@ -410,18 +410,18 @@ io.output =
io.popen =
'用一個分離程序開啟程式 `prog` 。'
io.read =
-'讀檔案 `file`, 指定的格式決定了要讀什麼。'
+'讀取檔案 `file` ,指定的格式決定了要讀取什麼。'
io.tmpfile =
'如果成功,回傳一個臨時檔案的控制代碼。'
io.type =
'檢查 `obj` 是否是合法的檔案控制代碼。'
io.write =
-'將參數的值逐個寫入預設輸出檔案。'
+'將引數的值逐個寫入預設輸出檔案。'
openmode.r =
-'讀模式。'
+'讀取模式。'
openmode.w =
-'寫模式。'
+'寫入模式。'
openmode.a =
'追加模式。'
openmode['.r+'] =
@@ -431,9 +431,9 @@ openmode['.w+'] =
openmode['.a+'] =
'追加更新模式,所有之前的資料都保留,只允許在檔案尾部做寫入。'
openmode.rb =
-'讀模式。(二進制方式)'
+'讀取模式。(二進制方式)'
openmode.wb =
-'寫模式。(二進制方式)'
+'寫入模式。(二進制方式)'
openmode.ab =
'追加模式。(二進制方式)'
openmode['.r+b'] =
@@ -472,13 +472,13 @@ math.atan2 =
math.ceil =
'回傳不小於 `x` 的最小整數值。'
math.cos =
-'回傳 `x` 的餘弦(假定參數是弧度)。'
+'回傳 `x` 的餘弦(假定引數是弧度)。'
math.cosh =
-'回傳 `x` 的雙曲餘弦(假定參數是弧度)。'
+'回傳 `x` 的雙曲餘弦(假定引數是弧度)。'
math.deg =
'將角 `x` 從弧度轉換為角度。'
math.exp =
-'回傳 `e^x` 的值 (e 為自然對數的底)。'
+'回傳 `e^x` 的值(e 為自然對數的底)。'
math.floor =
'回傳不大於 `x` 的最大整數值。'
math.fmod =
@@ -496,11 +496,11 @@ math.log['>5.2'] =
math.log10 =
'回傳 `x` 的以10為底的對數。'
math.max =
-'回傳參數中最大的值, 大小由 Lua 操作 `<` 決定。'
+'回傳引數中最大的值,大小由 Lua 運算子 `<` 決定。'
math.maxinteger =
'最大值的整數。'
math.min =
-'回傳參數中最小的值, 大小由 Lua 操作 `<` 決定。'
+'回傳引數中最小的值,大小由 Lua 運算子 `<` 決定。'
math.mininteger =
'最小值的整數。'
math.modf =
@@ -513,51 +513,51 @@ math.rad =
'將角 `x` 從角度轉換為弧度。'
math.random =
[[
-* `math.random()`: 回傳 [0,1) 區間內均勻分佈的浮點偽隨機數。
-* `math.random(n)`: 回傳 [1, n] 區間內均勻分佈的整數偽隨機數。
-* `math.random(m, n)`: 回傳 [m, n] 區間內均勻分佈的整數偽隨機數。
+* `math.random()` :回傳 [0,1) 區間內均勻分佈的浮點偽隨機數。
+* `math.random(n)` :回傳 [1, n] 區間內均勻分佈的整數偽隨機數。
+* `math.random(m, n)` :回傳 [m, n] 區間內均勻分佈的整數偽隨機數。
]]
math.randomseed['<5.3'] =
'把 `x` 設為偽隨機數發生器的“種子”: 相同的種子產生相同的隨機數列。'
math.randomseed['>5.4'] =
[[
-* `math.randomseed(x, y)`: 將 `x` 與 `y` 連接為128位的種子來重新初始化偽隨機生成器。
-* `math.randomseed(x)`: 等同於 `math.randomseed(x, 0)` 。
-* `math.randomseed()`: 生成一個較弱的隨機種子。
+* `math.randomseed(x, y)` :將 `x` 與 `y` 連接為128位的種子來重新初始化偽隨機產生器。
+* `math.randomseed(x)` :等同於 `math.randomseed(x, 0)` 。
+* `math.randomseed()` :產生一個較弱的隨機種子。
]]
math.sin =
-'回傳 `x` 的正弦值(假定參數是弧度)。'
+'回傳 `x` 的正弦值(假定引數是弧度)。'
math.sinh =
-'回傳 `x` 的雙曲正弦值(假定參數是弧度)。'
+'回傳 `x` 的雙曲正弦值(假定引數是弧度)。'
math.sqrt =
'回傳 `x` 的平方根。'
math.tan =
-'回傳 `x` 的正切值(假定參數是弧度)。'
+'回傳 `x` 的正切值(假定引數是弧度)。'
math.tanh =
-'回傳 `x` 的雙曲正切值(假定參數是弧度)。'
+'回傳 `x` 的雙曲正切值(假定引數是弧度)。'
math.tointeger =
-'如果 `x` 可以轉換為一個整數, 回傳該整數。'
+'如果 `x` 可以轉換為一個整數,回傳該整數。'
math.type =
-'如果 `x` 是整數,回傳 `"integer"`, 如果它是浮點數,回傳 `"float"`, 如果 `x` 不是數字,回傳 `nil`。'
+'如果 `x` 是整數,回傳 `"integer"` ,如果它是浮點數,回傳 `"float"` ,如果 `x` 不是數字,回傳 `nil` 。'
math.ult =
-'如果整數 `m` 和 `n` 以無符號整數形式比較, `m` 在 `n` 之下,回傳布林真否則回傳假。'
+'整數 `m` 和 `n` 以無符號整數形式比較,如果 `m` 在 `n` 之下則回傳布林真,否則回傳假。'
os =
''
os.clock =
'回傳程式使用的按秒計 CPU 時間的近似值。'
os.date =
-'回傳一個包含日期及時刻的字串或表。 格式化方法取決於所給字串 `format`。'
+'回傳一個包含日期及時刻的字串或表。格式化方法取決於所給字串 `format` 。'
os.difftime =
'回傳以秒計算的時刻 `t1` 到 `t2` 的差值。'
os.execute =
-'呼叫系統直譯器執行 `command`。'
+'呼叫系統直譯器執行 `command` 。'
os.exit['<5.1'] =
'呼叫 C 函式 `exit` 終止宿主程式。'
os.exit['>5.2'] =
'呼叫 ISO C 函式 `exit` 終止宿主程式。'
os.getenv =
-'回傳程序環境變數 `varname` 的值。'
+'回傳處理程序環境變數 `varname` 的值。'
os.remove =
'刪除指定名字的檔案。'
os.rename =
@@ -565,7 +565,7 @@ os.rename =
os.setlocale =
'設定程式的目前區域。'
os.time =
-'當不傳參數時,回傳目前時刻。 如果傳入一張表,就回傳由這張表表示的時刻。'
+'當不傳引數時,回傳目前時刻。如果傳入一張表,就回傳由這張表表示的時刻。'
os.tmpname =
'回傳一個可用於臨時檔案的檔名字串。'
@@ -582,19 +582,19 @@ osdate.min =
osdate.sec =
'0-61'
osdate.wday =
-'星期幾,1-7,星期天為 1'
+'星期幾,範圍為1-7,星期天為 1'
osdate.yday =
-'當年的第幾天,1-366'
+'該年的第幾天,範圍為1-366'
osdate.isdst =
-'夏令時標記,一個布林值'
+'夏令時間,一個布林值'
package =
''
require['<5.3'] =
-'載入一個模組,回傳該模組的回傳值(`nil`時為`true`)。'
+'載入一個模組,回傳該模組的回傳值( `nil` 時為 `true` )。'
require['>5.4'] =
-'載入一個模組,回傳該模組的回傳值(`nil`時為`true`)與搜尋器回傳的載入資料。預設搜尋器的載入資料指示了載入位置,對於檔案來説就是檔案路徑。'
+'載入一個模組,回傳該模組的回傳值( `nil` 時為 `true` )與搜尋器回傳的載入資料。預設搜尋器的載入資料指示了載入位置,對於檔案來説就是檔案路徑。'
package.config =
'一個描述有一些為包管理準備的編譯時期組態訊息的串。'
@@ -605,7 +605,7 @@ package.loaded =
package.loaders =
'用於 `require` 控制如何載入模組的表。'
package.loadlib =
-'讓宿主程式動態連接 C 庫 `libname` 。'
+'讓宿主程式動態連結 C 庫 `libname` 。'
package.path =
'這個路徑被 `require` 在 Lua 載入器中做搜尋時用到。'
package.preload =
@@ -620,18 +620,18 @@ package.seeall =
string =
''
string.byte =
-'回傳字元 `s[i]`, `s[i+1]`, ... ,`s[j]` 的內部數字編碼。'
+'回傳字元 `s[i]` 、 `s[i+1]` ... `s[j]` 的內部數字編碼。'
string.char =
-'接收零或更多的整數。 回傳和參數數量相同長度的字串。 其中每個字元的內部編碼值等於對應的參數值。'
+'接收零或更多的整數,回傳和引數數量相同長度的字串。其中每個字元的內部編碼值等於對應的引數值。'
string.dump =
'回傳包含有以二進制方式表示的(一個 *二進制程式碼區塊* )指定函式的字串。'
string.find =
-'查找第一個字串中匹配到的 `pattern`(參見 §6.4.1)。'
+'尋找第一個字串中配對到的 `pattern`(參見 §6.4.1)。'
string.format =
-'回傳不定數量參數的格式化版本,格式化串為第一個參數。'
+'回傳不定數量引數的格式化版本,格式化字串為第一個引數。'
string.gmatch =
[[
-回傳一個疊代器函式。 每次呼叫這個函式都會繼續以 `pattern` (參見 §6.4.1) 對 s 做匹配,並回傳所有捕獲到的值。
+回傳一個疊代器函式。每次呼叫這個函式都會繼續以 `pattern` (參見 §6.4.1)對 s 做配對,並回傳所有捕獲到的值。
下面這個例子會循環疊代字串 s 中所有的單詞, 並逐行列印:
```lua
@@ -643,27 +643,27 @@ string.gmatch =
```
]]
string.gsub =
-'將字串 s 中,所有的(或是在 n 給出時的前 n 個) pattern (參見 §6.4.1)都替換成 repl ,並回傳其副本。'
+'將字串 s 中,所有的(或是在 n 給出時的前 n 個) `pattern` (參見 §6.4.1)都替換成 `repl` ,並回傳其副本。'
string.len =
'回傳其長度。'
string.lower =
'將其中的大寫字元都轉為小寫後回傳其副本。'
string.match =
-'在字串 s 中找到第一個能用 pattern (參見 §6.4.1)匹配到的部分。 如果能找到,match 回傳其中的捕獲物; 否則回傳 nil 。'
+'在字串 s 中找到第一個能用 `pattern` (參見 §6.4.1)配對到的部分。如果能找到,回傳其中的捕獲物,否則回傳 `nil` 。'
string.pack =
-'回傳一個打包了(即以二進制形式序列化) v1, v2 等值的二進制字串。 字串 fmt 為打包格式(參見 §6.4.2)。'
+'回傳一個壓縮了(即以二進制形式序列化) v1, v2 等值的二進制字串。字串 `fmt` 為壓縮格式(參見 §6.4.2)。'
string.packsize =
-[[回傳以指定格式用 $string.pack 打包的字串的長度。 格式化字串中不可以有變長選項 's' 或 'z' (參見 §6.4.2)。]]
+[[回傳以指定格式用 $string.pack 壓縮的字串的長度。格式化字串中不可以有變長選項 's' 或 'z' (參見 §6.4.2)。]]
string.rep['>5.2'] =
-'回傳 `n` 個字串 `s` 以字串 `sep` 為分割符連在一起的字串。 預設的 `sep` 值為空字串(即沒有分割符)。 如果 `n` 不是正數則回傳空串。'
+'回傳 `n` 個字串 `s` 以字串 `sep` 為分割符連在一起的字串。預設的 `sep` 值為空字串(即沒有分割符)。如果 `n` 不是正數則回傳空字串。'
string.rep['<5.1'] =
-'回傳 `n` 個字串 `s` 連在一起的字串。 如果 `n` 不是正數則回傳空串。'
+'回傳 `n` 個字串 `s` 連在一起的字串。如果 `n` 不是正數則回傳空字串。'
string.reverse =
-'回傳字串 s 的翻轉串。'
+'回傳字串 s 的反轉字串。'
string.sub =
-'回傳字串的子串, 該子串從 `i` 開始到 `j` 為止。'
+'回傳一個從 `i` 開始並在 `j` 結束的子字串。'
string.unpack =
-'回傳以格式 fmt (參見 §6.4.2) 打包在字串 s (參見 string.pack) 中的值。'
+'回傳以格式 `fmt` (參見 §6.4.2) 壓縮在字串 `s` (參見 $string.pack) 中的值。'
string.upper =
'接收一個字串,將其中的小寫字元都轉為大寫後回傳其副本。'
@@ -685,45 +685,45 @@ return a2
```
]]
table.pack =
-'回傳用所有參數以鍵 `1`,`2`, 等填充的新表, 並將 `"n"` 這個域設為參數的總數。'
+'回傳用所有引數以鍵 `1`,`2`, 等填充的新表,並將 `"n"` 這個域設為引數的總數。'
table.remove =
'移除 `list` 中 `pos` 位置上的元素,並回傳這個被移除的值。'
table.sort =
'在表內從 `list[1]` 到 `list[#list]` *原地* 對其間元素按指定順序排序。'
table.unpack =
[[
-回傳列表中的元素。 這個函式等價於
+回傳列表中的元素。這個函式等價於
```lua
return list[i], list[i+1], ···, list[j]
```
-i 預設為 1 ,j 預設為 #list。
+i 預設為 1 , j 預設為 #list。
]]
table.foreach =
-'走訪表中的每一個元素,並以key和value執行回呼函式。如果回呼函式回傳一個非nil值則循環終止,並且回傳這個值。該函式等同pair(list),比pair(list)更慢。不推薦使用'
+'走訪表中的每一個元素,並以key和value執行回呼函式。如果回呼函式回傳一個非nil值則循環終止,並且回傳這個值。該函式等同pair(list),比pair(list)更慢。不推薦使用。'
table.foreachi =
-'走訪表中的每一個元素,並以索引號index和value執行回呼函式。如果回呼函式回傳一個非nil值則循環終止,並且回傳這個值。該函式等同ipair(list),比ipair(list)更慢。不推薦使用'
+'走訪表中的每一個元素,並以索引號index和value執行回呼函式。如果回呼函式回傳一個非nil值則循環終止,並且回傳這個值。該函式等同ipair(list),比ipair(list)更慢。不推薦使用。'
table.getn =
'回傳表的長度。該函式等價於#list。'
-table.new = -- TODO: need translate!
-[[This creates a pre-sized table, just like the C API equivalent `lua_createtable()`. This is useful for big tables if the final table size is known and automatic table resizing is too expensive. `narray` parameter specifies the number of array-like items, and `nhash` parameter specifies the number of hash-like items. The function needs to be required before use.
+table.new =
+[[這將建立一個預先確定大小的表,就像和 C API 等價的 `lua_createtable()` 一樣。如果已確定最終表的大小,而且自動更改大小很耗效能的話,這對大表很有用。 `narray` 參數指定像陣列般元素的數量,而 `nhash` 參數指定像雜湊般元素的數量。使用這個函式前需要先 require。
```lua
require("table.new")
```
]]
-table.clear = -- TODO: need translate!
-[[This clears all keys and values from a table, but preserves the allocated array/hash sizes. This is useful when a table, which is linked from multiple places, needs to be cleared and/or when recycling a table for use by the same context. This avoids managing backlinks, saves an allocation and the overhead of incremental array/hash part growth. The function needs to be required before use.
+table.clear =
+[[這會清除表中的所有的鍵值對,但保留分配的陣列或雜湊大小。當需要清除從多個位置連結的表,或回收表以供同一上下文使用時很有用。這避免了管理反向連結,節省了分配和增加陣列/雜湊部分而增長的開銷。使用這個函式前需要先 require。
```lua
- require("table.clear").
+ require("table.clear")
```
-Please note this function is meant for very specific situations. In most cases it's better to replace the (usually single) link with a new table and let the GC do its work.
+請注意,此函式適用於非常特殊的情況。在大多數情況下,最好用新表替換(通常是單個)連結,並讓垃圾回收完成工作。
]]
utf8 =
''
utf8.char =
-'接收零或多個整數, 將每個整數轉換成對應的 UTF-8 位元組序列,並回傳這些序列連接到一起的字串。'
+'接收零或多個整數,將每個整數轉換成對應的 UTF-8 位元組序列,並回傳這些序列連接到一起的字串。'
utf8.charpattern =
-'用於精確匹配到一個 UTF-8 位元組序列的模式,它假定處理的對象是一個合法的 UTF-8 字串。'
+'用於精確配對到一個 UTF-8 位元組序列的模式,它假定處理的對象是一個合法的 UTF-8 字串。'
utf8.codes =
[[
回傳一系列的值,可以讓
@@ -732,11 +732,11 @@ for p, c in utf8.codes(s) do
body
end
```
-疊代出字串 s 中所有的字元。 這裡的 p 是位置(按位元組數)而 c 是每個字元的編號。 如果處理到一個不合法的位元組序列,將拋出一個錯誤。
+疊代出字串 `s` 中所有的字元。這裡的 `p` 是位置(按位元組數)而 `c` 是每個字元的編號。如果處理到一個不合法的位元組序列,將擲回一個錯誤。
]]
utf8.codepoint =
-'以整數形式回傳 `s` 中 從位置 `i` 到 `j` 間(包括兩端) 所有字元的編號。'
+'以整數形式回傳 `s` 中 從位置 `i` 到 `j` 間(包括兩端)所有字元的編號。'
utf8.len =
'回傳字串 `s` 中 從位置 `i` 到 `j` 間 (包括兩端) UTF-8 字元的個數。'
utf8.offset =
-'回傳編碼在 `s` 中的第 `n` 個字元的開始位置(按位元組數) (從位置 `i` 處開始統計)。'
+'回傳編碼在 `s` 中的第 `n` 個字元的開始位置(按位元組數)(從位置 `i` 處開始統計)。' \ No newline at end of file
diff --git a/locale/zh-tw/script.lua b/locale/zh-tw/script.lua
index cef05b54..29be6df3 100644
--- a/locale/zh-tw/script.lua
+++ b/locale/zh-tw/script.lua
@@ -13,15 +13,15 @@ DIAG_UNDEF_ENV_CHILD =
DIAG_UNDEF_FENV_CHILD =
'未定義的變數 `{}`(處於模組中)。'
DIAG_GLOBAL_IN_NIL_ENV =
-'不能使用全域變數(`_ENV`被設為了`nil`)。'
+'不能使用全域變數( `_ENV` 被設為了 `nil` )。'
DIAG_GLOBAL_IN_NIL_FENV =
-'不能使用全域變數(模組被設為了`nil`)。'
+'不能使用全域變數(模組被設為了 `nil` )。'
DIAG_UNUSED_LABEL =
'未使用的標籤 `{}`。'
DIAG_UNUSED_FUNCTION =
'未使用的函式。'
DIAG_UNUSED_VARARG =
-'未使用的不定參數。'
+'未使用的不定引數。'
DIAG_REDEFINED_LOCAL =
'重複定義區域變數 `{}`。'
DIAG_DUPLICATE_INDEX =
@@ -29,17 +29,17 @@ DIAG_DUPLICATE_INDEX =
DIAG_DUPLICATE_METHOD =
'重複的方法 `{}`。'
DIAG_PREVIOUS_CALL =
-'會被直譯為 `{}{}`。你可能需要加一個 `;`。'
+'會被直譯為 `{}{}` 。你可能需要加一個 `;`。'
DIAG_PREFIELD_CALL =
-'會被直譯為 `{}{}`。你可能需要加一個`,`或`;`。'
+'會被直譯為 `{}{}` 。你可能需要加一個 `,` 或 `;` 。'
DIAG_OVER_MAX_ARGS =
-'函式最多接收 {:d} 個參數,但獲得了 {:d} 個。'
+'函式最多接收 {:d} 個引數,但獲得了 {:d} 個。'
DIAG_MISS_ARGS =
-'函式最少接收 {:d} 個參數,但獲得了 {:d} 個。'
+'函式最少接收 {:d} 個引數,但獲得了 {:d} 個。'
DIAG_OVER_MAX_VALUES =
'只有 {} 個變數,但你設定了 {} 個值。'
DIAG_AMBIGUITY_1 =
-'會優先運算 `{}`,你可能需要加個括號。'
+'會優先運算 `{}` ,你可能需要加個括號。'
DIAG_LOWERCASE_GLOBAL =
'首字母小寫的全域變數,你是否漏了 `local` 或是有拼寫錯誤?'
DIAG_EMPTY_BLOCK =
@@ -79,21 +79,21 @@ DIAG_UNBALANCED_ASSIGNMENTS =
DIAG_REQUIRE_LIKE =
'你可以在設定中將 `{}` 視為 `require`。'
DIAG_COSE_NON_OBJECT =
-'無法 close 此類型的值。(除非給此類型設定 `__close` 元方法)'
+'無法 close 此型別的值。(除非給此型別設定 `__close` 元方法)'
DIAG_COUNT_DOWN_LOOP =
'你的意思是 `{}` 嗎?'
DIAG_UNKNOWN =
-'無法推測出類型。'
+'無法推測出型別。'
DIAG_DEPRECATED =
'已廢棄。'
DIAG_DIFFERENT_REQUIRES =
-'使用了不同的名字 require 了同一個檔案。'
+'使用了不同的名字 `require` 了同一個檔案。'
DIAG_REDUNDANT_RETURN =
'冗餘回傳。'
DIAG_AWAIT_IN_SYNC =
-'只能在標記為異步的函式中呼叫異步函式。'
+'只能在標記為非同步的函式中呼叫非同步函式。'
DIAG_NOT_YIELDABLE =
-'此函式的第 {} 個參數沒有被標記為可讓出,但是傳入了異步函式。(使用 `---@param name async fun()` 來標記為可讓出)'
+'此函式的第 {} 個參數沒有被標記為可讓出,但是傳入了非同步函式。(使用 `---@param name async fun()` 來標記為可讓出)'
DIAG_DISCARD_RETURNS =
'不能丟棄此函式的回傳值。'
DIAG_NEED_CHECK_NIL =
@@ -111,7 +111,7 @@ DIAG_DUPLICATE_DOC_PARAM =
DIAG_UNDEFINED_DOC_CLASS =
'未定義的類別 `{}`。'
DIAG_UNDEFINED_DOC_NAME =
-'未定義的類型或別名 `{}`。'
+'未定義的型別或別名 `{}`。'
DIAG_UNDEFINED_DOC_PARAM =
'指向了未定義的參數 `{}`。'
DIAG_UNKNOWN_DIAG_CODE =
@@ -142,6 +142,10 @@ WORKSPACE_DIAGNOSTIC =
'正在對工作目錄進行診斷'
WORKSPACE_SKIP_HUGE_FILE =
'出於效能考慮,已停止對此檔案解析:{}'
+WORKSPACE_NOT_ALLOWED =
+'你的工作目錄被設定為了 `{}` ,Lua語言服務拒絕載入此目錄,請檢查你的設定檔。[了解更多](https://github.com/sumneko/lua-language-server/wiki/Why-scanning-home-folder)'
+WORKSPACE_SCAN_TOO_MUCH =
+'已掃描了超過 {} 個檔案,目前掃描的目錄為 `{}`,請確認設定檔是否正確。'
PARSER_CRASH =
'語法解析崩潰了!遺言:{}'
@@ -172,11 +176,11 @@ PARSER_MISS_FIELD =
PARSER_MISS_METHOD =
'缺少方法名。'
PARSER_ARGS_AFTER_DOTS =
-'`...`必須是最後一個參數。'
+'`...`必須是最後一個引數。'
PARSER_KEYWORD =
'關鍵字無法作為名稱。'
PARSER_EXP_IN_ACTION =
-'該表達式不能作為語句。'
+'該表達式不能作為敘述。'
PARSER_BREAK_OUTSIDE =
'`break`必須在循環內部。'
PARSER_MALFORMED_NUMBER =
@@ -200,47 +204,47 @@ PARSER_UNKNOWN_TAG =
PARSER_MULTI_TAG =
'只能設定一個屬性。'
PARSER_UNEXPECT_LFUNC_NAME =
-'區域函式只能使用識別符作為名稱。'
+'區域函式只能使用識別字作為名稱。'
PARSER_UNEXPECT_EFUNC_NAME =
'函式作為表達式時不能命名。'
PARSER_ERR_LCOMMENT_END =
-'應使用`{symbol}`來關閉多行註解。'
+'應使用 `{symbol}` 來關閉多行註解。'
PARSER_ERR_C_LONG_COMMENT =
-'Lua應使用`--[[ ]]`來進行多行註解。'
+'Lua應使用 `--[[ ]]` 來進行多行註解。'
PARSER_ERR_LSTRING_END =
-'應使用`{symbol}`來關閉長字串。'
+'應使用 `{symbol}` 來關閉長字串。'
PARSER_ERR_ASSIGN_AS_EQ =
-'應使用`=`來進行賦值操作。'
+'應使用 `=` 來進行賦值操作。'
PARSER_ERR_EQ_AS_ASSIGN =
-'應使用`==`來進行等於判斷。'
+'應使用 `==` 來進行等於判斷。'
PARSER_ERR_UEQ =
-'應使用`~=`來進行不等於判斷。'
+'應使用 `~=` 來進行不等於判斷。'
PARSER_ERR_THEN_AS_DO =
-'應使用`then`。'
+'應使用 `then` 。'
PARSER_ERR_DO_AS_THEN =
-'應使用`do`。'
+'應使用 `do` 。'
PARSER_MISS_END =
-'缺少對應的`end`。'
+'缺少對應的 `end` 。'
PARSER_ERR_COMMENT_PREFIX =
-'Lua應使用`--`來進行註解。'
+'Lua應使用 `--` 來進行註解。'
PARSER_MISS_SEP_IN_TABLE =
-'需要用`,`或`;`進行分割。'
+'需要用 `,` 或 `;` 進行分割。'
PARSER_SET_CONST =
'不能對常數賦值。'
PARSER_UNICODE_NAME =
'包含了 Unicode 字元。'
PARSER_ERR_NONSTANDARD_SYMBOL =
-'Lua中應使用符號 `{symbol}`。'
+'Lua中應使用符號 `{symbol}` 。'
PARSER_MISS_SPACE_BETWEEN =
-'符號之間必須保留空格'
+'符號之間必須保留空格。'
PARSER_INDEX_IN_FUNC_NAME =
'命名函式的名稱中不能使用 `[name]` 形式。'
PARSER_UNKNOWN_ATTRIBUTE =
-'區域變數屬性應該是 `const` 或 `close`'
+'區域變數屬性應該是 `const` 或 `close` 。'
PARSER_LUADOC_MISS_CLASS_NAME =
'缺少類別名稱。'
PARSER_LUADOC_MISS_EXTENDS_SYMBOL =
-'缺少符號 `:`。'
+'缺少符號 `:` 。'
PARSER_LUADOC_MISS_CLASS_EXTENDS_NAME =
'缺少要繼承的類別名稱。'
PARSER_LUADOC_MISS_SYMBOL =
@@ -248,7 +252,7 @@ PARSER_LUADOC_MISS_SYMBOL =
PARSER_LUADOC_MISS_ARG_NAME =
'缺少參數名稱。'
PARSER_LUADOC_MISS_TYPE_NAME =
-'缺少類型名。'
+'缺少型別名。'
PARSER_LUADOC_MISS_ALIAS_NAME =
'缺少別名。'
PARSER_LUADOC_MISS_ALIAS_EXTENDS =
@@ -256,21 +260,21 @@ PARSER_LUADOC_MISS_ALIAS_EXTENDS =
PARSER_LUADOC_MISS_PARAM_NAME =
'缺少要指向的參數名稱。'
PARSER_LUADOC_MISS_PARAM_EXTENDS =
-'缺少參數的類型定義。'
+'缺少參數的型別定義。'
PARSER_LUADOC_MISS_FIELD_NAME =
'缺少欄位名稱。'
PARSER_LUADOC_MISS_FIELD_EXTENDS =
-'缺少欄位的類型定義。'
+'缺少欄位的型別定義。'
PARSER_LUADOC_MISS_GENERIC_NAME =
'缺少泛型名稱。'
PARSER_LUADOC_MISS_GENERIC_EXTENDS_NAME =
'缺少泛型要繼承的類別名稱。'
PARSER_LUADOC_MISS_VARARG_TYPE =
-'缺少可變參數的類型定義。'
+'缺少可變引數的型別定義。'
PARSER_LUADOC_MISS_FUN_AFTER_OVERLOAD =
-'缺少關鍵字 `fun`。'
+'缺少關鍵字 `fun` 。'
PARSER_LUADOC_MISS_CATE_NAME =
-'缺少文件類型名稱。'
+'缺少文件型別名稱。'
PARSER_LUADOC_MISS_DIAG_MODE =
'缺少診斷模式。'
PARSER_LUADOC_ERROR_DIAG_MODE =
@@ -282,7 +286,7 @@ SYMBOL_ANONYMOUS =
'<匿名函式>'
HOVER_VIEW_DOCUMENTS =
-'查看文件'
+'檢視文件'
HOVER_DOCUMENT_LUA51 =
'https://www.lua.org/manual/5.1/manual.html#{}'
HOVER_DOCUMENT_LUA52 =
@@ -304,25 +308,25 @@ HOVER_NATIVE_DOCUMENT_LUA54 =
HOVER_NATIVE_DOCUMENT_LUAJIT =
'command:extension.lua.doc?["en-us/51/manual.html/{}"]'
HOVER_MULTI_PROTOTYPE =
-'({} 個原型)'
+'({} 個原型)'
HOVER_STRING_BYTES =
'{} 個位元組'
HOVER_STRING_CHARACTERS =
'{} 個位元組,{} 個字元'
HOVER_MULTI_DEF_PROTO =
-'({} 個定義,{} 個原型)'
+'({} 個定義,{} 個原型)'
HOVER_MULTI_PROTO_NOT_FUNC =
-'({} 個非函式定義)'
+'({} 個非函式定義)'
HOVER_USE_LUA_PATH =
-'(搜尋路徑: `{}`)'
+'(搜尋路徑: `{}` )'
HOVER_EXTENDS =
'展開為 {}'
HOVER_TABLE_TIME_UP =
-'出於效能考慮,已停用了部分類型推斷。'
+'出於效能考慮,已停用了部分型別推斷。'
HOVER_WS_LOADING =
'正在載入工作目錄:{} / {}'
HOVER_AWAIT_TOOLTIP =
-'正在呼叫異步函式,可能會讓出目前共常式'
+'正在呼叫非同步函式,可能會讓出目前共常式'
ACTION_DISABLE_DIAG =
'在工作區停用診斷 ({})。'
@@ -379,7 +383,7 @@ ACTION_DISABLE_DIAG_LINE=
ACTION_DISABLE_DIAG_FILE=
'在此檔案停用診斷 ({})。'
ACTION_MARK_ASYNC =
-'將目前函式標記為異步。'
+'將目前函式標記為非同步。'
COMMAND_DISABLE_DIAG =
'停用診斷'
@@ -401,7 +405,7 @@ COMMAND_JSON_TO_LUA_FAILED =
'JSON 轉 Lua 失敗:{}'
COMPLETION_IMPORT_FROM =
-'從 {} 中導入'
+'從 {} 中匯入'
COMPLETION_DISABLE_AUTO_REQUIRE =
'停用自動require'
COMPLETION_ASK_AUTO_REQUIRE =
@@ -470,7 +474,7 @@ WINDOW_LUA_STATUS_DIAGNOSIS_TITLE=
WINDOW_LUA_STATUS_DIAGNOSIS_MSG =
'是否進行工作區診斷?'
WINDOW_APPLY_SETTING =
-'應用設定'
+'套用設定'
WINDOW_CHECK_SEMANTIC =
'如果你正在使用市場中的顏色主題,你可能需要同時修改 `editor.semanticHighlighting.enabled` 選項為 `true` 才會使語義著色生效。'
WINDOW_TELEMETRY_HINT =
@@ -480,9 +484,9 @@ WINDOW_TELEMETRY_ENABLE =
WINDOW_TELEMETRY_DISABLE =
'禁止'
WINDOW_CLIENT_NOT_SUPPORT_CONFIG =
-'你的使用者端不支援從伺服端修改設定,請手動修改如下設定:'
+'你的用戶端不支援從伺服端修改設定,請手動修改以下設定:'
WINDOW_LCONFIG_NOT_SUPPORT_CONFIG=
-'暫不支援自動修改本地設定,請手動修改如下設定:'
+'暫時不支援自動修改本地設定,請手動修改以下設定:'
WINDOW_MANUAL_CONFIG_ADD =
'為 `{key}` 添加值 `{value:q}`;'
WINDOW_MANUAL_CONFIG_SET =
@@ -490,9 +494,9 @@ WINDOW_MANUAL_CONFIG_SET =
WINDOW_MANUAL_CONFIG_PROP =
'將 `{key}` 的屬性 `{prop}` 設定為 `{value:q}`;'
WINDOW_APPLY_WHIT_SETTING =
-'應用並修改設定'
+'套用並修改設定'
WINDOW_APPLY_WHITOUT_SETTING =
-'應用但不修改設定'
+'套用但不修改設定'
WINDOW_ASK_APPLY_LIBRARY =
'是否需要將你的工作環境配置為 `{}` ?'
WINDOW_SEARCHING_IN_FILES =
@@ -537,4 +541,4 @@ CLI_CHECK_INITING =
CLI_CHECK_SUCCESS =
'診斷完成,沒有發現問題'
CLI_CHECK_RESULTS =
-'診斷完成,共有 {} 個問題,請查看 {}'
+'診斷完成,共有 {} 個問題,請查看 {}' \ No newline at end of file
diff --git a/locale/zh-tw/setting.lua b/locale/zh-tw/setting.lua
index c0ffcbfd..782ca66a 100644
--- a/locale/zh-tw/setting.lua
+++ b/locale/zh-tw/setting.lua
@@ -4,7 +4,7 @@ config.runtime.version =
"Lua執行版本。"
config.runtime.path =
[[
-當使用 `require` 時,如何根據輸入的名字來查找檔案。
+當使用 `require` 時,如何根據輸入的名字來尋找檔案。
此選項設定為 `?/init.lua` 意味著當你輸入 `require 'myfile'` 時,會從已載入的檔案中搜尋 `{workspace}/myfile/init.lua`。
當 `runtime.pathStrict` 設定為 `false` 時,還會嘗試搜尋 `${workspace}/**/myfile/init.lua`。
如果你想要載入工作區以外的檔案,你需要先設定 `Lua.workspace.library`。
@@ -12,7 +12,7 @@ config.runtime.path =
config.runtime.pathStrict =
'啟用後 `runtime.path` 將只搜尋第一層目錄,見 `runtime.path` 的説明。'
config.runtime.special =
-[[將自定義全域變數視為一些特殊的內建變數,語言服務將提供特殊的支援。
+[[將自訂全域變數視為一些特殊的內建變數,語言服務將提供特殊的支援。
下面這個例子表示將 `include` 視為 `require` 。
```json
"Lua.runtime.special" : {
@@ -51,7 +51,7 @@ config.diagnostics.neededFileStatus =
* Disable: 停用此診斷
]]
config.diagnostics.workspaceDelay =
-"進行工作區診斷的延遲(毫秒)。當你啟動工作區,或編輯了任意檔案後,將會在後台對整個工作區進行重新診斷。設定為負數可以停用工作區診斷。"
+"進行工作區診斷的延遲(毫秒)。當你啟動工作區,或編輯了任意檔案後,將會在背景對整個工作區進行重新診斷。設定為負數可以停用工作區診斷。"
config.diagnostics.workspaceRate =
"工作區診斷的執行速率(百分比)。降低該值會減少CPU佔用,但是也會降低工作區診斷的速度。你目前正在編輯的檔案的診斷總是全速完成,不受該選項影響。"
config.diagnostics.libraryFiles =
@@ -64,6 +64,8 @@ config.diagnostics.files.Opened =
"只有打開這些檔案時才會診斷。"
config.diagnostics.files.Disable =
"不診斷這些檔案。"
+config.diagnostics.disableScheme =
+'不診斷使用以下 scheme 的lua檔案。'
config.workspace.ignoreDir =
"忽略的檔案與目錄(使用 `.gitignore` 語法)。"
config.workspace.ignoreSubmodules =
@@ -75,10 +77,10 @@ config.workspace.maxPreload =
config.workspace.preloadFileSize =
"預載入時跳過大小大於該值(KB)的檔案。"
config.workspace.library =
-"除了目前工作區以外,還會從哪些目錄中載入檔案。這些目錄中的檔案將被視作外部提供的程式碼庫,部分操作(如重命名欄位)不會修改這些檔案。"
+"除了目前工作區以外,還會從哪些目錄中載入檔案。這些目錄中的檔案將被視作外部提供的程式碼庫,部分操作(如重新命名欄位)不會修改這些檔案。"
config.workspace.checkThirdParty =
[[
-自動檢測與適應第三方庫,目前支援的庫為:
+自動偵測與適應第三方庫,目前支援的庫為:
* OpenResty
* Cocos4.0
@@ -89,6 +91,8 @@ config.workspace.checkThirdParty =
]]
config.workspace.userThirdParty =
'在這裡添加私有的第三方庫適應檔案路徑,請參考內建的[組態檔案路徑](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)'
+config.workspace.supportScheme =
+'為以下 `scheme` 的lua檔案提供語言服務。'
config.completion.enable =
'啟用自動完成。'
config.completion.callSnippet =
@@ -100,7 +104,7 @@ config.completion.callSnippet.Both =
config.completion.callSnippet.Replace =
"只顯示 `呼叫片段`。"
config.completion.keywordSnippet =
-'顯示關鍵字語法片段'
+'顯示關鍵字語法片段。'
config.completion.keywordSnippet.Disable =
"只顯示 `關鍵字`。"
config.completion.keywordSnippet.Both =
@@ -108,7 +112,7 @@ config.completion.keywordSnippet.Both =
config.completion.keywordSnippet.Replace =
"只顯示 `語法片段`。"
config.completion.displayContext =
-"預覽建議的相關程式碼片段,可能可以幫助你瞭解這項建議的用法。設定的數字表示程式碼片段的擷取行數,設定為`0`可以停用此功能。"
+"預覽建議的相關程式碼片段,可能可以幫助你瞭解這項建議的用法。設定的數字表示程式碼片段的擷取行數,設定為 `0` 可以停用此功能。"
config.completion.workspaceWord =
"顯示的上下文單詞是否包含工作區中其他檔案的內容。"
config.completion.showWord =
@@ -132,7 +136,7 @@ config.color.mode =
config.color.mode.Semantic =
"語義著色。你可能需要同時將 `editor.semanticHighlighting.enabled` 設定為 `true` 才能生效。"
config.color.mode.SemanticEnhanced =
-"增強的語義顏色。 類似於`Semantic`,但會進行額外的分析(也會帶來額外的開銷)。"
+"增強的語義顏色。類似於`Semantic`,但會進行額外的分析(也會帶來額外的開銷)。"
config.color.mode.Grammar =
"語法著色。"
config.semantic.enable =
@@ -140,7 +144,7 @@ config.semantic.enable =
config.semantic.variable =
"對變數/欄位/參數進行語義著色。"
config.semantic.annotation =
-"對類型註解進行語義著色。"
+"對型別註解進行語義著色。"
config.semantic.keyword =
"對關鍵字/字面常數/運算子進行語義著色。只有當你的編輯器無法進行語法著色時才需要啟用此功能。"
config.signatureHelp.enable =
@@ -148,17 +152,17 @@ config.signatureHelp.enable =
config.hover.enable =
"啟用懸浮提示。"
config.hover.viewString =
-"懸浮提示查看字串內容(僅當字面常數包含跳脫字元時)。"
+"懸浮提示檢視字串內容(僅當字面常數包含跳脫字元時)。"
config.hover.viewStringMax =
-"懸浮提示查看字串內容時的最大長度。"
+"懸浮提示檢視字串內容時的最大長度。"
config.hover.viewNumber =
-"懸浮提示查看數字內容(僅當字面常數不是十進制時)。"
+"懸浮提示檢視數字內容(僅當字面常數不是十進制時)。"
config.hover.fieldInfer =
-"懸浮提示查看表時,會對表的每個欄位進行類型推測,當類型推測的用時累計達到該設定值(毫秒)時,將跳過後續欄位的類型推測。"
+"懸浮提示檢視表時,會對表的每個欄位進行型別推測,當型別推測的用時累計達到該設定值(毫秒)時,將跳過後續欄位的型別推測。"
config.hover.previewFields =
-"懸浮提示查看表時,限制表內欄位的最大預覽數量。"
+"懸浮提示檢視表時,限制表內欄位的最大預覽數量。"
config.hover.enumsLimit =
-"當值對應多個類型時,限制類型的顯示數量。"
+"當值對應多個型別時,限制型別的顯示數量。"
config.develop.enable =
'開發者模式。請勿開啟,會影響效能。'
config.develop.debuggerPort =
@@ -168,7 +172,7 @@ config.develop.debuggerWait =
config.intelliSense.searchDepth =
'設定智慧感知的搜尋深度。增大該值可以增加準確度,但會降低效能。不同的工作區對該設定的容忍度差異較大,請自己調整為合適的值。'
config.intelliSense.fastGlobal =
-'在對全域變數進行補全,及查看 `_G` 的懸浮提示時進行最佳化。這會略微降低類型推測的準確度,但是對於大量使用全域變數的專案會有大幅的效能提升。'
+'在對全域變數進行補全,及檢視 `_G` 的懸浮提示時進行最佳化。這會略微降低型別推測的準確度,但是對於大量使用全域變數的專案會有大幅的效能提升。'
config.window.statusBar =
'在狀態欄顯示延伸模組狀態。'
config.window.progressBar =
@@ -176,15 +180,15 @@ config.window.progressBar =
config.hint.enable =
'啟用內嵌提示。'
config.hint.paramType =
-'在函式的參數位置提示類型。'
+'在函式的參數位置提示型別。'
config.hint.setType =
-'在賦值操作位置提示類型。'
+'在賦值操作位置提示型別。'
config.hint.paramName =
'在函式呼叫處提示參數名。'
config.hint.paramName.All =
-'所有類型的參數均進行提示。'
+'所有型別的參數均進行提示。'
config.hint.paramName.Literal =
-'只有字面常數類型的參數進行提示。'
+'只有字面常數型別的參數進行提示。'
config.hint.paramName.Disable =
'停用參數提示。'
config.hint.arrayIndex =
@@ -192,7 +196,7 @@ config.hint.arrayIndex =
config.hint.arrayIndex.Enable =
'所有的表中都提示陣列索引。'
config.hint.arrayIndex.Auto =
-'只有表大於3項,或者表是混合類型時才進行提示。'
+'只有表大於3項,或者表是混合型別時才進行提示。'
config.hint.arrayIndex.Disable =
'停用陣列索引提示。'
config.format.enable =
@@ -222,7 +226,7 @@ config.diagnostics['global-in-nil-env'] =
config.diagnostics['unused-label'] =
'未使用的標籤'
config.diagnostics['unused-vararg'] =
-'未使用的不定參數'
+'未使用的不定引數'
config.diagnostics['trailing-space'] =
'後置空格'
config.diagnostics['redefined-local'] =
@@ -232,9 +236,9 @@ config.diagnostics['newline-call'] =
config.diagnostics['newfield-call'] =
'在字面常數表中,2行程式碼之間缺少分隔符,在語法上被解析為了一次索引操作'
config.diagnostics['redundant-parameter'] =
-'函式呼叫時,傳入了多餘的參數'
+'函式呼叫時,傳入了多餘的引數'
config.diagnostics['ambiguity-1'] =
-'優先級歧義,如:`num or 0 + 1`,推測使用者的實際期望為 `(num or 0) + 1` '
+'優先級歧義,如: `num or 0 + 1` ,推測使用者的實際期望為 `(num or 0) + 1`'
config.diagnostics['lowercase-global'] =
'首字母小寫的全域變數定義'
config.diagnostics['undefined-env-child'] =
@@ -244,4 +248,4 @@ config.diagnostics['duplicate-index'] =
config.diagnostics['empty-block'] =
'空程式碼區塊'
config.diagnostics['redundant-value'] =
-'賦值操作時,值的數量比被賦值的對象多'
+'賦值操作時,值的數量比被賦值的對象多' \ No newline at end of file
diff --git a/meta/3rd/love2d/library/love.audio.lua b/meta/3rd/love2d/library/love.audio.lua
index 0d8b3296..fc6fba25 100644
--- a/meta/3rd/love2d/library/love.audio.lua
+++ b/meta/3rd/love2d/library/love.audio.lua
@@ -161,7 +161,7 @@ function love.audio.setDopplerScale(scale) end
---
---Not all system supports audio effects. Use love.audio.isEffectsSupported to check.
---
----@overload fun(name: string, enabled: boolean):boolean
+---@overload fun(name: string, enabled?: boolean):boolean
---@param name string # The name of the effect.
---@param settings {type: love.EffectType, volume: number} # The settings to use for this effect, with the following fields:
---@return boolean success # Whether the effect was successfully created.
@@ -355,7 +355,7 @@ function Source:getDuration(unit) end
---This function returns nil if the effect was applied with no filter settings associated to it.
---
---@param name string # The name of the effect.
----@param filtersettings? table # An optional empty table that will be filled with the filter settings.
+---@param filtersettings table # An optional empty table that will be filled with the filter settings.
---@return {volume: number, highgain: number, lowgain: number} filtersettings # The settings for the filter associated to this effect, or nil if the effect is not present in this Source or has no filter associated. The table has the following fields:
function Source:getEffect(name, filtersettings) end
@@ -597,31 +597,31 @@ function Source:tell(unit) end
---
---Sources do not get attenuated.
---
----| '"none"'
+---| "none"
---
---Inverse distance attenuation.
---
----| '"inverse"'
+---| "inverse"
---
---Inverse distance attenuation. Gain is clamped. In version 0.9.2 and older this is named '''inverse clamped'''.
---
----| '"inverseclamped"'
+---| "inverseclamped"
---
---Linear attenuation.
---
----| '"linear"'
+---| "linear"
---
---Linear attenuation. Gain is clamped. In version 0.9.2 and older this is named '''linear clamped'''.
---
----| '"linearclamped"'
+---| "linearclamped"
---
---Exponential attenuation.
---
----| '"exponent"'
+---| "exponent"
---
---Exponential attenuation. Gain is clamped. In version 0.9.2 and older this is named '''exponent clamped'''.
---
----| '"exponentclamped"'
+---| "exponentclamped"
---
---The different types of effects supported by love.audio.setEffect.
@@ -630,35 +630,35 @@ function Source:tell(unit) end
---
---Plays multiple copies of the sound with slight pitch and time variation. Used to make sounds sound "fuller" or "thicker".
---
----| '"chorus"'
+---| "chorus"
---
---Decreases the dynamic range of the sound, making the loud and quiet parts closer in volume, producing a more uniform amplitude throughout time.
---
----| '"compressor"'
+---| "compressor"
---
---Alters the sound by amplifying it until it clips, shearing off parts of the signal, leading to a compressed and distorted sound.
---
----| '"distortion"'
+---| "distortion"
---
---Decaying feedback based effect, on the order of seconds. Also known as delay; causes the sound to repeat at regular intervals at a decreasing volume.
---
----| '"echo"'
+---| "echo"
---
---Adjust the frequency components of the sound using a 4-band (low-shelf, two band-pass and a high-shelf) equalizer.
---
----| '"equalizer"'
+---| "equalizer"
---
---Plays two copies of the sound; while varying the phase, or equivalently delaying one of them, by amounts on the order of milliseconds, resulting in phasing sounds.
---
----| '"flanger"'
+---| "flanger"
---
---Decaying feedback based effect, on the order of milliseconds. Used to simulate the reflection off of the surroundings.
---
----| '"reverb"'
+---| "reverb"
---
---An implementation of amplitude modulation; multiplies the source signal with a simple waveform, to produce either volume changes, or inharmonic overtones.
---
----| '"ringmodulator"'
+---| "ringmodulator"
---
---The different types of waveforms that can be used with the '''ringmodulator''' EffectType.
@@ -667,19 +667,19 @@ function Source:tell(unit) end
---
---A sawtooth wave, also known as a ramp wave. Named for its linear rise, and (near-)instantaneous fall along time.
---
----| '"sawtooth"'
+---| "sawtooth"
---
---A sine wave. Follows a trigonometric sine function.
---
----| '"sine"'
+---| "sine"
---
---A square wave. Switches between high and low states (near-)instantaneously.
---
----| '"square"'
+---| "square"
---
---A triangle wave. Follows a linear rise and fall that repeats periodically.
---
----| '"triangle"'
+---| "triangle"
---
---Types of filters for Sources.
@@ -688,15 +688,15 @@ function Source:tell(unit) end
---
---Low-pass filter. High frequency sounds are attenuated.
---
----| '"lowpass"'
+---| "lowpass"
---
---High-pass filter. Low frequency sounds are attenuated.
---
----| '"highpass"'
+---| "highpass"
---
---Band-pass filter. Both high and low frequency sounds are attenuated based on the given parameters.
---
----| '"bandpass"'
+---| "bandpass"
---
---Types of audio sources.
@@ -707,15 +707,15 @@ function Source:tell(unit) end
---
---The whole audio is decoded.
---
----| '"static"'
+---| "static"
---
---The audio is decoded in chunks when needed.
---
----| '"stream"'
+---| "stream"
---
---The audio must be manually queued by the user.
---
----| '"queue"'
+---| "queue"
---
---Units that represent time.
@@ -724,8 +724,8 @@ function Source:tell(unit) end
---
---Regular seconds.
---
----| '"seconds"'
+---| "seconds"
---
---Audio samples.
---
----| '"samples"'
+---| "samples"
diff --git a/meta/3rd/love2d/library/love.data.lua b/meta/3rd/love2d/library/love.data.lua
index b502d42e..433b035d 100644
--- a/meta/3rd/love2d/library/love.data.lua
+++ b/meta/3rd/love2d/library/love.data.lua
@@ -9,7 +9,7 @@ love.data = {}
---
---Compresses a string or data using a specific compression algorithm.
---
----@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data, level: number):love.CompressedData|string
+---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data, level?: number):love.CompressedData|string
---@param container love.ContainerType # What type to return the compressed data as.
---@param format love.CompressedDataFormat # The format to use when compressing the string.
---@param rawstring string # The raw (un-compressed) string to compress.
@@ -40,7 +40,7 @@ function love.data.decompress(container, compressedData) end
---
---Encode Data or a string to a Data or string in one of the EncodeFormats.
---
----@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data, linelength: number):love.ByteData|string
+---@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data, linelength?: number):love.ByteData|string
---@param container love.ContainerType # What type to return the encoded data as.
---@param format love.EncodeFormat # The format of the output data.
---@param sourceString string # The raw data to encode.
@@ -71,7 +71,7 @@ function love.data.hash(hashFunction, string) end
---
---Data:getPointer along with LuaJIT's FFI can be used to manipulate the contents of the ByteData object after it has been created.
---
----@overload fun(Data: love.Data, offset: number, size: number):love.ByteData
+---@overload fun(Data: love.Data, offset?: number, size?: number):love.ByteData
---@overload fun(size: number):love.ByteData
---@param datastring string # The byte string to copy.
---@return love.ByteData bytedata # The new Data object.
@@ -94,15 +94,16 @@ function love.data.newDataView(data, offset, size) end
---@param container love.ContainerType # What type to return the encoded data as.
---@param format string # A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
---@param v1 number|boolean|string # The first value (number, boolean, or string) to serialize.
+---@vararg number|boolean|string # Additional values to serialize.
---@return love.Data|string data # Data/string which contains the serialized data.
-function love.data.pack(container, format, v1) end
+function love.data.pack(container, format, v1, ...) end
---
---Unpacks (deserializes) a byte-string or Data into simple Lua values.
---
---This function behaves the same as Lua 5.3's string.unpack.
---
----@overload fun(format: string, data: love.Data, pos: number):number|boolean|string, number|boolean|string, number
+---@overload fun(format: string, data: love.Data, pos?: number):number|boolean|string, number|boolean|string, number
---@param format string # A string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
---@param datastring string # A string containing the packed (serialized) data.
---@param pos? number # Where to start reading in the string. Negative values can be used to read relative from the end of the string.
@@ -139,19 +140,19 @@ function CompressedData:getFormat() end
---
---The LZ4 compression format. Compresses and decompresses very quickly, but the compression ratio is not the best. LZ4-HC is used when compression level 9 is specified. Some benchmarks are available here.
---
----| '"lz4"'
+---| "lz4"
---
---The zlib format is DEFLATE-compressed data with a small bit of header data. Compresses relatively slowly and decompresses moderately quickly, and has a decent compression ratio.
---
----| '"zlib"'
+---| "zlib"
---
---The gzip format is DEFLATE-compressed data with a slightly larger header than zlib. Since it uses DEFLATE it has the same compression characteristics as the zlib format.
---
----| '"gzip"'
+---| "gzip"
---
---Raw DEFLATE-compressed data (no header).
---
----| '"deflate"'
+---| "deflate"
---
---Return type of various data-returning functions.
@@ -160,11 +161,11 @@ function CompressedData:getFormat() end
---
---Return type is ByteData.
---
----| '"data"'
+---| "data"
---
---Return type is string.
---
----| '"string"'
+---| "string"
---
---Encoding format used to encode or decode data.
@@ -173,11 +174,11 @@ function CompressedData:getFormat() end
---
---Encode/decode data as base64 binary-to-text encoding.
---
----| '"base64"'
+---| "base64"
---
---Encode/decode data as hexadecimal string.
---
----| '"hex"'
+---| "hex"
---
---Hash algorithm of love.data.hash.
@@ -186,24 +187,24 @@ function CompressedData:getFormat() end
---
---MD5 hash algorithm (16 bytes).
---
----| '"md5"'
+---| "md5"
---
---SHA1 hash algorithm (20 bytes).
---
----| '"sha1"'
+---| "sha1"
---
---SHA2 hash algorithm with message digest size of 224 bits (28 bytes).
---
----| '"sha224"'
+---| "sha224"
---
---SHA2 hash algorithm with message digest size of 256 bits (32 bytes).
---
----| '"sha256"'
+---| "sha256"
---
---SHA2 hash algorithm with message digest size of 384 bits (48 bytes).
---
----| '"sha384"'
+---| "sha384"
---
---SHA2 hash algorithm with message digest size of 512 bits (64 bytes).
---
----| '"sha512"'
+---| "sha512"
diff --git a/meta/3rd/love2d/library/love.event.lua b/meta/3rd/love2d/library/love.event.lua
index 44339d88..c43f4bbd 100644
--- a/meta/3rd/love2d/library/love.event.lua
+++ b/meta/3rd/love2d/library/love.event.lua
@@ -40,14 +40,15 @@ function love.event.pump() end
---@param d? any # Fourth event argument.
---@param e? any # Fifth event argument.
---@param f? any # Sixth event argument.
-function love.event.push(n, a, b, c, d, e, f) end
+---@vararg any # Further event arguments may follow.
+function love.event.push(n, a, b, c, d, e, f, ...) end
---
---Adds the quit event to the queue.
---
---The quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback.
---
----@overload fun(restart: string|"'restart'")
+---@overload fun('restart': string|'restart')
---@param exitstatus? number # The program exit status to use when closing the application.
function love.event.quit(exitstatus) end
@@ -72,148 +73,148 @@ function love.event.wait() end
---
---Window focus gained or lost
---
----| '"focus"'
+---| "focus"
---
---Joystick pressed
---
----| '"joystickpressed"'
+---| "joystickpressed"
---
---Joystick released
---
----| '"joystickreleased"'
+---| "joystickreleased"
---
---Key pressed
---
----| '"keypressed"'
+---| "keypressed"
---
---Key released
---
----| '"keyreleased"'
+---| "keyreleased"
---
---Mouse pressed
---
----| '"mousepressed"'
+---| "mousepressed"
---
---Mouse released
---
----| '"mousereleased"'
+---| "mousereleased"
---
---Quit
---
----| '"quit"'
+---| "quit"
---
---Window size changed by the user
---
----| '"resize"'
+---| "resize"
---
---Window is minimized or un-minimized by the user
---
----| '"visible"'
+---| "visible"
---
---Window mouse focus gained or lost
---
----| '"mousefocus"'
+---| "mousefocus"
---
---A Lua error has occurred in a thread
---
----| '"threaderror"'
+---| "threaderror"
---
---Joystick connected
---
----| '"joystickadded"'
+---| "joystickadded"
---
---Joystick disconnected
---
----| '"joystickremoved"'
+---| "joystickremoved"
---
---Joystick axis motion
---
----| '"joystickaxis"'
+---| "joystickaxis"
---
---Joystick hat pressed
---
----| '"joystickhat"'
+---| "joystickhat"
---
---Joystick's virtual gamepad button pressed
---
----| '"gamepadpressed"'
+---| "gamepadpressed"
---
---Joystick's virtual gamepad button released
---
----| '"gamepadreleased"'
+---| "gamepadreleased"
---
---Joystick's virtual gamepad axis moved
---
----| '"gamepadaxis"'
+---| "gamepadaxis"
---
---User entered text
---
----| '"textinput"'
+---| "textinput"
---
---Mouse position changed
---
----| '"mousemoved"'
+---| "mousemoved"
---
---Running out of memory on mobile devices system
---
----| '"lowmemory"'
+---| "lowmemory"
---
---Candidate text for an IME changed
---
----| '"textedited"'
+---| "textedited"
---
---Mouse wheel moved
---
----| '"wheelmoved"'
+---| "wheelmoved"
---
---Touch screen touched
---
----| '"touchpressed"'
+---| "touchpressed"
---
---Touch screen stop touching
---
----| '"touchreleased"'
+---| "touchreleased"
---
---Touch press moved inside touch screen
---
----| '"touchmoved"'
+---| "touchmoved"
---
---Directory is dragged and dropped onto the window
---
----| '"directorydropped"'
+---| "directorydropped"
---
---File is dragged and dropped onto the window.
---
----| '"filedropped"'
+---| "filedropped"
---
---Joystick pressed
---
----| '"jp"'
+---| "jp"
---
---Joystick released
---
----| '"jr"'
+---| "jr"
---
---Key pressed
---
----| '"kp"'
+---| "kp"
---
---Key released
---
----| '"kr"'
+---| "kr"
---
---Mouse pressed
---
----| '"mp"'
+---| "mp"
---
---Mouse released
---
----| '"mr"'
+---| "mr"
---
---Quit
---
----| '"q"'
+---| "q"
---
---Window focus gained or lost
---
----| '"f"'
+---| "f"
diff --git a/meta/3rd/love2d/library/love.filesystem.lua b/meta/3rd/love2d/library/love.filesystem.lua
index 4c4a8f4e..d706793d 100644
--- a/meta/3rd/love2d/library/love.filesystem.lua
+++ b/meta/3rd/love2d/library/love.filesystem.lua
@@ -9,7 +9,7 @@ love.filesystem = {}
---
---Append data to an existing file.
---
----@overload fun(name: string, data: love.Data, size: number):boolean, string
+---@overload fun(name: string, data: love.Data, size?: number):boolean, string
---@param name string # The name (and path) of the file.
---@param data string # The string data to append to the file.
---@param size? number # How many bytes to write.
@@ -167,8 +167,8 @@ function love.filesystem.load(name) end
---
---It is also possible to mount love.filesystem.getSourceBaseDirectory if the game is in fused mode.
---
----@overload fun(filedata: love.FileData, mountpoint: string, appendToPath: boolean):boolean
----@overload fun(data: love.Data, archivename: string, mountpoint: string, appendToPath: boolean):boolean
+---@overload fun(filedata: love.FileData, mountpoint: string, appendToPath?: boolean):boolean
+---@overload fun(data: love.Data, archivename: string, mountpoint: string, appendToPath?: boolean):boolean
---@param archive string # The folder or zip file in the game's save directory to mount.
---@param mountpoint string # The new path the archive will be mounted to.
---@param appendToPath? boolean # Whether the archive will be searched when reading a filepath before or after already-mounted archives. This includes the game's source and save directories.
@@ -198,7 +198,7 @@ function love.filesystem.newFileData(contents, name) end
---
---Read the contents of a file.
---
----@overload fun(container: love.ContainerType, name: string, size: number):love.FileData|string, number, nil, string
+---@overload fun(container: love.ContainerType, name: string, size?: number):love.FileData|string, number, nil, string
---@param name string # The name (and path) of the file.
---@param size? number # How many bytes to read.
---@return string contents # The file contents.
@@ -265,7 +265,7 @@ function love.filesystem.unmount(archive) end
---
---Write data to a file in the save directory. If the file existed already, it will be completely replaced by the new contents.
---
----@overload fun(name: string, data: love.Data, size: number):boolean, string
+---@overload fun(name: string, data: love.Data, size?: number):boolean, string
---@param name string # The name (and path) of the file.
---@param data string # The string data to write to the file.
---@param size? number # How many bytes to write.
@@ -354,7 +354,7 @@ function File:open(mode) end
---
---Read a number of bytes from a file.
---
----@overload fun(self: love.File, container: love.ContainerType, bytes: number):love.FileData|string, number
+---@overload fun(self: love.File, container: love.ContainerType, bytes?: number):love.FileData|string, number
---@param bytes? number # The number of bytes to read.
---@return string contents # The contents of the read bytes.
---@return number size # How many bytes have been read.
@@ -387,7 +387,7 @@ function File:tell() end
---
---Write data to a file.
---
----@overload fun(self: love.File, data: love.Data, size: number):boolean, string
+---@overload fun(self: love.File, data: love.Data, size?: number):boolean, string
---@param data string # The string data to write.
---@param size? number # How many bytes to write.
---@return boolean success # Whether the operation was successful.
@@ -419,15 +419,15 @@ function FileData:getFilename() end
---
---No buffering. The result of write and append operations appears immediately.
---
----| '"none"'
+---| "none"
---
---Line buffering. Write and append operations are buffered until a newline is output or the buffer size limit is reached.
---
----| '"line"'
+---| "line"
---
---Full buffering. Write and append operations are always buffered until the buffer size limit is reached.
---
----| '"full"'
+---| "full"
---
---How to decode a given FileData.
@@ -436,11 +436,11 @@ function FileData:getFilename() end
---
---The data is unencoded.
---
----| '"file"'
+---| "file"
---
---The data is base64-encoded.
---
----| '"base64"'
+---| "base64"
---
---The different modes you can open a File in.
@@ -449,19 +449,19 @@ function FileData:getFilename() end
---
---Open a file for read.
---
----| '"r"'
+---| "r"
---
---Open a file for write.
---
----| '"w"'
+---| "w"
---
---Open a file for append.
---
----| '"a"'
+---| "a"
---
---Do not open a file (represents a closed file.)
---
----| '"c"'
+---| "c"
---
---The type of a file.
@@ -470,16 +470,16 @@ function FileData:getFilename() end
---
---Regular file.
---
----| '"file"'
+---| "file"
---
---Directory.
---
----| '"directory"'
+---| "directory"
---
---Symbolic link.
---
----| '"symlink"'
+---| "symlink"
---
---Something completely different like a device.
---
----| '"other"'
+---| "other"
diff --git a/meta/3rd/love2d/library/love.font.lua b/meta/3rd/love2d/library/love.font.lua
index 3d2e31a6..e7977b8c 100644
--- a/meta/3rd/love2d/library/love.font.lua
+++ b/meta/3rd/love2d/library/love.font.lua
@@ -9,7 +9,7 @@ love.font = {}
---
---Creates a new BMFont Rasterizer.
---
----@overload fun(fileName: string, glyphs: string, dpiscale: number):love.Rasterizer
+---@overload fun(fileName: string, glyphs: string, dpiscale?: number):love.Rasterizer
---@param imageData love.ImageData # The image data containing the drawable pictures of font glyphs.
---@param glyphs string # The sequence of glyphs in the ImageData.
---@param dpiscale? number # DPI scale.
@@ -37,11 +37,11 @@ function love.font.newImageRasterizer(imageData, glyphs, extraSpacing, dpiscale)
---Creates a new Rasterizer.
---
---@overload fun(data: love.FileData):love.Rasterizer
----@overload fun(size: number, hinting: love.HintingMode, dpiscale: number):love.Rasterizer
----@overload fun(fileName: string, size: number, hinting: love.HintingMode, dpiscale: number):love.Rasterizer
----@overload fun(fileData: love.FileData, size: number, hinting: love.HintingMode, dpiscale: number):love.Rasterizer
----@overload fun(imageData: love.ImageData, glyphs: string, dpiscale: number):love.Rasterizer
----@overload fun(fileName: string, glyphs: string, dpiscale: number):love.Rasterizer
+---@overload fun(size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
+---@overload fun(fileName: string, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
+---@overload fun(fileData: love.FileData, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
+---@overload fun(imageData: love.ImageData, glyphs: string, dpiscale?: number):love.Rasterizer
+---@overload fun(fileName: string, glyphs: string, dpiscale?: number):love.Rasterizer
---@param filename string # The font file.
---@return love.Rasterizer rasterizer # The rasterizer.
function love.font.newRasterizer(filename) end
@@ -49,8 +49,8 @@ function love.font.newRasterizer(filename) end
---
---Creates a new TrueType Rasterizer.
---
----@overload fun(fileName: string, size: number, hinting: love.HintingMode, dpiscale: number):love.Rasterizer
----@overload fun(fileData: love.FileData, size: number, hinting: love.HintingMode, dpiscale: number):love.Rasterizer
+---@overload fun(fileName: string, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
+---@overload fun(fileData: love.FileData, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
---@param size? number # The font size.
---@param hinting? love.HintingMode # True Type hinting mode.
---@param dpiscale? number # The font DPI scale.
@@ -177,8 +177,9 @@ function Rasterizer:getLineHeight() end
---
---@param glyph1 string|number # Glyph
---@param glyph2 string|number # Glyph
+---@vararg string|number # Additional glyphs
---@return boolean hasGlyphs # Whatever font contains specified glyphs.
-function Rasterizer:hasGlyphs(glyph1, glyph2) end
+function Rasterizer:hasGlyphs(glyph1, glyph2, ...) end
---
---True Type hinting mode.
@@ -187,16 +188,16 @@ function Rasterizer:hasGlyphs(glyph1, glyph2) end
---
---Default hinting. Should be preferred for typical antialiased fonts.
---
----| '"normal"'
+---| "normal"
---
---Results in fuzzier text but can sometimes preserve the original glyph shapes of the text better than normal hinting.
---
----| '"light"'
+---| "light"
---
---Results in aliased / unsmoothed text with either full opacity or completely transparent pixels. Should be used when antialiasing is not desired for the font.
---
----| '"mono"'
+---| "mono"
---
---Disables hinting for the font. Results in fuzzier text.
---
----| '"none"'
+---| "none"
diff --git a/meta/3rd/love2d/library/love.graphics.lua b/meta/3rd/love2d/library/love.graphics.lua
index 056cfef1..d6adf2e4 100644
--- a/meta/3rd/love2d/library/love.graphics.lua
+++ b/meta/3rd/love2d/library/love.graphics.lua
@@ -23,7 +23,7 @@ function love.graphics.applyTransform(transform) end
---
---Draws a filled or unfilled arc at position (x, y). The arc is drawn from angle1 to angle2 in radians. The segments parameter determines how many segments are used to draw the arc. The more segments, the smoother the edge.
---
----@overload fun(drawmode: love.DrawMode, arctype: love.ArcType, x: number, y: number, radius: number, angle1: number, angle2: number, segments: number)
+---@overload fun(drawmode: love.DrawMode, arctype: love.ArcType, x: number, y: number, radius: number, angle1: number, angle2: number, segments?: number)
---@param drawmode love.DrawMode # How to draw the arc.
---@param x number # The position of the center along x-axis.
---@param y number # The position of the center along y-axis.
@@ -64,8 +64,8 @@ function love.graphics.circle(mode, x, y, radius) end
---
---In versions prior to background color instead.
---
----@overload fun(r: number, g: number, b: number, a: number, clearstencil: boolean, cleardepth: boolean)
----@overload fun(color: table, ..., clearstencil: boolean, cleardepth: boolean)
+---@overload fun(r: number, g: number, b: number, a?: number, clearstencil?: boolean, cleardepth?: boolean)
+---@overload fun(color: table, ..., clearstencil?: boolean, cleardepth?: boolean)
---@overload fun(clearcolor: boolean, clearstencil: boolean, cleardepth: boolean)
function love.graphics.clear() end
@@ -76,7 +76,7 @@ function love.graphics.clear() end
---
---On some desktop systems this function may do nothing.
---
----@overload fun(discardcolors: table, discardstencil: boolean)
+---@overload fun(discardcolors: table, discardstencil?: boolean)
---@param discardcolor? boolean # Whether to discard the texture(s) of the active Canvas(es) (the contents of the screen if no Canvas is active.)
---@param discardstencil? boolean # Whether to discard the contents of the stencil buffer of the screen / active Canvas.
function love.graphics.discard(discardcolor, discardstencil) end
@@ -96,7 +96,7 @@ function love.graphics.discard(discardcolor, discardstencil) end
---
---Set it to pure white to preserve the object's original colors.
---
----@overload fun(texture: love.Texture, quad: love.Quad, x: number, y: number, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
+---@overload fun(texture: love.Texture, quad: love.Quad, x: number, y: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(drawable: love.Drawable, transform: love.Transform)
---@overload fun(texture: love.Texture, quad: love.Quad, transform: love.Transform)
---@param drawable love.Drawable # A drawable object.
@@ -135,7 +135,7 @@ function love.graphics.drawInstanced(mesh, instancecount, x, y, r, sx, sy, ox, o
---
---Draws a layer of an Array Texture.
---
----@overload fun(texture: love.Texture, layerindex: number, quad: love.Quad, x: number, y: number, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
+---@overload fun(texture: love.Texture, layerindex: number, quad: love.Quad, x?: number, y?: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(texture: love.Texture, layerindex: number, transform: love.Transform)
---@overload fun(texture: love.Texture, layerindex: number, quad: love.Quad, transform: love.Transform)
---@param texture love.Texture # The Array Texture to draw.
@@ -474,7 +474,8 @@ function love.graphics.isWireframe() end
---@param y1 number # The position of first point on the y-axis.
---@param x2 number # The position of second point on the x-axis.
---@param y2 number # The position of second point on the y-axis.
-function love.graphics.line(x1, y1, x2, y2) end
+---@vararg number # You can continue passing point positions to draw a polyline.
+function love.graphics.line(x1, y1, x2, y2, ...) end
---
---Creates a new array Image.
@@ -544,7 +545,7 @@ function love.graphics.newCanvas() end
---
---+x -x +y -y +z -z
---
----@overload fun(faces: table, settings: table):love.Image
+---@overload fun(faces: table, settings?: table):love.Image
---@param filename string # The filepath to a cubemap image file (or a File, FileData, or ImageData).
---@param settings? {mipmaps: boolean, linear: boolean} # Optional table of settings to configure the cubemap image, containing the following fields:
---@return love.Image image # An cubemap Image object.
@@ -555,9 +556,9 @@ function love.graphics.newCubeImage(filename, settings) end
---
---All variants which accept a filename can also accept a Data object instead.
---
----@overload fun(filename: string, size: number, hinting: love.HintingMode, dpiscale: number):love.Font
+---@overload fun(filename: string, size: number, hinting?: love.HintingMode, dpiscale?: number):love.Font
---@overload fun(filename: string, imagefilename: string):love.Font
----@overload fun(size: number, hinting: love.HintingMode, dpiscale: number):love.Font
+---@overload fun(size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Font
---@param filename string # The filepath to the BMFont or TrueType font file.
---@return love.Font font # A Font object which can be used to draw text on screen.
function love.graphics.newFont(filename) end
@@ -565,11 +566,11 @@ function love.graphics.newFont(filename) end
---
---Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image.
---
----@overload fun(fileData: love.FileData, flags: table):love.Image
----@overload fun(imageData: love.ImageData, flags: table):love.Image
----@overload fun(compressedImageData: love.CompressedImageData, flags: table):love.Image
+---@overload fun(fileData: love.FileData, flags?: table):love.Image
+---@overload fun(imageData: love.ImageData, flags?: table):love.Image
+---@overload fun(compressedImageData: love.CompressedImageData, flags?: table):love.Image
---@param filename string # The filepath to the image file.
----@param flags {dpiscale: number, linear: boolean, mipmaps: boolean} # A table containing the following fields:
+---@param flags? {dpiscale: number, linear: boolean, mipmaps: boolean} # A table containing the following fields:
---@return love.Image image # A new Image object which can be drawn on screen.
function love.graphics.newImage(filename, flags) end
@@ -592,10 +593,10 @@ function love.graphics.newImageFont(filename, glyphs) end
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
----@overload fun(vertexcount: number, mode: love.MeshDrawMode, usage: love.SpriteBatchUsage):love.Mesh
----@overload fun(vertexformat: table, vertices: table, mode: love.MeshDrawMode, usage: love.SpriteBatchUsage):love.Mesh
----@overload fun(vertexformat: table, vertexcount: number, mode: love.MeshDrawMode, usage: love.SpriteBatchUsage):love.Mesh
----@overload fun(vertexcount: number, texture: love.Texture, mode: love.MeshDrawMode):love.Mesh
+---@overload fun(vertexcount: number, mode?: love.MeshDrawMode, usage?: love.SpriteBatchUsage):love.Mesh
+---@overload fun(vertexformat: table, vertices: table, mode?: love.MeshDrawMode, usage?: love.SpriteBatchUsage):love.Mesh
+---@overload fun(vertexformat: table, vertexcount: number, mode?: love.MeshDrawMode, usage?: love.SpriteBatchUsage):love.Mesh
+---@overload fun(vertexcount: number, texture?: love.Texture, mode?: love.MeshDrawMode):love.Mesh
---@param vertices {["1"]: number, ["2"]: number, ["3"]: number, ["4"]: number, ["5"]: number, ["6"]: number, ["7"]: number, ["8"]: number} # The table filled with vertex information tables for each vertex as follows:
---@param mode? love.MeshDrawMode # How the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons.
---@param usage? love.SpriteBatchUsage # The expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance.
@@ -605,7 +606,7 @@ function love.graphics.newMesh(vertices, mode, usage) end
---
---Creates a new ParticleSystem.
---
----@overload fun(texture: love.Texture, buffer: number):love.ParticleSystem
+---@overload fun(texture: love.Texture, buffer?: number):love.ParticleSystem
---@param image love.Image # The image to use.
---@param buffer? number # The max number of particles at the same time.
---@return love.ParticleSystem system # A new ParticleSystem.
@@ -638,8 +639,8 @@ function love.graphics.newShader(code) end
---
---Creates a new SpriteBatch object.
---
----@overload fun(image: love.Image, maxsprites: number, usage: love.SpriteBatchUsage):love.SpriteBatch
----@overload fun(texture: love.Texture, maxsprites: number, usage: love.SpriteBatchUsage):love.SpriteBatch
+---@overload fun(image: love.Image, maxsprites?: number, usage?: love.SpriteBatchUsage):love.SpriteBatch
+---@overload fun(texture: love.Texture, maxsprites?: number, usage?: love.SpriteBatchUsage):love.SpriteBatch
---@param image love.Image # The Image to use for the sprites.
---@param maxsprites? number # The maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.
---@return love.SpriteBatch spriteBatch # The new SpriteBatch.
@@ -657,9 +658,9 @@ function love.graphics.newText(font, textstring) end
---Creates a new drawable Video. Currently only Ogg Theora video files are supported.
---
---@overload fun(videostream: love.VideoStream):love.Video
----@overload fun(filename: string, settings: table):love.Video
----@overload fun(filename: string, loadaudio: boolean):love.Video
----@overload fun(videostream: love.VideoStream, loadaudio: boolean):love.Video
+---@overload fun(filename: string, settings?: table):love.Video
+---@overload fun(filename: string, loadaudio?: boolean):love.Video
+---@overload fun(videostream: love.VideoStream, loadaudio?: boolean):love.Video
---@param filename string # The file path to the Ogg Theora video file.
---@return love.Video video # A new Video.
function love.graphics.newVideo(filename) end
@@ -694,7 +695,8 @@ function love.graphics.origin() end
---@overload fun(points: table)
---@param x number # The position of the first point on the x-axis.
---@param y number # The position of the first point on the y-axis.
-function love.graphics.points(x, y) end
+---@vararg number # The x and y coordinates of additional points.
+function love.graphics.points(x, y, ...) end
---
---Draw a polygon.
@@ -703,7 +705,8 @@ function love.graphics.points(x, y) end
---
---@overload fun(mode: love.DrawMode, vertices: table)
---@param mode love.DrawMode # How to draw the polygon.
-function love.graphics.polygon(mode) end
+---@vararg number # The vertices of the polygon.
+function love.graphics.polygon(mode, ...) end
---
---Pops the current coordinate transformation from the transformation stack.
@@ -730,7 +733,7 @@ function love.graphics.present() end
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
----@overload fun(coloredtext: table, x: number, y: number, angle: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
+---@overload fun(coloredtext: table, x?: number, y?: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(text: string, transform: love.Transform)
---@overload fun(coloredtext: table, transform: love.Transform)
---@overload fun(text: string, font: love.Font, transform: love.Transform)
@@ -758,13 +761,13 @@ function love.graphics.print(text, x, y, r, sx, sy, ox, oy, kx, ky) end
---
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
----@overload fun(text: string, font: love.Font, x: number, y: number, limit: number, align: love.AlignMode, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
----@overload fun(text: string, transform: love.Transform, limit: number, align: love.AlignMode)
----@overload fun(text: string, font: love.Font, transform: love.Transform, limit: number, align: love.AlignMode)
----@overload fun(coloredtext: table, x: number, y: number, limit: number, align: love.AlignMode, angle: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
----@overload fun(coloredtext: table, font: love.Font, x: number, y: number, limit: number, align: love.AlignMode, angle: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
----@overload fun(coloredtext: table, transform: love.Transform, limit: number, align: love.AlignMode)
----@overload fun(coloredtext: table, font: love.Font, transform: love.Transform, limit: number, align: love.AlignMode)
+---@overload fun(text: string, font: love.Font, x: number, y: number, limit: number, align?: love.AlignMode, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
+---@overload fun(text: string, transform: love.Transform, limit: number, align?: love.AlignMode)
+---@overload fun(text: string, font: love.Font, transform: love.Transform, limit: number, align?: love.AlignMode)
+---@overload fun(coloredtext: table, x: number, y: number, limit: number, align: love.AlignMode, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
+---@overload fun(coloredtext: table, font: love.Font, x: number, y: number, limit: number, align?: love.AlignMode, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
+---@overload fun(coloredtext: table, transform: love.Transform, limit: number, align?: love.AlignMode)
+---@overload fun(coloredtext: table, font: love.Font, transform: love.Transform, limit: number, align?: love.AlignMode)
---@param text string # A text string.
---@param x number # The position on the x-axis.
---@param y number # The position on the y-axis.
@@ -790,7 +793,7 @@ function love.graphics.push() end
---
---Draws a rectangle.
---
----@overload fun(mode: love.DrawMode, x: number, y: number, width: number, height: number, rx: number, ry: number, segments: number)
+---@overload fun(mode: love.DrawMode, x: number, y: number, width: number, height: number, rx: number, ry?: number, segments?: number)
---@param mode love.DrawMode # How to draw the rectangle.
---@param x number # The position of top-left corner along the x-axis.
---@param y number # The position of top-left corner along the y-axis.
@@ -848,7 +851,7 @@ function love.graphics.setBackgroundColor(red, green, blue, alpha) end
---
---Sets the blending mode.
---
----@overload fun(mode: love.BlendMode, alphamode: love.BlendAlphaMode)
+---@overload fun(mode: love.BlendMode, alphamode?: love.BlendAlphaMode)
---@param mode love.BlendMode # The blend mode to use.
function love.graphics.setBlendMode(mode) end
@@ -857,7 +860,7 @@ function love.graphics.setBlendMode(mode) end
---
---@overload fun()
---@overload fun(canvas1: love.Canvas, canvas2: love.Canvas, ...)
----@overload fun(canvas: love.Canvas, slice: number, mipmap: number)
+---@overload fun(canvas: love.Canvas, slice: number, mipmap?: number)
---@overload fun(setup: table)
---@param canvas love.Canvas # The new target.
---@param mipmap? number # The mipmap level to render to, for Canvases with mipmaps.
@@ -950,9 +953,9 @@ function love.graphics.setMeshCullMode(mode) end
---
---Creates and sets a new Font.
---
----@overload fun(filename: string, size: number):love.Font
----@overload fun(file: love.File, size: number):love.Font
----@overload fun(data: love.Data, size: number):love.Font
+---@overload fun(filename: string, size?: number):love.Font
+---@overload fun(file: love.File, size?: number):love.Font
+---@overload fun(data: love.Data, size?: number):love.Font
---@overload fun(rasterizer: love.Rasterizer):love.Font
---@param size? number # The size of the font.
---@return love.Font font # The new font.
@@ -1093,7 +1096,7 @@ function Canvas:getMipmapMode() end
---
---Generates ImageData from the contents of the Canvas.
---
----@overload fun(self: love.Canvas, slice: number, mipmap: number, x: number, y: number, width: number, height: number):love.ImageData
+---@overload fun(self: love.Canvas, slice: number, mipmap?: number, x: number, y: number, width: number, height: number):love.ImageData
---@return love.ImageData data # The new ImageData made from the Canvas' contents.
function Canvas:newImageData() end
@@ -1227,7 +1230,8 @@ function Font:hasGlyphs(text) end
---Sets the fallback fonts. When the Font doesn't contain a glyph, it will substitute the glyph from the next subsequent fallback Fonts. This is akin to setting a 'font stack' in Cascading Style Sheets (CSS).
---
---@param fallbackfont1 love.Font # The first fallback Font to use.
-function Font:setFallbacks(fallbackfont1) end
+---@vararg love.Font # Additional fallback Fonts.
+function Font:setFallbacks(fallbackfont1, ...) end
---
---Sets the filter mode for a font.
@@ -1285,7 +1289,7 @@ local Mesh = {}
---
---Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.
---
----@overload fun(self: love.Mesh, name: string, mesh: love.Mesh, step: love.VertexAttributeStep, attachname: string)
+---@overload fun(self: love.Mesh, name: string, mesh: love.Mesh, step?: love.VertexAttributeStep, attachname?: string)
---@param name string # The name of the vertex attribute to attach.
---@param mesh love.Mesh # The Mesh to get the vertex attribute from.
function Mesh:attachAttribute(name, mesh) end
@@ -1398,11 +1402,12 @@ function Mesh:setTexture(texture) end
---In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
---
---@overload fun(self: love.Mesh, index: number, vertex: table)
----@overload fun(self: love.Mesh, index: number, x: number, y: number, u: number, v: number, r: number, g: number, b: number, a: number)
+---@overload fun(self: love.Mesh, index: number, x: number, y: number, u: number, v: number, r?: number, g?: number, b?: number, a?: number)
---@overload fun(self: love.Mesh, index: number, vertex: table)
---@param index number # The index of the the vertex you want to modify (one-based).
---@param attributecomponent number # The first component of the first vertex attribute in the specified vertex.
-function Mesh:setVertex(index, attributecomponent) end
+---@vararg number # Additional components of all vertex attributes in the specified vertex.
+function Mesh:setVertex(index, attributecomponent, ...) end
---
---Sets the properties of a specific attribute within a vertex in the Mesh.
@@ -1413,7 +1418,8 @@ function Mesh:setVertex(index, attributecomponent) end
---@param attributeindex number # The index of the attribute within the vertex to be modified (one-based).
---@param value1 number # The new value for the first component of the attribute.
---@param value2 number # The new value for the second component of the attribute.
-function Mesh:setVertexAttribute(vertexindex, attributeindex, value1, value2) end
+---@vararg number # Any additional vertex attribute components.
+function Mesh:setVertexAttribute(vertexindex, attributeindex, value1, value2, ...) end
---
---Sets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.
@@ -1428,7 +1434,7 @@ function Mesh:setVertexMap(map) end
---
---Replaces a range of vertices in the Mesh with new ones. The total number of vertices in a Mesh cannot be changed after it has been created. This is often more efficient than calling Mesh:setVertex in a loop.
---
----@overload fun(self: love.Mesh, data: love.Data, startvertex: number)
+---@overload fun(self: love.Mesh, data: love.Data, startvertex?: number)
---@overload fun(self: love.Mesh, vertices: table)
---@param vertices {attributecomponent: number} # The table filled with vertex information tables for each vertex, in the form of {vertex, ...} where each vertex is a table in the form of {attributecomponent, ...}.
---@param startvertex? number # The index of the first vertex to replace.
@@ -1960,12 +1966,13 @@ function Shader:hasUniform(name) end
---@overload fun(self: love.Shader, name: string, texture: love.Texture)
---@overload fun(self: love.Shader, name: string, boolean: boolean, ...)
---@overload fun(self: love.Shader, name: string, matrixlayout: love.MatrixLayout, matrix: table, ...)
----@overload fun(self: love.Shader, name: string, data: love.Data, offset: number, size: number)
----@overload fun(self: love.Shader, name: string, data: love.Data, matrixlayout: love.MatrixLayout, offset: number, size: number)
----@overload fun(self: love.Shader, name: string, matrixlayout: love.MatrixLayout, data: love.Data, offset: number, size: number)
+---@overload fun(self: love.Shader, name: string, data: love.Data, offset?: number, size?: number)
+---@overload fun(self: love.Shader, name: string, data: love.Data, matrixlayout: love.MatrixLayout, offset?: number, size?: number)
+---@overload fun(self: love.Shader, name: string, matrixlayout: love.MatrixLayout, data: love.Data, offset?: number, size?: number)
---@param name string # Name of the number to send to the shader.
---@param number number # Number to send to store in the uniform variable.
-function Shader:send(name, number) end
+---@vararg number # Additional numbers to send if the uniform variable is an array.
+function Shader:send(name, number, ...) end
---
---Sends one or more colors to a special (''extern'' / ''uniform'') vec3 or vec4 variable inside the shader. The color components must be in the range of 1. The colors are gamma-corrected if global gamma-correction is enabled.
@@ -1984,7 +1991,8 @@ function Shader:send(name, number) end
---
---@param name string # The name of the color extern variable to send to in the shader.
---@param color table # A table with red, green, blue, and optional alpha color components in the range of 1 to send to the extern as a vector.
-function Shader:sendColor(name, color) end
+---@vararg table # Additional colors to send in case the extern is an array. All colors need to be of the same size (e.g. only vec3's).
+function Shader:sendColor(name, color, ...) end
---
---Using a single image, draw any number of identical copies of the image using a single call to love.graphics.draw(). This can be used, for example, to draw repeating copies of a single background image with high performance.
@@ -1997,7 +2005,7 @@ local SpriteBatch = {}
---
---Adds a sprite to the batch. Sprites are drawn in the order they are added.
---
----@overload fun(self: love.SpriteBatch, quad: love.Quad, x: number, y: number, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number):number
+---@overload fun(self: love.SpriteBatch, quad: love.Quad, x: number, y: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@param x number # The position to draw the object (x-axis).
---@param y number # The position to draw the object (y-axis).
---@param r? number # Orientation (radians).
@@ -2013,7 +2021,7 @@ function SpriteBatch:add(x, y, r, sx, sy, ox, oy, kx, ky) end
---
---Adds a sprite to a batch created with an Array Texture.
---
----@overload fun(self: love.SpriteBatch, layerindex: number, quad: love.Quad, x: number, y: number, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number):number
+---@overload fun(self: love.SpriteBatch, layerindex: number, quad: love.Quad, x?: number, y?: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@overload fun(self: love.SpriteBatch, layerindex: number, transform: love.Transform):number
---@overload fun(self: love.SpriteBatch, layerindex: number, quad: love.Quad, transform: love.Transform):number
---@param layerindex number # The index of the layer to use for this sprite.
@@ -2086,7 +2094,7 @@ function SpriteBatch:getTexture() end
---
---Changes a sprite in the batch. This requires the sprite index returned by SpriteBatch:add or SpriteBatch:addLayer.
---
----@overload fun(self: love.SpriteBatch, spriteindex: number, quad: love.Quad, x: number, y: number, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
+---@overload fun(self: love.SpriteBatch, spriteindex: number, quad: love.Quad, x: number, y: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@param spriteindex number # The index of the sprite that will be changed.
---@param x number # The position to draw the object (x-axis).
---@param y number # The position to draw the object (y-axis).
@@ -2124,7 +2132,7 @@ function SpriteBatch:setDrawRange(start, count) end
---
---Changes a sprite previously added with add or addLayer, in a batch created with an Array Texture.
---
----@overload fun(self: love.SpriteBatch, spriteindex: number, layerindex: number, quad: love.Quad, x: number, y: number, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number)
+---@overload fun(self: love.SpriteBatch, spriteindex: number, layerindex: number, quad: love.Quad, x?: number, y?: number, r?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number)
---@overload fun(self: love.SpriteBatch, spriteindex: number, layerindex: number, transform: love.Transform)
---@overload fun(self: love.SpriteBatch, spriteindex: number, layerindex: number, quad: love.Quad, transform: love.Transform)
---@param spriteindex number # The index of the existing sprite to replace.
@@ -2155,7 +2163,7 @@ local Text = {}
---
---Adds additional colored text to the Text object at the specified position.
---
----@overload fun(self: love.Text, coloredtext: table, x: number, y: number, angle: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number):number
+---@overload fun(self: love.Text, coloredtext: table, x?: number, y?: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@param textstring string # The text to add to the object.
---@param x? number # The position of the new text on the x-axis.
---@param y? number # The position of the new text on the y-axis.
@@ -2174,7 +2182,7 @@ function Text:add(textstring, x, y, angle, sx, sy, ox, oy, kx, ky) end
---
---The word wrap limit is applied before any scaling, rotation, and other coordinate transformations. Therefore the amount of text per line stays constant given the same wrap limit, even if the scale arguments change.
---
----@overload fun(self: love.Text, coloredtext: table, wraplimit: number, align: love.AlignMode, x: number, y: number, angle: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number):number
+---@overload fun(self: love.Text, coloredtext: table, wraplimit: number, align: love.AlignMode, x: number, y: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):number
---@param textstring string # The text to add to the object.
---@param wraplimit number # The maximum width in pixels of the text before it gets automatically wrapped to a new line.
---@param align love.AlignMode # The alignment of the text.
@@ -2521,19 +2529,19 @@ function Video:tell() end
---
---Align text center.
---
----| '"center"'
+---| "center"
---
---Align text left.
---
----| '"left"'
+---| "left"
---
---Align text right.
---
----| '"right"'
+---| "right"
---
---Align text both left and right.
---
----| '"justify"'
+---| "justify"
---
---Different types of arcs that can be drawn.
@@ -2542,15 +2550,15 @@ function Video:tell() end
---
---The arc is drawn like a slice of pie, with the arc circle connected to the center at its end-points.
---
----| '"pie"'
+---| "pie"
---
---The arc circle's two end-points are unconnected when the arc is drawn as a line. Behaves like the "closed" arc type when the arc is drawn in filled mode.
---
----| '"open"'
+---| "open"
---
---The arc circle's two end-points are connected to each other.
---
----| '"closed"'
+---| "closed"
---
---Types of particle area spread distribution.
@@ -2559,27 +2567,27 @@ function Video:tell() end
---
---Uniform distribution.
---
----| '"uniform"'
+---| "uniform"
---
---Normal (gaussian) distribution.
---
----| '"normal"'
+---| "normal"
---
---Uniform distribution in an ellipse.
---
----| '"ellipse"'
+---| "ellipse"
---
---Distribution in an ellipse with particles spawning at the edges of the ellipse.
---
----| '"borderellipse"'
+---| "borderellipse"
---
---Distribution in a rectangle with particles spawning at the edges of the rectangle.
---
----| '"borderrectangle"'
+---| "borderrectangle"
---
---No distribution - area spread is disabled.
---
----| '"none"'
+---| "none"
---
---Different ways alpha affects color blending. See BlendMode and the BlendMode Formulas for additional notes.
@@ -2588,11 +2596,11 @@ function Video:tell() end
---
---The RGB values of what's drawn are multiplied by the alpha values of those colors during blending. This is the default alpha mode.
---
----| '"alphamultiply"'
+---| "alphamultiply"
---
---The RGB values of what's drawn are '''not''' multiplied by the alpha values of those colors during blending. For most blend modes to work correctly with this alpha mode, the colors of a drawn object need to have had their RGB values multiplied by their alpha values at some point previously ("premultiplied alpha").
---
----| '"premultiplied"'
+---| "premultiplied"
---
---Different ways to do color blending. See BlendAlphaMode and the BlendMode Formulas for additional notes.
@@ -2601,51 +2609,51 @@ function Video:tell() end
---
---Alpha blending (normal). The alpha of what's drawn determines its opacity.
---
----| '"alpha"'
+---| "alpha"
---
---The colors of what's drawn completely replace what was on the screen, with no additional blending. The BlendAlphaMode specified in love.graphics.setBlendMode still affects what happens.
---
----| '"replace"'
+---| "replace"
---
---'Screen' blending.
---
----| '"screen"'
+---| "screen"
---
---The pixel colors of what's drawn are added to the pixel colors already on the screen. The alpha of the screen is not modified.
---
----| '"add"'
+---| "add"
---
---The pixel colors of what's drawn are subtracted from the pixel colors already on the screen. The alpha of the screen is not modified.
---
----| '"subtract"'
+---| "subtract"
---
---The pixel colors of what's drawn are multiplied with the pixel colors already on the screen (darkening them). The alpha of drawn objects is multiplied with the alpha of the screen rather than determining how much the colors on the screen are affected, even when the "alphamultiply" BlendAlphaMode is used.
---
----| '"multiply"'
+---| "multiply"
---
---The pixel colors of what's drawn are compared to the existing pixel colors, and the larger of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode.
---
----| '"lighten"'
+---| "lighten"
---
---The pixel colors of what's drawn are compared to the existing pixel colors, and the smaller of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode.
---
----| '"darken"'
+---| "darken"
---
---Additive blend mode.
---
----| '"additive"'
+---| "additive"
---
---Subtractive blend mode.
---
----| '"subtractive"'
+---| "subtractive"
---
---Multiply blend mode.
---
----| '"multiplicative"'
+---| "multiplicative"
---
---Premultiplied alpha blend mode.
---
----| '"premultiplied"'
+---| "premultiplied"
---
---Different types of per-pixel stencil test and depth test comparisons. The pixels of an object will be drawn if the comparison succeeds, for each pixel that the object touches.
@@ -2655,40 +2663,40 @@ function Video:tell() end
---* stencil tests: the stencil value of the pixel must be equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be equal to the existing depth value of that pixel.
---
----| '"equal"'
+---| "equal"
---
---* stencil tests: the stencil value of the pixel must not be equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must not be equal to the existing depth value of that pixel.
---
----| '"notequal"'
+---| "notequal"
---
---* stencil tests: the stencil value of the pixel must be less than the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be less than the existing depth value of that pixel.
---
----| '"less"'
+---| "less"
---
---* stencil tests: the stencil value of the pixel must be less than or equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be less than or equal to the existing depth value of that pixel.
---
----| '"lequal"'
+---| "lequal"
---
---* stencil tests: the stencil value of the pixel must be greater than or equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be greater than or equal to the existing depth value of that pixel.
---
----| '"gequal"'
+---| "gequal"
---
---* stencil tests: the stencil value of the pixel must be greater than the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be greater than the existing depth value of that pixel.
---
----| '"greater"'
+---| "greater"
---
---Objects will never be drawn.
---
----| '"never"'
+---| "never"
---
---Objects will always be drawn. Effectively disables the depth or stencil test.
---
----| '"always"'
+---| "always"
---
---How Mesh geometry is culled when rendering.
@@ -2697,15 +2705,15 @@ function Video:tell() end
---
---Back-facing triangles in Meshes are culled (not rendered). The vertex order of a triangle determines whether it is back- or front-facing.
---
----| '"back"'
+---| "back"
---
---Front-facing triangles in Meshes are culled.
---
----| '"front"'
+---| "front"
---
---Both back- and front-facing triangles in Meshes are rendered.
---
----| '"none"'
+---| "none"
---
---Controls whether shapes are drawn as an outline, or filled.
@@ -2714,11 +2722,11 @@ function Video:tell() end
---
---Draw filled shape.
---
----| '"fill"'
+---| "fill"
---
---Draw outlined shape.
---
----| '"line"'
+---| "line"
---
---How the image is filtered when scaling.
@@ -2727,11 +2735,11 @@ function Video:tell() end
---
---Scale image with linear interpolation.
---
----| '"linear"'
+---| "linear"
---
---Scale image with nearest neighbor interpolation.
---
----| '"nearest"'
+---| "nearest"
---
---Graphics features that can be checked for with love.graphics.getSupported.
@@ -2740,35 +2748,35 @@ function Video:tell() end
---
---Whether the "clampzero" WrapMode is supported.
---
----| '"clampzero"'
+---| "clampzero"
---
---Whether the "lighten" and "darken" BlendModes are supported.
---
----| '"lighten"'
+---| "lighten"
---
---Whether multiple formats can be used in the same love.graphics.setCanvas call.
---
----| '"multicanvasformats"'
+---| "multicanvasformats"
---
---Whether GLSL 3 Shaders can be used.
---
----| '"glsl3"'
+---| "glsl3"
---
---Whether mesh instancing is supported.
---
----| '"instancing"'
+---| "instancing"
---
---Whether textures with non-power-of-two dimensions can use mipmapping and the 'repeat' WrapMode.
---
----| '"fullnpot"'
+---| "fullnpot"
---
---Whether pixel shaders can use "highp" 32 bit floating point numbers (as opposed to just 16 bit or lower precision).
---
----| '"pixelshaderhighp"'
+---| "pixelshaderhighp"
---
---Whether shaders can use the dFdx, dFdy, and fwidth functions for computing derivatives.
---
----| '"shaderderivatives"'
+---| "shaderderivatives"
---
---Types of system-dependent graphics limits checked for using love.graphics.getSystemLimits.
@@ -2777,35 +2785,35 @@ function Video:tell() end
---
---The maximum size of points.
---
----| '"pointsize"'
+---| "pointsize"
---
---The maximum width or height of Images and Canvases.
---
----| '"texturesize"'
+---| "texturesize"
---
---The maximum number of simultaneously active canvases (via love.graphics.setCanvas.)
---
----| '"multicanvas"'
+---| "multicanvas"
---
---The maximum number of antialiasing samples for a Canvas.
---
----| '"canvasmsaa"'
+---| "canvasmsaa"
---
---The maximum number of layers in an Array texture.
---
----| '"texturelayers"'
+---| "texturelayers"
---
---The maximum width, height, or depth of a Volume texture.
---
----| '"volumetexturesize"'
+---| "volumetexturesize"
---
---The maximum width or height of a Cubemap texture.
---
----| '"cubetexturesize"'
+---| "cubetexturesize"
---
---The maximum amount of anisotropic filtering. Texture:setMipmapFilter internally clamps the given anisotropy value to the system's limit.
---
----| '"anisotropy"'
+---| "anisotropy"
---
---Vertex map datatype for Data variant of Mesh:setVertexMap.
@@ -2814,11 +2822,11 @@ function Video:tell() end
---
---The vertex map is array of unsigned word (16-bit).
---
----| '"uint16"'
+---| "uint16"
---
---The vertex map is array of unsigned dword (32-bit).
---
----| '"uint32"'
+---| "uint32"
---
---Line join style.
@@ -2827,15 +2835,15 @@ function Video:tell() end
---
---The ends of the line segments beveled in an angle so that they join seamlessly.
---
----| '"miter"'
+---| "miter"
---
---No cap applied to the ends of the line segments.
---
----| '"none"'
+---| "none"
---
---Flattens the point where line segments join together.
---
----| '"bevel"'
+---| "bevel"
---
---The styles in which lines are drawn.
@@ -2844,11 +2852,11 @@ function Video:tell() end
---
---Draw rough lines.
---
----| '"rough"'
+---| "rough"
---
---Draw smooth lines.
---
----| '"smooth"'
+---| "smooth"
---
---How a Mesh's vertices are used when drawing.
@@ -2857,19 +2865,19 @@ function Video:tell() end
---
---The vertices create a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons.
---
----| '"fan"'
+---| "fan"
---
---The vertices create a series of connected triangles using vertices 1, 2, 3, then 3, 2, 4 (note the order), then 3, 4, 5, and so on.
---
----| '"strip"'
+---| "strip"
---
---The vertices create unconnected triangles.
---
----| '"triangles"'
+---| "triangles"
---
---The vertices are drawn as unconnected points (see love.graphics.setPointSize.)
---
----| '"points"'
+---| "points"
---
---Controls whether a Canvas has mipmaps, and its behaviour when it does.
@@ -2878,15 +2886,15 @@ function Video:tell() end
---
---The Canvas has no mipmaps.
---
----| '"none"'
+---| "none"
---
---The Canvas has mipmaps. love.graphics.setCanvas can be used to render to a specific mipmap level, or Canvas:generateMipmaps can (re-)compute all mipmap levels based on the base level.
---
----| '"auto"'
+---| "auto"
---
---The Canvas has mipmaps, and all mipmap levels will automatically be recomputed when switching away from the Canvas with love.graphics.setCanvas.
---
----| '"manual"'
+---| "manual"
---
---How newly created particles are added to the ParticleSystem.
@@ -2895,15 +2903,15 @@ function Video:tell() end
---
---Particles are inserted at the top of the ParticleSystem's list of particles.
---
----| '"top"'
+---| "top"
---
---Particles are inserted at the bottom of the ParticleSystem's list of particles.
---
----| '"bottom"'
+---| "bottom"
---
---Particles are inserted at random positions in the ParticleSystem's list of particles.
---
----| '"random"'
+---| "random"
---
---Usage hints for SpriteBatches and Meshes to optimize data storage and access.
@@ -2912,15 +2920,15 @@ function Video:tell() end
---
---The object's data will change occasionally during its lifetime.
---
----| '"dynamic"'
+---| "dynamic"
---
---The object will not be modified after initial sprites or vertices are added.
---
----| '"static"'
+---| "static"
---
---The object data will always change between draws.
---
----| '"stream"'
+---| "stream"
---
---Graphics state stack types used with love.graphics.push.
@@ -2929,11 +2937,11 @@ function Video:tell() end
---
---The transformation stack (love.graphics.translate, love.graphics.rotate, etc.)
---
----| '"transform"'
+---| "transform"
---
---All love.graphics state, including transform state.
---
----| '"all"'
+---| "all"
---
---How a stencil function modifies the stencil values of pixels it touches.
@@ -2942,27 +2950,27 @@ function Video:tell() end
---
---The stencil value of a pixel will be replaced by the value specified in love.graphics.stencil, if any object touches the pixel.
---
----| '"replace"'
+---| "replace"
---
---The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If the stencil value reaches 255 it will stay at 255.
---
----| '"increment"'
+---| "increment"
---
---The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value reaches 0 it will stay at 0.
---
----| '"decrement"'
+---| "decrement"
---
---The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If a stencil value of 255 is incremented it will be set to 0.
---
----| '"incrementwrap"'
+---| "incrementwrap"
---
---The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value of 0 is decremented it will be set to 255.
---
----| '"decrementwrap"'
+---| "decrementwrap"
---
---The stencil value of a pixel will be bitwise-inverted for each object that touches the pixel. If a stencil value of 0 is inverted it will become 255.
---
----| '"invert"'
+---| "invert"
---
---Types of textures (2D, cubemap, etc.)
@@ -2971,19 +2979,19 @@ function Video:tell() end
---
---Regular 2D texture with width and height.
---
----| '"2d"'
+---| "2d"
---
---Several same-size 2D textures organized into a single object. Similar to a texture atlas / sprite sheet, but avoids sprite bleeding and other issues.
---
----| '"array"'
+---| "array"
---
---Cubemap texture with 6 faces. Requires a custom shader (and Shader:send) to use. Sampling from a cube texture in a shader takes a 3D direction vector instead of a texture coordinate.
---
----| '"cube"'
+---| "cube"
---
---3D texture with width, height, and depth. Requires a custom shader to use. Volume textures can have texture filtering applied along the 3rd axis.
---
----| '"volume"'
+---| "volume"
---
---The frequency at which a vertex shader fetches the vertex attribute's data from the Mesh when it's drawn.
@@ -2994,11 +3002,11 @@ function Video:tell() end
---
---The vertex attribute will have a unique value for each vertex in the Mesh.
---
----| '"pervertex"'
+---| "pervertex"
---
---The vertex attribute will have a unique value for each instance of the Mesh.
---
----| '"perinstance"'
+---| "perinstance"
---
---How Mesh geometry vertices are ordered.
@@ -3007,11 +3015,11 @@ function Video:tell() end
---
---Clockwise.
---
----| '"cw"'
+---| "cw"
---
---Counter-clockwise.
---
----| '"ccw"'
+---| "ccw"
---
---How the image wraps inside a Quad with a larger quad size than image size. This also affects how Meshes with texture coordinates which are outside the range of 1 are drawn, and the color returned by the Texel Shader function when using it to sample from texture coordinates outside of the range of 1.
@@ -3020,16 +3028,16 @@ function Video:tell() end
---
---Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture.
---
----| '"clamp"'
+---| "clamp"
---
---Repeat the texture. Fills the whole available extent.
---
----| '"repeat"'
+---| "repeat"
---
---Repeat the texture, flipping it each time it repeats. May produce better visual results than the repeat mode when the texture doesn't seamlessly tile.
---
----| '"mirroredrepeat"'
+---| "mirroredrepeat"
---
---Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.)
---
----| '"clampzero"'
+---| "clampzero"
diff --git a/meta/3rd/love2d/library/love.image.lua b/meta/3rd/love2d/library/love.image.lua
index 19d6f825..e3a1565f 100644
--- a/meta/3rd/love2d/library/love.image.lua
+++ b/meta/3rd/love2d/library/love.image.lua
@@ -25,7 +25,7 @@ function love.image.newCompressedData(filename) end
---
---Creates a new ImageData object.
---
----@overload fun(width: number, height: number, format: love.PixelFormat, data: string):love.ImageData
+---@overload fun(width: number, height: number, format?: love.PixelFormat, data?: string):love.ImageData
---@overload fun(width: number, height: number, data: string):love.ImageData
---@overload fun(filename: string):love.ImageData
---@overload fun(filedata: love.FileData):love.ImageData
@@ -200,147 +200,147 @@ function ImageData:getFormat() end
---
---The DXT1 format. RGB data at 4 bits per pixel (compared to 32 bits for ImageData and regular Images.) Suitable for fully opaque images on desktop systems.
---
----| '"DXT1"'
+---| "DXT1"
---
---The DXT3 format. RGBA data at 8 bits per pixel. Smooth variations in opacity do not mix well with this format.
---
----| '"DXT3"'
+---| "DXT3"
---
---The DXT5 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on desktop systems.
---
----| '"DXT5"'
+---| "DXT5"
---
---The BC4 format (also known as 3Dc+ or ATI1.) Stores just the red channel, at 4 bits per pixel.
---
----| '"BC4"'
+---| "BC4"
---
---The signed variant of the BC4 format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders.
---
----| '"BC4s"'
+---| "BC4s"
---
---The BC5 format (also known as 3Dc or ATI2.) Stores red and green channels at 8 bits per pixel.
---
----| '"BC5"'
+---| "BC5"
---
---The signed variant of the BC5 format.
---
----| '"BC5s"'
+---| "BC5s"
---
---The BC6H format. Stores half-precision floating-point RGB data in the range of 65504 at 8 bits per pixel. Suitable for HDR images on desktop systems.
---
----| '"BC6h"'
+---| "BC6h"
---
---The signed variant of the BC6H format. Stores RGB data in the range of +65504.
---
----| '"BC6hs"'
+---| "BC6hs"
---
---The BC7 format (also known as BPTC.) Stores RGB or RGBA data at 8 bits per pixel.
---
----| '"BC7"'
+---| "BC7"
---
---The ETC1 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on older Android devices.
---
----| '"ETC1"'
+---| "ETC1"
---
---The RGB variant of the ETC2 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on newer mobile devices.
---
----| '"ETC2rgb"'
+---| "ETC2rgb"
---
---The RGBA variant of the ETC2 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on newer mobile devices.
---
----| '"ETC2rgba"'
+---| "ETC2rgba"
---
---The RGBA variant of the ETC2 format where pixels are either fully transparent or fully opaque. RGBA data at 4 bits per pixel.
---
----| '"ETC2rgba1"'
+---| "ETC2rgba1"
---
---The single-channel variant of the EAC format. Stores just the red channel, at 4 bits per pixel.
---
----| '"EACr"'
+---| "EACr"
---
---The signed single-channel variant of the EAC format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders.
---
----| '"EACrs"'
+---| "EACrs"
---
---The two-channel variant of the EAC format. Stores red and green channels at 8 bits per pixel.
---
----| '"EACrg"'
+---| "EACrg"
---
---The signed two-channel variant of the EAC format.
---
----| '"EACrgs"'
+---| "EACrgs"
---
---The 2 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 2 bits per pixel. Textures compressed with PVRTC1 formats must be square and power-of-two sized.
---
----| '"PVR1rgb2"'
+---| "PVR1rgb2"
---
---The 4 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 4 bits per pixel.
---
----| '"PVR1rgb4"'
+---| "PVR1rgb4"
---
---The 2 bit per pixel RGBA variant of the PVRTC1 format.
---
----| '"PVR1rgba2"'
+---| "PVR1rgba2"
---
---The 4 bit per pixel RGBA variant of the PVRTC1 format.
---
----| '"PVR1rgba4"'
+---| "PVR1rgba4"
---
---The 4x4 pixels per block variant of the ASTC format. RGBA data at 8 bits per pixel.
---
----| '"ASTC4x4"'
+---| "ASTC4x4"
---
---The 5x4 pixels per block variant of the ASTC format. RGBA data at 6.4 bits per pixel.
---
----| '"ASTC5x4"'
+---| "ASTC5x4"
---
---The 5x5 pixels per block variant of the ASTC format. RGBA data at 5.12 bits per pixel.
---
----| '"ASTC5x5"'
+---| "ASTC5x5"
---
---The 6x5 pixels per block variant of the ASTC format. RGBA data at 4.27 bits per pixel.
---
----| '"ASTC6x5"'
+---| "ASTC6x5"
---
---The 6x6 pixels per block variant of the ASTC format. RGBA data at 3.56 bits per pixel.
---
----| '"ASTC6x6"'
+---| "ASTC6x6"
---
---The 8x5 pixels per block variant of the ASTC format. RGBA data at 3.2 bits per pixel.
---
----| '"ASTC8x5"'
+---| "ASTC8x5"
---
---The 8x6 pixels per block variant of the ASTC format. RGBA data at 2.67 bits per pixel.
---
----| '"ASTC8x6"'
+---| "ASTC8x6"
---
---The 8x8 pixels per block variant of the ASTC format. RGBA data at 2 bits per pixel.
---
----| '"ASTC8x8"'
+---| "ASTC8x8"
---
---The 10x5 pixels per block variant of the ASTC format. RGBA data at 2.56 bits per pixel.
---
----| '"ASTC10x5"'
+---| "ASTC10x5"
---
---The 10x6 pixels per block variant of the ASTC format. RGBA data at 2.13 bits per pixel.
---
----| '"ASTC10x6"'
+---| "ASTC10x6"
---
---The 10x8 pixels per block variant of the ASTC format. RGBA data at 1.6 bits per pixel.
---
----| '"ASTC10x8"'
+---| "ASTC10x8"
---
---The 10x10 pixels per block variant of the ASTC format. RGBA data at 1.28 bits per pixel.
---
----| '"ASTC10x10"'
+---| "ASTC10x10"
---
---The 12x10 pixels per block variant of the ASTC format. RGBA data at 1.07 bits per pixel.
---
----| '"ASTC12x10"'
+---| "ASTC12x10"
---
---The 12x12 pixels per block variant of the ASTC format. RGBA data at 0.89 bits per pixel.
---
----| '"ASTC12x12"'
+---| "ASTC12x12"
---
---Encoded image formats.
@@ -349,19 +349,19 @@ function ImageData:getFormat() end
---
---Targa image format.
---
----| '"tga"'
+---| "tga"
---
---PNG image format.
---
----| '"png"'
+---| "png"
---
---JPG image format.
---
----| '"jpg"'
+---| "jpg"
---
---BMP image format.
---
----| '"bmp"'
+---| "bmp"
---
---Pixel formats for Textures, ImageData, and CompressedImageData.
@@ -370,256 +370,256 @@ function ImageData:getFormat() end
---
---Indicates unknown pixel format, used internally.
---
----| '"unknown"'
+---| "unknown"
---
---Alias for rgba8, or srgba8 if gamma-correct rendering is enabled.
---
----| '"normal"'
+---| "normal"
---
---A format suitable for high dynamic range content - an alias for the rgba16f format, normally.
---
----| '"hdr"'
+---| "hdr"
---
---Single-channel (red component) format (8 bpp).
---
----| '"r8"'
+---| "r8"
---
---Two channels (red and green components) with 8 bits per channel (16 bpp).
---
----| '"rg8"'
+---| "rg8"
---
---8 bits per channel (32 bpp) RGBA. Color channel values range from 0-255 (0-1 in shaders).
---
----| '"rgba8"'
+---| "rgba8"
---
---gamma-correct version of rgba8.
---
----| '"srgba8"'
+---| "srgba8"
---
---Single-channel (red component) format (16 bpp).
---
----| '"r16"'
+---| "r16"
---
---Two channels (red and green components) with 16 bits per channel (32 bpp).
---
----| '"rg16"'
+---| "rg16"
---
---16 bits per channel (64 bpp) RGBA. Color channel values range from 0-65535 (0-1 in shaders).
---
----| '"rgba16"'
+---| "rgba16"
---
---Floating point single-channel format (16 bpp). Color values can range from [-65504, +65504].
---
----| '"r16f"'
+---| "r16f"
---
---Floating point two-channel format with 16 bits per channel (32 bpp). Color values can range from [-65504, +65504].
---
----| '"rg16f"'
+---| "rg16f"
---
---Floating point RGBA with 16 bits per channel (64 bpp). Color values can range from [-65504, +65504].
---
----| '"rgba16f"'
+---| "rgba16f"
---
---Floating point single-channel format (32 bpp).
---
----| '"r32f"'
+---| "r32f"
---
---Floating point two-channel format with 32 bits per channel (64 bpp).
---
----| '"rg32f"'
+---| "rg32f"
---
---Floating point RGBA with 32 bits per channel (128 bpp).
---
----| '"rgba32f"'
+---| "rgba32f"
---
---Same as rg8, but accessed as (L, L, L, A)
---
----| '"la8"'
+---| "la8"
---
---4 bits per channel (16 bpp) RGBA.
---
----| '"rgba4"'
+---| "rgba4"
---
---RGB with 5 bits each, and a 1-bit alpha channel (16 bpp).
---
----| '"rgb5a1"'
+---| "rgb5a1"
---
---RGB with 5, 6, and 5 bits each, respectively (16 bpp). There is no alpha channel in this format.
---
----| '"rgb565"'
+---| "rgb565"
---
---RGB with 10 bits per channel, and a 2-bit alpha channel (32 bpp).
---
----| '"rgb10a2"'
+---| "rgb10a2"
---
---Floating point RGB with 11 bits in the red and green channels, and 10 bits in the blue channel (32 bpp). There is no alpha channel. Color values can range from [0, +65024].
---
----| '"rg11b10f"'
+---| "rg11b10f"
---
---No depth buffer and 8-bit stencil buffer.
---
----| '"stencil8"'
+---| "stencil8"
---
---16-bit depth buffer and no stencil buffer.
---
----| '"depth16"'
+---| "depth16"
---
---24-bit depth buffer and no stencil buffer.
---
----| '"depth24"'
+---| "depth24"
---
---32-bit float depth buffer and no stencil buffer.
---
----| '"depth32f"'
+---| "depth32f"
---
---24-bit depth buffer and 8-bit stencil buffer.
---
----| '"depth24stencil8"'
+---| "depth24stencil8"
---
---32-bit float depth buffer and 8-bit stencil buffer.
---
----| '"depth32fstencil8"'
+---| "depth32fstencil8"
---
---The DXT1 format. RGB data at 4 bits per pixel (compared to 32 bits for ImageData and regular Images.) Suitable for fully opaque images on desktop systems.
---
----| '"DXT1"'
+---| "DXT1"
---
---The DXT3 format. RGBA data at 8 bits per pixel. Smooth variations in opacity do not mix well with this format.
---
----| '"DXT3"'
+---| "DXT3"
---
---The DXT5 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on desktop systems.
---
----| '"DXT5"'
+---| "DXT5"
---
---The BC4 format (also known as 3Dc+ or ATI1.) Stores just the red channel, at 4 bits per pixel.
---
----| '"BC4"'
+---| "BC4"
---
---The signed variant of the BC4 format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders.
---
----| '"BC4s"'
+---| "BC4s"
---
---The BC5 format (also known as 3Dc or ATI2.) Stores red and green channels at 8 bits per pixel.
---
----| '"BC5"'
+---| "BC5"
---
---The signed variant of the BC5 format.
---
----| '"BC5s"'
+---| "BC5s"
---
---The BC6H format. Stores half-precision floating-point RGB data in the range of 65504 at 8 bits per pixel. Suitable for HDR images on desktop systems.
---
----| '"BC6h"'
+---| "BC6h"
---
---The signed variant of the BC6H format. Stores RGB data in the range of +65504.
---
----| '"BC6hs"'
+---| "BC6hs"
---
---The BC7 format (also known as BPTC.) Stores RGB or RGBA data at 8 bits per pixel.
---
----| '"BC7"'
+---| "BC7"
---
---The ETC1 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on older Android devices.
---
----| '"ETC1"'
+---| "ETC1"
---
---The RGB variant of the ETC2 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on newer mobile devices.
---
----| '"ETC2rgb"'
+---| "ETC2rgb"
---
---The RGBA variant of the ETC2 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on newer mobile devices.
---
----| '"ETC2rgba"'
+---| "ETC2rgba"
---
---The RGBA variant of the ETC2 format where pixels are either fully transparent or fully opaque. RGBA data at 4 bits per pixel.
---
----| '"ETC2rgba1"'
+---| "ETC2rgba1"
---
---The single-channel variant of the EAC format. Stores just the red channel, at 4 bits per pixel.
---
----| '"EACr"'
+---| "EACr"
---
---The signed single-channel variant of the EAC format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders.
---
----| '"EACrs"'
+---| "EACrs"
---
---The two-channel variant of the EAC format. Stores red and green channels at 8 bits per pixel.
---
----| '"EACrg"'
+---| "EACrg"
---
---The signed two-channel variant of the EAC format.
---
----| '"EACrgs"'
+---| "EACrgs"
---
---The 2 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 2 bits per pixel. Textures compressed with PVRTC1 formats must be square and power-of-two sized.
---
----| '"PVR1rgb2"'
+---| "PVR1rgb2"
---
---The 4 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 4 bits per pixel.
---
----| '"PVR1rgb4"'
+---| "PVR1rgb4"
---
---The 2 bit per pixel RGBA variant of the PVRTC1 format.
---
----| '"PVR1rgba2"'
+---| "PVR1rgba2"
---
---The 4 bit per pixel RGBA variant of the PVRTC1 format.
---
----| '"PVR1rgba4"'
+---| "PVR1rgba4"
---
---The 4x4 pixels per block variant of the ASTC format. RGBA data at 8 bits per pixel.
---
----| '"ASTC4x4"'
+---| "ASTC4x4"
---
---The 5x4 pixels per block variant of the ASTC format. RGBA data at 6.4 bits per pixel.
---
----| '"ASTC5x4"'
+---| "ASTC5x4"
---
---The 5x5 pixels per block variant of the ASTC format. RGBA data at 5.12 bits per pixel.
---
----| '"ASTC5x5"'
+---| "ASTC5x5"
---
---The 6x5 pixels per block variant of the ASTC format. RGBA data at 4.27 bits per pixel.
---
----| '"ASTC6x5"'
+---| "ASTC6x5"
---
---The 6x6 pixels per block variant of the ASTC format. RGBA data at 3.56 bits per pixel.
---
----| '"ASTC6x6"'
+---| "ASTC6x6"
---
---The 8x5 pixels per block variant of the ASTC format. RGBA data at 3.2 bits per pixel.
---
----| '"ASTC8x5"'
+---| "ASTC8x5"
---
---The 8x6 pixels per block variant of the ASTC format. RGBA data at 2.67 bits per pixel.
---
----| '"ASTC8x6"'
+---| "ASTC8x6"
---
---The 8x8 pixels per block variant of the ASTC format. RGBA data at 2 bits per pixel.
---
----| '"ASTC8x8"'
+---| "ASTC8x8"
---
---The 10x5 pixels per block variant of the ASTC format. RGBA data at 2.56 bits per pixel.
---
----| '"ASTC10x5"'
+---| "ASTC10x5"
---
---The 10x6 pixels per block variant of the ASTC format. RGBA data at 2.13 bits per pixel.
---
----| '"ASTC10x6"'
+---| "ASTC10x6"
---
---The 10x8 pixels per block variant of the ASTC format. RGBA data at 1.6 bits per pixel.
---
----| '"ASTC10x8"'
+---| "ASTC10x8"
---
---The 10x10 pixels per block variant of the ASTC format. RGBA data at 1.28 bits per pixel.
---
----| '"ASTC10x10"'
+---| "ASTC10x10"
---
---The 12x10 pixels per block variant of the ASTC format. RGBA data at 1.07 bits per pixel.
---
----| '"ASTC12x10"'
+---| "ASTC12x10"
---
---The 12x12 pixels per block variant of the ASTC format. RGBA data at 0.89 bits per pixel.
---
----| '"ASTC12x12"'
+---| "ASTC12x12"
diff --git a/meta/3rd/love2d/library/love.joystick.lua b/meta/3rd/love2d/library/love.joystick.lua
index 29e21cd8..a6c8b206 100644
--- a/meta/3rd/love2d/library/love.joystick.lua
+++ b/meta/3rd/love2d/library/love.joystick.lua
@@ -53,7 +53,7 @@ function love.joystick.saveGamepadMappings(filename) end
---
---The virtual gamepad buttons and axes are designed around the Xbox 360 controller layout.
---
----@overload fun(guid: string, axis: love.GamepadAxis, inputtype: love.JoystickInputType, inputindex: number, hatdir: love.JoystickHat):boolean
+---@overload fun(guid: string, axis: love.GamepadAxis, inputtype: love.JoystickInputType, inputindex: number, hatdir?: love.JoystickHat):boolean
---@param guid string # The OS-dependent GUID for the type of Joystick the binding will affect.
---@param button love.GamepadButton # The virtual gamepad button to bind.
---@param inputtype love.JoystickInputType # The type of input to bind the virtual gamepad button to.
@@ -209,7 +209,7 @@ function Joystick:isVibrationSupported() end
---Sets the vibration motor speeds on a Joystick with rumble support. Most common gamepads have this functionality, although not all drivers give proper support. Use Joystick:isVibrationSupported to check.
---
---@overload fun(self: love.Joystick):boolean
----@overload fun(self: love.Joystick, left: number, right: number, duration: number):boolean
+---@overload fun(self: love.Joystick, left: number, right: number, duration?: number):boolean
---@param left number # Strength of the left vibration motor on the Joystick. Must be in the range of 1.
---@param right number # Strength of the right vibration motor on the Joystick. Must be in the range of 1.
---@return boolean success # True if the vibration was successfully applied, false if not.
@@ -222,27 +222,27 @@ function Joystick:setVibration(left, right) end
---
---The x-axis of the left thumbstick.
---
----| '"leftx"'
+---| "leftx"
---
---The y-axis of the left thumbstick.
---
----| '"lefty"'
+---| "lefty"
---
---The x-axis of the right thumbstick.
---
----| '"rightx"'
+---| "rightx"
---
---The y-axis of the right thumbstick.
---
----| '"righty"'
+---| "righty"
---
---Left analog trigger.
---
----| '"triggerleft"'
+---| "triggerleft"
---
---Right analog trigger.
---
----| '"triggerright"'
+---| "triggerright"
---
---Virtual gamepad buttons.
@@ -251,63 +251,63 @@ function Joystick:setVibration(left, right) end
---
---Bottom face button (A).
---
----| '"a"'
+---| "a"
---
---Right face button (B).
---
----| '"b"'
+---| "b"
---
---Left face button (X).
---
----| '"x"'
+---| "x"
---
---Top face button (Y).
---
----| '"y"'
+---| "y"
---
---Back button.
---
----| '"back"'
+---| "back"
---
---Guide button.
---
----| '"guide"'
+---| "guide"
---
---Start button.
---
----| '"start"'
+---| "start"
---
---Left stick click button.
---
----| '"leftstick"'
+---| "leftstick"
---
---Right stick click button.
---
----| '"rightstick"'
+---| "rightstick"
---
---Left bumper.
---
----| '"leftshoulder"'
+---| "leftshoulder"
---
---Right bumper.
---
----| '"rightshoulder"'
+---| "rightshoulder"
---
---D-pad up.
---
----| '"dpup"'
+---| "dpup"
---
---D-pad down.
---
----| '"dpdown"'
+---| "dpdown"
---
---D-pad left.
---
----| '"dpleft"'
+---| "dpleft"
---
---D-pad right.
---
----| '"dpright"'
+---| "dpright"
---
---Joystick hat positions.
@@ -316,39 +316,39 @@ function Joystick:setVibration(left, right) end
---
---Centered
---
----| '"c"'
+---| "c"
---
---Down
---
----| '"d"'
+---| "d"
---
---Left
---
----| '"l"'
+---| "l"
---
---Left+Down
---
----| '"ld"'
+---| "ld"
---
---Left+Up
---
----| '"lu"'
+---| "lu"
---
---Right
---
----| '"r"'
+---| "r"
---
---Right+Down
---
----| '"rd"'
+---| "rd"
---
---Right+Up
---
----| '"ru"'
+---| "ru"
---
---Up
---
----| '"u"'
+---| "u"
---
---Types of Joystick inputs.
@@ -357,12 +357,12 @@ function Joystick:setVibration(left, right) end
---
---Analog axis.
---
----| '"axis"'
+---| "axis"
---
---Button.
---
----| '"button"'
+---| "button"
---
---8-direction hat value.
---
----| '"hat"'
+---| "hat"
diff --git a/meta/3rd/love2d/library/love.keyboard.lua b/meta/3rd/love2d/library/love.keyboard.lua
index 1f1a2ef5..0d06744f 100644
--- a/meta/3rd/love2d/library/love.keyboard.lua
+++ b/meta/3rd/love2d/library/love.keyboard.lua
@@ -60,8 +60,9 @@ function love.keyboard.isDown(key) end
---Unlike regular KeyConstants, Scancodes are keyboard layout-independent. The scancode 'w' is used if the key in the same place as the 'w' key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.
---
---@param scancode love.Scancode # A Scancode to check.
+---@vararg love.Scancode # Additional Scancodes to check.
---@return boolean down # True if any supplied Scancode is down, false if not.
-function love.keyboard.isScancodeDown(scancode) end
+function love.keyboard.isScancodeDown(scancode, ...) end
---
---Enables or disables key repeat for love.keypressed. It is disabled by default.
@@ -85,579 +86,579 @@ function love.keyboard.setTextInput(enable) end
---
---The A key
---
----| '"a"'
+---| "a"
---
---The B key
---
----| '"b"'
+---| "b"
---
---The C key
---
----| '"c"'
+---| "c"
---
---The D key
---
----| '"d"'
+---| "d"
---
---The E key
---
----| '"e"'
+---| "e"
---
---The F key
---
----| '"f"'
+---| "f"
---
---The G key
---
----| '"g"'
+---| "g"
---
---The H key
---
----| '"h"'
+---| "h"
---
---The I key
---
----| '"i"'
+---| "i"
---
---The J key
---
----| '"j"'
+---| "j"
---
---The K key
---
----| '"k"'
+---| "k"
---
---The L key
---
----| '"l"'
+---| "l"
---
---The M key
---
----| '"m"'
+---| "m"
---
---The N key
---
----| '"n"'
+---| "n"
---
---The O key
---
----| '"o"'
+---| "o"
---
---The P key
---
----| '"p"'
+---| "p"
---
---The Q key
---
----| '"q"'
+---| "q"
---
---The R key
---
----| '"r"'
+---| "r"
---
---The S key
---
----| '"s"'
+---| "s"
---
---The T key
---
----| '"t"'
+---| "t"
---
---The U key
---
----| '"u"'
+---| "u"
---
---The V key
---
----| '"v"'
+---| "v"
---
---The W key
---
----| '"w"'
+---| "w"
---
---The X key
---
----| '"x"'
+---| "x"
---
---The Y key
---
----| '"y"'
+---| "y"
---
---The Z key
---
----| '"z"'
+---| "z"
---
---The zero key
---
----| '"0"'
+---| "0"
---
---The one key
---
----| '"1"'
+---| "1"
---
---The two key
---
----| '"2"'
+---| "2"
---
---The three key
---
----| '"3"'
+---| "3"
---
---The four key
---
----| '"4"'
+---| "4"
---
---The five key
---
----| '"5"'
+---| "5"
---
---The six key
---
----| '"6"'
+---| "6"
---
---The seven key
---
----| '"7"'
+---| "7"
---
---The eight key
---
----| '"8"'
+---| "8"
---
---The nine key
---
----| '"9"'
+---| "9"
---
---Space key
---
----| '"space"'
+---| "space"
---
---Exclamation mark key
---
----| '"!"'
+---| "!"
---
---Double quote key
---
----| '"\""'
+---| "\""
---
---Hash key
---
----| '"#"'
+---| "#"
---
---Dollar key
---
----| '"$"'
+---| "$"
---
---Ampersand key
---
----| '"&"'
+---| "&"
---
---Single quote key
---
----| '"\'"'
+---| "'"
---
---Left parenthesis key
---
----| '"("'
+---| "("
---
---Right parenthesis key
---
----| '")"'
+---| ")"
---
---Asterisk key
---
----| '"*"'
+---| "*"
---
---Plus key
---
----| '"+"'
+---| "+"
---
---Comma key
---
----| '","'
+---| ","
---
---Hyphen-minus key
---
----| '"-"'
+---| "-"
---
---Full stop key
---
----| '"."'
+---| "."
---
---Slash key
---
----| '"/"'
+---| "/"
---
---Colon key
---
----| '":"'
+---| ":"
---
---Semicolon key
---
----| '";"'
+---| ";"
---
---Less-than key
---
----| '"<"'
+---| "<"
---
---Equal key
---
----| '"="'
+---| "="
---
---Greater-than key
---
----| '">"'
+---| ">"
---
---Question mark key
---
----| '"?"'
+---| "?"
---
---At sign key
---
----| '"@"'
+---| "@"
---
---Left square bracket key
---
----| '"["'
+---| "["
---
---Backslash key
---
----| '"\\"'
+---| "\\"
---
---Right square bracket key
---
----| '"]"'
+---| "]"
---
---Caret key
---
----| '"^"'
+---| "^"
---
---Underscore key
---
----| '"_"'
+---| "_"
---
---Grave accent key
---
----| '"`"'
+---| "`"
---
---The numpad zero key
---
----| '"kp0"'
+---| "kp0"
---
---The numpad one key
---
----| '"kp1"'
+---| "kp1"
---
---The numpad two key
---
----| '"kp2"'
+---| "kp2"
---
---The numpad three key
---
----| '"kp3"'
+---| "kp3"
---
---The numpad four key
---
----| '"kp4"'
+---| "kp4"
---
---The numpad five key
---
----| '"kp5"'
+---| "kp5"
---
---The numpad six key
---
----| '"kp6"'
+---| "kp6"
---
---The numpad seven key
---
----| '"kp7"'
+---| "kp7"
---
---The numpad eight key
---
----| '"kp8"'
+---| "kp8"
---
---The numpad nine key
---
----| '"kp9"'
+---| "kp9"
---
---The numpad decimal point key
---
----| '"kp."'
+---| "kp."
---
---The numpad division key
---
----| '"kp/"'
+---| "kp/"
---
---The numpad multiplication key
---
----| '"kp*"'
+---| "kp*"
---
---The numpad substraction key
---
----| '"kp-"'
+---| "kp-"
---
---The numpad addition key
---
----| '"kp+"'
+---| "kp+"
---
---The numpad enter key
---
----| '"kpenter"'
+---| "kpenter"
---
---The numpad equals key
---
----| '"kp="'
+---| "kp="
---
---Up cursor key
---
----| '"up"'
+---| "up"
---
---Down cursor key
---
----| '"down"'
+---| "down"
---
---Right cursor key
---
----| '"right"'
+---| "right"
---
---Left cursor key
---
----| '"left"'
+---| "left"
---
---Home key
---
----| '"home"'
+---| "home"
---
---End key
---
----| '"end"'
+---| "end"
---
---Page up key
---
----| '"pageup"'
+---| "pageup"
---
---Page down key
---
----| '"pagedown"'
+---| "pagedown"
---
---Insert key
---
----| '"insert"'
+---| "insert"
---
---Backspace key
---
----| '"backspace"'
+---| "backspace"
---
---Tab key
---
----| '"tab"'
+---| "tab"
---
---Clear key
---
----| '"clear"'
+---| "clear"
---
---Return key
---
----| '"return"'
+---| "return"
---
---Delete key
---
----| '"delete"'
+---| "delete"
---
---The 1st function key
---
----| '"f1"'
+---| "f1"
---
---The 2nd function key
---
----| '"f2"'
+---| "f2"
---
---The 3rd function key
---
----| '"f3"'
+---| "f3"
---
---The 4th function key
---
----| '"f4"'
+---| "f4"
---
---The 5th function key
---
----| '"f5"'
+---| "f5"
---
---The 6th function key
---
----| '"f6"'
+---| "f6"
---
---The 7th function key
---
----| '"f7"'
+---| "f7"
---
---The 8th function key
---
----| '"f8"'
+---| "f8"
---
---The 9th function key
---
----| '"f9"'
+---| "f9"
---
---The 10th function key
---
----| '"f10"'
+---| "f10"
---
---The 11th function key
---
----| '"f11"'
+---| "f11"
---
---The 12th function key
---
----| '"f12"'
+---| "f12"
---
---The 13th function key
---
----| '"f13"'
+---| "f13"
---
---The 14th function key
---
----| '"f14"'
+---| "f14"
---
---The 15th function key
---
----| '"f15"'
+---| "f15"
---
---Num-lock key
---
----| '"numlock"'
+---| "numlock"
---
---Caps-lock key
---
----| '"capslock"'
+---| "capslock"
---
---Scroll-lock key
---
----| '"scrollock"'
+---| "scrollock"
---
---Right shift key
---
----| '"rshift"'
+---| "rshift"
---
---Left shift key
---
----| '"lshift"'
+---| "lshift"
---
---Right control key
---
----| '"rctrl"'
+---| "rctrl"
---
---Left control key
---
----| '"lctrl"'
+---| "lctrl"
---
---Right alt key
---
----| '"ralt"'
+---| "ralt"
---
---Left alt key
---
----| '"lalt"'
+---| "lalt"
---
---Right meta key
---
----| '"rmeta"'
+---| "rmeta"
---
---Left meta key
---
----| '"lmeta"'
+---| "lmeta"
---
---Left super key
---
----| '"lsuper"'
+---| "lsuper"
---
---Right super key
---
----| '"rsuper"'
+---| "rsuper"
---
---Mode key
---
----| '"mode"'
+---| "mode"
---
---Compose key
---
----| '"compose"'
+---| "compose"
---
---Pause key
---
----| '"pause"'
+---| "pause"
---
---Escape key
---
----| '"escape"'
+---| "escape"
---
---Help key
---
----| '"help"'
+---| "help"
---
---Print key
---
----| '"print"'
+---| "print"
---
---System request key
---
----| '"sysreq"'
+---| "sysreq"
---
---Break key
---
----| '"break"'
+---| "break"
---
---Menu key
---
----| '"menu"'
+---| "menu"
---
---Power key
---
----| '"power"'
+---| "power"
---
---Euro (&euro;) key
---
----| '"euro"'
+---| "euro"
---
---Undo key
---
----| '"undo"'
+---| "undo"
---
---WWW key
---
----| '"www"'
+---| "www"
---
---Mail key
---
----| '"mail"'
+---| "mail"
---
---Calculator key
---
----| '"calculator"'
+---| "calculator"
---
---Application search key
---
----| '"appsearch"'
+---| "appsearch"
---
---Application home key
---
----| '"apphome"'
+---| "apphome"
---
---Application back key
---
----| '"appback"'
+---| "appback"
---
---Application forward key
---
----| '"appforward"'
+---| "appforward"
---
---Application refresh key
---
----| '"apprefresh"'
+---| "apprefresh"
---
---Application bookmarks key
---
----| '"appbookmarks"'
+---| "appbookmarks"
---
---Keyboard scancodes.
@@ -672,776 +673,776 @@ function love.keyboard.setTextInput(enable) end
---
---The 'A' key on an American layout.
---
----| '"a"'
+---| "a"
---
---The 'B' key on an American layout.
---
----| '"b"'
+---| "b"
---
---The 'C' key on an American layout.
---
----| '"c"'
+---| "c"
---
---The 'D' key on an American layout.
---
----| '"d"'
+---| "d"
---
---The 'E' key on an American layout.
---
----| '"e"'
+---| "e"
---
---The 'F' key on an American layout.
---
----| '"f"'
+---| "f"
---
---The 'G' key on an American layout.
---
----| '"g"'
+---| "g"
---
---The 'H' key on an American layout.
---
----| '"h"'
+---| "h"
---
---The 'I' key on an American layout.
---
----| '"i"'
+---| "i"
---
---The 'J' key on an American layout.
---
----| '"j"'
+---| "j"
---
---The 'K' key on an American layout.
---
----| '"k"'
+---| "k"
---
---The 'L' key on an American layout.
---
----| '"l"'
+---| "l"
---
---The 'M' key on an American layout.
---
----| '"m"'
+---| "m"
---
---The 'N' key on an American layout.
---
----| '"n"'
+---| "n"
---
---The 'O' key on an American layout.
---
----| '"o"'
+---| "o"
---
---The 'P' key on an American layout.
---
----| '"p"'
+---| "p"
---
---The 'Q' key on an American layout.
---
----| '"q"'
+---| "q"
---
---The 'R' key on an American layout.
---
----| '"r"'
+---| "r"
---
---The 'S' key on an American layout.
---
----| '"s"'
+---| "s"
---
---The 'T' key on an American layout.
---
----| '"t"'
+---| "t"
---
---The 'U' key on an American layout.
---
----| '"u"'
+---| "u"
---
---The 'V' key on an American layout.
---
----| '"v"'
+---| "v"
---
---The 'W' key on an American layout.
---
----| '"w"'
+---| "w"
---
---The 'X' key on an American layout.
---
----| '"x"'
+---| "x"
---
---The 'Y' key on an American layout.
---
----| '"y"'
+---| "y"
---
---The 'Z' key on an American layout.
---
----| '"z"'
+---| "z"
---
---The '1' key on an American layout.
---
----| '"1"'
+---| "1"
---
---The '2' key on an American layout.
---
----| '"2"'
+---| "2"
---
---The '3' key on an American layout.
---
----| '"3"'
+---| "3"
---
---The '4' key on an American layout.
---
----| '"4"'
+---| "4"
---
---The '5' key on an American layout.
---
----| '"5"'
+---| "5"
---
---The '6' key on an American layout.
---
----| '"6"'
+---| "6"
---
---The '7' key on an American layout.
---
----| '"7"'
+---| "7"
---
---The '8' key on an American layout.
---
----| '"8"'
+---| "8"
---
---The '9' key on an American layout.
---
----| '"9"'
+---| "9"
---
---The '0' key on an American layout.
---
----| '"0"'
+---| "0"
---
---The 'return' / 'enter' key on an American layout.
---
----| '"return"'
+---| "return"
---
---The 'escape' key on an American layout.
---
----| '"escape"'
+---| "escape"
---
---The 'backspace' key on an American layout.
---
----| '"backspace"'
+---| "backspace"
---
---The 'tab' key on an American layout.
---
----| '"tab"'
+---| "tab"
---
---The spacebar on an American layout.
---
----| '"space"'
+---| "space"
---
---The minus key on an American layout.
---
----| '"-"'
+---| "-"
---
---The equals key on an American layout.
---
----| '"="'
+---| "="
---
---The left-bracket key on an American layout.
---
----| '"["'
+---| "["
---
---The right-bracket key on an American layout.
---
----| '"]"'
+---| "]"
---
---The backslash key on an American layout.
---
----| '"\\"'
+---| "\\"
---
---The non-U.S. hash scancode.
---
----| '"nonus#"'
+---| "nonus#"
---
---The semicolon key on an American layout.
---
----| '";"'
+---| ";"
---
---The apostrophe key on an American layout.
---
----| '"\'"'
+---| "'"
---
---The back-tick / grave key on an American layout.
---
----| '"`"'
+---| "`"
---
---The comma key on an American layout.
---
----| '","'
+---| ","
---
---The period key on an American layout.
---
----| '"."'
+---| "."
---
---The forward-slash key on an American layout.
---
----| '"/"'
+---| "/"
---
---The capslock key on an American layout.
---
----| '"capslock"'
+---| "capslock"
---
---The F1 key on an American layout.
---
----| '"f1"'
+---| "f1"
---
---The F2 key on an American layout.
---
----| '"f2"'
+---| "f2"
---
---The F3 key on an American layout.
---
----| '"f3"'
+---| "f3"
---
---The F4 key on an American layout.
---
----| '"f4"'
+---| "f4"
---
---The F5 key on an American layout.
---
----| '"f5"'
+---| "f5"
---
---The F6 key on an American layout.
---
----| '"f6"'
+---| "f6"
---
---The F7 key on an American layout.
---
----| '"f7"'
+---| "f7"
---
---The F8 key on an American layout.
---
----| '"f8"'
+---| "f8"
---
---The F9 key on an American layout.
---
----| '"f9"'
+---| "f9"
---
---The F10 key on an American layout.
---
----| '"f10"'
+---| "f10"
---
---The F11 key on an American layout.
---
----| '"f11"'
+---| "f11"
---
---The F12 key on an American layout.
---
----| '"f12"'
+---| "f12"
---
---The F13 key on an American layout.
---
----| '"f13"'
+---| "f13"
---
---The F14 key on an American layout.
---
----| '"f14"'
+---| "f14"
---
---The F15 key on an American layout.
---
----| '"f15"'
+---| "f15"
---
---The F16 key on an American layout.
---
----| '"f16"'
+---| "f16"
---
---The F17 key on an American layout.
---
----| '"f17"'
+---| "f17"
---
---The F18 key on an American layout.
---
----| '"f18"'
+---| "f18"
---
---The F19 key on an American layout.
---
----| '"f19"'
+---| "f19"
---
---The F20 key on an American layout.
---
----| '"f20"'
+---| "f20"
---
---The F21 key on an American layout.
---
----| '"f21"'
+---| "f21"
---
---The F22 key on an American layout.
---
----| '"f22"'
+---| "f22"
---
---The F23 key on an American layout.
---
----| '"f23"'
+---| "f23"
---
---The F24 key on an American layout.
---
----| '"f24"'
+---| "f24"
---
---The left control key on an American layout.
---
----| '"lctrl"'
+---| "lctrl"
---
---The left shift key on an American layout.
---
----| '"lshift"'
+---| "lshift"
---
---The left alt / option key on an American layout.
---
----| '"lalt"'
+---| "lalt"
---
---The left GUI (command / windows / super) key on an American layout.
---
----| '"lgui"'
+---| "lgui"
---
---The right control key on an American layout.
---
----| '"rctrl"'
+---| "rctrl"
---
---The right shift key on an American layout.
---
----| '"rshift"'
+---| "rshift"
---
---The right alt / option key on an American layout.
---
----| '"ralt"'
+---| "ralt"
---
---The right GUI (command / windows / super) key on an American layout.
---
----| '"rgui"'
+---| "rgui"
---
---The printscreen key on an American layout.
---
----| '"printscreen"'
+---| "printscreen"
---
---The scroll-lock key on an American layout.
---
----| '"scrolllock"'
+---| "scrolllock"
---
---The pause key on an American layout.
---
----| '"pause"'
+---| "pause"
---
---The insert key on an American layout.
---
----| '"insert"'
+---| "insert"
---
---The home key on an American layout.
---
----| '"home"'
+---| "home"
---
---The numlock / clear key on an American layout.
---
----| '"numlock"'
+---| "numlock"
---
---The page-up key on an American layout.
---
----| '"pageup"'
+---| "pageup"
---
---The forward-delete key on an American layout.
---
----| '"delete"'
+---| "delete"
---
---The end key on an American layout.
---
----| '"end"'
+---| "end"
---
---The page-down key on an American layout.
---
----| '"pagedown"'
+---| "pagedown"
---
---The right-arrow key on an American layout.
---
----| '"right"'
+---| "right"
---
---The left-arrow key on an American layout.
---
----| '"left"'
+---| "left"
---
---The down-arrow key on an American layout.
---
----| '"down"'
+---| "down"
---
---The up-arrow key on an American layout.
---
----| '"up"'
+---| "up"
---
---The non-U.S. backslash scancode.
---
----| '"nonusbackslash"'
+---| "nonusbackslash"
---
---The application key on an American layout. Windows contextual menu, compose key.
---
----| '"application"'
+---| "application"
---
---The 'execute' key on an American layout.
---
----| '"execute"'
+---| "execute"
---
---The 'help' key on an American layout.
---
----| '"help"'
+---| "help"
---
---The 'menu' key on an American layout.
---
----| '"menu"'
+---| "menu"
---
---The 'select' key on an American layout.
---
----| '"select"'
+---| "select"
---
---The 'stop' key on an American layout.
---
----| '"stop"'
+---| "stop"
---
---The 'again' key on an American layout.
---
----| '"again"'
+---| "again"
---
---The 'undo' key on an American layout.
---
----| '"undo"'
+---| "undo"
---
---The 'cut' key on an American layout.
---
----| '"cut"'
+---| "cut"
---
---The 'copy' key on an American layout.
---
----| '"copy"'
+---| "copy"
---
---The 'paste' key on an American layout.
---
----| '"paste"'
+---| "paste"
---
---The 'find' key on an American layout.
---
----| '"find"'
+---| "find"
---
---The keypad forward-slash key on an American layout.
---
----| '"kp/"'
+---| "kp/"
---
---The keypad '*' key on an American layout.
---
----| '"kp*"'
+---| "kp*"
---
---The keypad minus key on an American layout.
---
----| '"kp-"'
+---| "kp-"
---
---The keypad plus key on an American layout.
---
----| '"kp+"'
+---| "kp+"
---
---The keypad equals key on an American layout.
---
----| '"kp="'
+---| "kp="
---
---The keypad enter key on an American layout.
---
----| '"kpenter"'
+---| "kpenter"
---
---The keypad '1' key on an American layout.
---
----| '"kp1"'
+---| "kp1"
---
---The keypad '2' key on an American layout.
---
----| '"kp2"'
+---| "kp2"
---
---The keypad '3' key on an American layout.
---
----| '"kp3"'
+---| "kp3"
---
---The keypad '4' key on an American layout.
---
----| '"kp4"'
+---| "kp4"
---
---The keypad '5' key on an American layout.
---
----| '"kp5"'
+---| "kp5"
---
---The keypad '6' key on an American layout.
---
----| '"kp6"'
+---| "kp6"
---
---The keypad '7' key on an American layout.
---
----| '"kp7"'
+---| "kp7"
---
---The keypad '8' key on an American layout.
---
----| '"kp8"'
+---| "kp8"
---
---The keypad '9' key on an American layout.
---
----| '"kp9"'
+---| "kp9"
---
---The keypad '0' key on an American layout.
---
----| '"kp0"'
+---| "kp0"
---
---The keypad period key on an American layout.
---
----| '"kp."'
+---| "kp."
---
---The 1st international key on an American layout. Used on Asian keyboards.
---
----| '"international1"'
+---| "international1"
---
---The 2nd international key on an American layout.
---
----| '"international2"'
+---| "international2"
---
---The 3rd international key on an American layout. Yen.
---
----| '"international3"'
+---| "international3"
---
---The 4th international key on an American layout.
---
----| '"international4"'
+---| "international4"
---
---The 5th international key on an American layout.
---
----| '"international5"'
+---| "international5"
---
---The 6th international key on an American layout.
---
----| '"international6"'
+---| "international6"
---
---The 7th international key on an American layout.
---
----| '"international7"'
+---| "international7"
---
---The 8th international key on an American layout.
---
----| '"international8"'
+---| "international8"
---
---The 9th international key on an American layout.
---
----| '"international9"'
+---| "international9"
---
---Hangul/English toggle scancode.
---
----| '"lang1"'
+---| "lang1"
---
---Hanja conversion scancode.
---
----| '"lang2"'
+---| "lang2"
---
---Katakana scancode.
---
----| '"lang3"'
+---| "lang3"
---
---Hiragana scancode.
---
----| '"lang4"'
+---| "lang4"
---
---Zenkaku/Hankaku scancode.
---
----| '"lang5"'
+---| "lang5"
---
---The mute key on an American layout.
---
----| '"mute"'
+---| "mute"
---
---The volume up key on an American layout.
---
----| '"volumeup"'
+---| "volumeup"
---
---The volume down key on an American layout.
---
----| '"volumedown"'
+---| "volumedown"
---
---The audio next track key on an American layout.
---
----| '"audionext"'
+---| "audionext"
---
---The audio previous track key on an American layout.
---
----| '"audioprev"'
+---| "audioprev"
---
---The audio stop key on an American layout.
---
----| '"audiostop"'
+---| "audiostop"
---
---The audio play key on an American layout.
---
----| '"audioplay"'
+---| "audioplay"
---
---The audio mute key on an American layout.
---
----| '"audiomute"'
+---| "audiomute"
---
---The media select key on an American layout.
---
----| '"mediaselect"'
+---| "mediaselect"
---
---The 'WWW' key on an American layout.
---
----| '"www"'
+---| "www"
---
---The Mail key on an American layout.
---
----| '"mail"'
+---| "mail"
---
---The calculator key on an American layout.
---
----| '"calculator"'
+---| "calculator"
---
---The 'computer' key on an American layout.
---
----| '"computer"'
+---| "computer"
---
---The AC Search key on an American layout.
---
----| '"acsearch"'
+---| "acsearch"
---
---The AC Home key on an American layout.
---
----| '"achome"'
+---| "achome"
---
---The AC Back key on an American layout.
---
----| '"acback"'
+---| "acback"
---
---The AC Forward key on an American layout.
---
----| '"acforward"'
+---| "acforward"
---
---Th AC Stop key on an American layout.
---
----| '"acstop"'
+---| "acstop"
---
---The AC Refresh key on an American layout.
---
----| '"acrefresh"'
+---| "acrefresh"
---
---The AC Bookmarks key on an American layout.
---
----| '"acbookmarks"'
+---| "acbookmarks"
---
---The system power scancode.
---
----| '"power"'
+---| "power"
---
---The brightness-down scancode.
---
----| '"brightnessdown"'
+---| "brightnessdown"
---
---The brightness-up scancode.
---
----| '"brightnessup"'
+---| "brightnessup"
---
---The display switch scancode.
---
----| '"displayswitch"'
+---| "displayswitch"
---
---The keyboard illumination toggle scancode.
---
----| '"kbdillumtoggle"'
+---| "kbdillumtoggle"
---
---The keyboard illumination down scancode.
---
----| '"kbdillumdown"'
+---| "kbdillumdown"
---
---The keyboard illumination up scancode.
---
----| '"kbdillumup"'
+---| "kbdillumup"
---
---The eject scancode.
---
----| '"eject"'
+---| "eject"
---
---The system sleep scancode.
---
----| '"sleep"'
+---| "sleep"
---
---The alt-erase key on an American layout.
---
----| '"alterase"'
+---| "alterase"
---
---The sysreq key on an American layout.
---
----| '"sysreq"'
+---| "sysreq"
---
---The 'cancel' key on an American layout.
---
----| '"cancel"'
+---| "cancel"
---
---The 'clear' key on an American layout.
---
----| '"clear"'
+---| "clear"
---
---The 'prior' key on an American layout.
---
----| '"prior"'
+---| "prior"
---
---The 'return2' key on an American layout.
---
----| '"return2"'
+---| "return2"
---
---The 'separator' key on an American layout.
---
----| '"separator"'
+---| "separator"
---
---The 'out' key on an American layout.
---
----| '"out"'
+---| "out"
---
---The 'oper' key on an American layout.
---
----| '"oper"'
+---| "oper"
---
---The 'clearagain' key on an American layout.
---
----| '"clearagain"'
+---| "clearagain"
---
---The 'crsel' key on an American layout.
---
----| '"crsel"'
+---| "crsel"
---
---The 'exsel' key on an American layout.
---
----| '"exsel"'
+---| "exsel"
---
---The keypad 00 key on an American layout.
---
----| '"kp00"'
+---| "kp00"
---
---The keypad 000 key on an American layout.
---
----| '"kp000"'
+---| "kp000"
---
---The thousands-separator key on an American layout.
---
----| '"thsousandsseparator"'
+---| "thsousandsseparator"
---
---The decimal separator key on an American layout.
---
----| '"decimalseparator"'
+---| "decimalseparator"
---
---The currency unit key on an American layout.
---
----| '"currencyunit"'
+---| "currencyunit"
---
---The currency sub-unit key on an American layout.
---
----| '"currencysubunit"'
+---| "currencysubunit"
---
---The 'app1' scancode.
---
----| '"app1"'
+---| "app1"
---
---The 'app2' scancode.
---
----| '"app2"'
+---| "app2"
---
---An unknown key.
---
----| '"unknown"'
+---| "unknown"
diff --git a/meta/3rd/love2d/library/love.math.lua b/meta/3rd/love2d/library/love.math.lua
index a2510a2f..53e43e3a 100644
--- a/meta/3rd/love2d/library/love.math.lua
+++ b/meta/3rd/love2d/library/love.math.lua
@@ -35,7 +35,7 @@ function love.math.colorToBytes(r, g, b, a) end
---
---Compresses a string or data using a specific compression algorithm.
---
----@overload fun(data: love.Data, format: love.CompressedDataFormat, level: number):love.CompressedData
+---@overload fun(data: love.Data, format?: love.CompressedDataFormat, level?: number):love.CompressedData
---@param rawstring string # The raw (un-compressed) string to compress.
---@param format? love.CompressedDataFormat # The format to use when compressing the string.
---@param level? number # The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.
@@ -135,7 +135,7 @@ function love.math.newRandomGenerator() end
---
---Creates a new Transform object.
---
----@overload fun(x: number, y: number, angle: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number):love.Transform
+---@overload fun(x: number, y: number, angle?: number, sx?: number, sy?: number, ox?: number, oy?: number, kx?: number, ky?: number):love.Transform
---@return love.Transform transform # The new Transform object.
function love.math.newTransform() end
@@ -454,9 +454,10 @@ function Transform:scale(sx, sy) end
---@overload fun(self: love.Transform, layout: love.MatrixLayout, matrix: table):love.Transform
---@param e1_1 number # The first column of the first row of the matrix.
---@param e1_2 number # The second column of the first row of the matrix.
+---@vararg number # Additional matrix elements.
---@param e4_4 number # The fourth column of the fourth row of the matrix.
---@return love.Transform transform # The Transform object the method was called on. Allows easily chaining Transform methods.
-function Transform:setMatrix(e1_1, e1_2, e4_4) end
+function Transform:setMatrix(e1_1, e1_2, ..., e4_4) end
---
---Resets the Transform to the specified transformation parameters.
@@ -507,8 +508,8 @@ function Transform:translate(dx, dy) end
---
---The matrix is row-major:
---
----| '"row"'
+---| "row"
---
---The matrix is column-major:
---
----| '"column"'
+---| "column"
diff --git a/meta/3rd/love2d/library/love.mouse.lua b/meta/3rd/love2d/library/love.mouse.lua
index ac3e896e..e4e70f97 100644
--- a/meta/3rd/love2d/library/love.mouse.lua
+++ b/meta/3rd/love2d/library/love.mouse.lua
@@ -64,8 +64,9 @@ function love.mouse.isCursorSupported() end
---This function does not detect mouse wheel scrolling; you must use the love.wheelmoved (or love.mousepressed in version 0.9.2 and older) callback for that.
---
---@param button number # The index of a button to check. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the middle button. Further buttons are mouse dependant.
+---@vararg number # Additional button numbers to check.
---@return boolean down # True if any specified button is down.
-function love.mouse.isDown(button) end
+function love.mouse.isDown(button, ...) end
---
---Checks if the mouse is grabbed.
@@ -86,8 +87,8 @@ function love.mouse.isVisible() end
---
---The hot spot is the point the operating system uses to determine what was clicked and at what position the mouse cursor is. For example, the normal arrow pointer normally has its hot spot at the top left of the image, but a crosshair cursor might have it in the middle.
---
----@overload fun(filename: string, hotx: number, hoty: number):love.Cursor
----@overload fun(fileData: love.FileData, hotx: number, hoty: number):love.Cursor
+---@overload fun(filename: string, hotx?: number, hoty?: number):love.Cursor
+---@overload fun(fileData: love.FileData, hotx?: number, hoty?: number):love.Cursor
---@param imageData love.ImageData # The ImageData to use for the new Cursor.
---@param hotx? number # The x-coordinate in the ImageData of the cursor's hot spot.
---@param hoty? number # The y-coordinate in the ImageData of the cursor's hot spot.
@@ -165,52 +166,52 @@ function Cursor:getType() end
---
---The cursor is using a custom image.
---
----| '"image"'
+---| "image"
---
---An arrow pointer.
---
----| '"arrow"'
+---| "arrow"
---
---An I-beam, normally used when mousing over editable or selectable text.
---
----| '"ibeam"'
+---| "ibeam"
---
---Wait graphic.
---
----| '"wait"'
+---| "wait"
---
---Small wait cursor with an arrow pointer.
---
----| '"waitarrow"'
+---| "waitarrow"
---
---Crosshair symbol.
---
----| '"crosshair"'
+---| "crosshair"
---
---Double arrow pointing to the top-left and bottom-right.
---
----| '"sizenwse"'
+---| "sizenwse"
---
---Double arrow pointing to the top-right and bottom-left.
---
----| '"sizenesw"'
+---| "sizenesw"
---
---Double arrow pointing left and right.
---
----| '"sizewe"'
+---| "sizewe"
---
---Double arrow pointing up and down.
---
----| '"sizens"'
+---| "sizens"
---
---Four-pointed arrow pointing up, down, left, and right.
---
----| '"sizeall"'
+---| "sizeall"
---
---Slashed circle or crossbones.
---
----| '"no"'
+---| "no"
---
---Hand symbol.
---
----| '"hand"'
+---| "hand"
diff --git a/meta/3rd/love2d/library/love.physics.lua b/meta/3rd/love2d/library/love.physics.lua
index e0300c06..93cb67e4 100644
--- a/meta/3rd/love2d/library/love.physics.lua
+++ b/meta/3rd/love2d/library/love.physics.lua
@@ -57,8 +57,9 @@ function love.physics.newBody(world, x, y, type) end
---@param y1 number # The y position of the first point.
---@param x2 number # The x position of the second point.
---@param y2 number # The y position of the second point.
+---@vararg number # Additional point positions.
---@return love.ChainShape shape # The new shape.
-function love.physics.newChainShape(loop, x1, y1, x2, y2) end
+function love.physics.newChainShape(loop, x1, y1, x2, y2, ...) end
---
---Creates a new CircleShape.
@@ -107,7 +108,7 @@ function love.physics.newFixture(body, shape, density) end
---
---Create a friction joint between two bodies. A FrictionJoint applies friction to a body.
---
----@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean):love.FrictionJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected?: boolean):love.FrictionJoint
---@param body1 love.Body # The first body to attach to the joint.
---@param body2 love.Body # The second body to attach to the joint.
---@param x number # The x position of the anchor point.
@@ -135,7 +136,7 @@ function love.physics.newGearJoint(joint1, joint2, ratio, collideConnected) end
---
---Position and rotation offsets can be specified once the MotorJoint has been created, as well as the maximum motor force and torque that will be be applied to reach the target offsets.
---
----@overload fun(body1: love.Body, body2: love.Body, correctionFactor: number, collideConnected: boolean):love.MotorJoint
+---@overload fun(body1: love.Body, body2: love.Body, correctionFactor?: number, collideConnected?: boolean):love.MotorJoint
---@param body1 love.Body # The first body to attach to the joint.
---@param body2 love.Body # The second body to attach to the joint.
---@param correctionFactor? number # The joint's initial position correction factor, in the range of 1.
@@ -167,16 +168,17 @@ function love.physics.newMouseJoint(body, x, y) end
---@param y2 number # The y position of the second point.
---@param x3 number # The x position of the third point.
---@param y3 number # The y position of the third point.
+---@vararg number # You can continue passing more point positions to create the PolygonShape.
---@return love.PolygonShape shape # A new PolygonShape.
-function love.physics.newPolygonShape(x1, y1, x2, y2, x3, y3) end
+function love.physics.newPolygonShape(x1, y1, x2, y2, x3, y3, ...) end
---
---Creates a PrismaticJoint between two bodies.
---
---A prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque.
---
----@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected: boolean):love.PrismaticJoint
----@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected: boolean, referenceAngle: number):love.PrismaticJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected?: boolean):love.PrismaticJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected?: boolean, referenceAngle?: number):love.PrismaticJoint
---@param body1 love.Body # The first body to connect with a prismatic joint.
---@param body2 love.Body # The second body to connect with a prismatic joint.
---@param x number # The x coordinate of the anchor point.
@@ -214,7 +216,7 @@ function love.physics.newPulleyJoint(body1, body2, gx1, gy1, gx2, gy2, x1, y1, x
---
---By default, the local origin is located at the '''center''' of the rectangle as opposed to the top left for graphics.
---
----@overload fun(x: number, y: number, width: number, height: number, angle: number):love.PolygonShape
+---@overload fun(x: number, y: number, width: number, height: number, angle?: number):love.PolygonShape
---@param width number # The width of the rectangle.
---@param height number # The height of the rectangle.
---@return love.PolygonShape shape # A new PolygonShape.
@@ -225,7 +227,7 @@ function love.physics.newRectangleShape(width, height) end
---
---This joint connects two bodies to a point around which they can pivot.
---
----@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean, referenceAngle: number):love.RevoluteJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected?: boolean, referenceAngle?: number):love.RevoluteJoint
---@param body1 love.Body # The first body.
---@param body2 love.Body # The second body.
---@param x number # The x position of the connecting point.
@@ -251,8 +253,8 @@ function love.physics.newRopeJoint(body1, body2, x1, y1, x2, y2, maxLength, coll
---
---Creates a constraint joint between two bodies. A WeldJoint essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver.
---
----@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean):love.WeldJoint
----@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean, referenceAngle: number):love.WeldJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected?: boolean):love.WeldJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected?: boolean, referenceAngle?: number):love.WeldJoint
---@param body1 love.Body # The first body to attach to the joint.
---@param body2 love.Body # The second body to attach to the joint.
---@param x number # The x position of the anchor point (world space).
@@ -264,7 +266,7 @@ function love.physics.newWeldJoint(body1, body2, x, y, collideConnected) end
---
---Creates a wheel joint.
---
----@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected: boolean):love.WheelJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected?: boolean):love.WheelJoint
---@param body1 love.Body # The first body.
---@param body2 love.Body # The second body.
---@param x number # The x position of the anchor point.
@@ -499,11 +501,12 @@ function Body:getLocalPoint(worldX, worldY) end
---@param y1 number # (Argument) The y position of the first point.
---@param x2 number # (Argument) The x position of the second point.
---@param y2 number # (Argument) The y position of the second point.
+---@vararg number # (Argument) You can continue passing x and y position of the points.
---@return number x1 # (Result) The transformed x position of the first point.
---@return number y1 # (Result) The transformed y position of the first point.
---@return number x2 # (Result) The transformed x position of the second point.
---@return number y2 # (Result) The transformed y position of the second point.
-function Body:getLocalPoints(x1, y1, x2, y2) end
+function Body:getLocalPoints(x1, y1, x2, y2, ...) end
---
---Transform a vector from world coordinates to local coordinates.
@@ -2322,15 +2325,15 @@ function World:update(dt, velocityiterations, positioniterations) end
---
---Static bodies do not move.
---
----| '"static"'
+---| "static"
---
---Dynamic bodies collide with all bodies.
---
----| '"dynamic"'
+---| "dynamic"
---
---Kinematic bodies only collide with dynamic bodies.
---
----| '"kinematic"'
+---| "kinematic"
---
---Different types of joints.
@@ -2339,39 +2342,39 @@ function World:update(dt, velocityiterations, positioniterations) end
---
---A DistanceJoint.
---
----| '"distance"'
+---| "distance"
---
---A FrictionJoint.
---
----| '"friction"'
+---| "friction"
---
---A GearJoint.
---
----| '"gear"'
+---| "gear"
---
---A MouseJoint.
---
----| '"mouse"'
+---| "mouse"
---
---A PrismaticJoint.
---
----| '"prismatic"'
+---| "prismatic"
---
---A PulleyJoint.
---
----| '"pulley"'
+---| "pulley"
---
---A RevoluteJoint.
---
----| '"revolute"'
+---| "revolute"
---
---A RopeJoint.
---
----| '"rope"'
+---| "rope"
---
---A WeldJoint.
---
----| '"weld"'
+---| "weld"
---
---The different types of Shapes, as returned by Shape:getType.
@@ -2380,16 +2383,16 @@ function World:update(dt, velocityiterations, positioniterations) end
---
---The Shape is a CircleShape.
---
----| '"circle"'
+---| "circle"
---
---The Shape is a PolygonShape.
---
----| '"polygon"'
+---| "polygon"
---
---The Shape is a EdgeShape.
---
----| '"edge"'
+---| "edge"
---
---The Shape is a ChainShape.
---
----| '"chain"'
+---| "chain"
diff --git a/meta/3rd/love2d/library/love.sound.lua b/meta/3rd/love2d/library/love.sound.lua
index 536336aa..c41d3380 100644
--- a/meta/3rd/love2d/library/love.sound.lua
+++ b/meta/3rd/love2d/library/love.sound.lua
@@ -9,7 +9,7 @@ love.sound = {}
---
---Attempts to find a decoder for the encoded sound data in the specified file.
---
----@overload fun(filename: string, buffer: number):love.Decoder
+---@overload fun(filename: string, buffer?: number):love.Decoder
---@param file love.File # The file with encoded sound data.
---@param buffer? number # The size of each decoded chunk, in bytes.
---@return love.Decoder decoder # A new Decoder object.
@@ -22,7 +22,7 @@ function love.sound.newDecoder(file, buffer) end
---
---@overload fun(file: love.File):love.SoundData
---@overload fun(decoder: love.Decoder):love.SoundData
----@overload fun(samples: number, rate: number, bits: number, channels: number):love.SoundData
+---@overload fun(samples: number, rate?: number, bits?: number, channels?: number):love.SoundData
---@param filename string # The file name of the file to load.
---@return love.SoundData soundData # A new SoundData object.
function love.sound.newSoundData(filename) end
diff --git a/meta/3rd/love2d/library/love.system.lua b/meta/3rd/love2d/library/love.system.lua
index 154e2f79..bfb76283 100644
--- a/meta/3rd/love2d/library/love.system.lua
+++ b/meta/3rd/love2d/library/love.system.lua
@@ -66,20 +66,20 @@ function love.system.vibrate(seconds) end
---
---Cannot determine power status.
---
----| '"unknown"'
+---| "unknown"
---
---Not plugged in, running on a battery.
---
----| '"battery"'
+---| "battery"
---
---Plugged in, no battery available.
---
----| '"nobattery"'
+---| "nobattery"
---
---Plugged in, charging battery.
---
----| '"charging"'
+---| "charging"
---
---Plugged in, battery is fully charged.
---
----| '"charged"'
+---| "charged"
diff --git a/meta/3rd/love2d/library/love.thread.lua b/meta/3rd/love2d/library/love.thread.lua
index a0568580..cf37b411 100644
--- a/meta/3rd/love2d/library/love.thread.lua
+++ b/meta/3rd/love2d/library/love.thread.lua
@@ -86,8 +86,9 @@ function Channel:peek() end
---
---@param func function # The function to call, the form of function(channel, arg1, arg2, ...) end. The Channel is passed as the first argument to the function when it is called.
---@param arg1 any # Additional arguments that the given function will receive when it is called.
+---@vararg any # Additional arguments that the given function will receive when it is called.
---@return any ret1 # The first return value of the given function (if any.)
-function Channel:performAtomic(func, arg1) end
+function Channel:performAtomic(func, arg1, ...) end
---
---Retrieves the value of a Channel message and removes it from the message queue.
diff --git a/meta/3rd/love2d/library/love.window.lua b/meta/3rd/love2d/library/love.window.lua
index 0fd99213..9722af3b 100644
--- a/meta/3rd/love2d/library/love.window.lua
+++ b/meta/3rd/love2d/library/love.window.lua
@@ -229,7 +229,7 @@ function love.window.setIcon(imagedata) end
---
---@param width number # Display width.
---@param height number # Display height.
----@param flags {fullscreen: boolean, fullscreentype: love.FullscreenType, vsync: boolean, msaa: number, stencil: boolean, depth: number, resizable: boolean, borderless: boolean, centered: boolean, display: number, minwidth: number, minheight: number, highdpi: boolean, x: number, y: number, usedpiscale: boolean, srgb: boolean} # The flags table with the options:
+---@param flags? {fullscreen: boolean, fullscreentype: love.FullscreenType, vsync: boolean, msaa: number, stencil: boolean, depth: number, resizable: boolean, borderless: boolean, centered: boolean, display: number, minwidth: number, minheight: number, highdpi: boolean, x: number, y: number, usedpiscale: boolean, srgb: boolean} # The flags table with the options:
---@return boolean success # True if successful, false otherwise.
function love.window.setMode(width, height, flags) end
@@ -258,7 +258,7 @@ function love.window.setVSync(vsync) end
---
---Displays a message box dialog above the love window. The message box contains a title, optional text, and buttons.
---
----@overload fun(title: string, message: string, buttonlist: table, type: love.MessageBoxType, attachtowindow: boolean):number
+---@overload fun(title: string, message: string, buttonlist: table, type?: love.MessageBoxType, attachtowindow?: boolean):number
---@param title string # The title of the message box.
---@param message string # The text inside the message box.
---@param type? love.MessageBoxType # The type of the message box.
@@ -300,23 +300,23 @@ function love.window.updateMode(width, height, settings) end
---
---Orientation cannot be determined.
---
----| '"unknown"'
+---| "unknown"
---
---Landscape orientation.
---
----| '"landscape"'
+---| "landscape"
---
---Landscape orientation (flipped).
---
----| '"landscapeflipped"'
+---| "landscapeflipped"
---
---Portrait orientation.
---
----| '"portrait"'
+---| "portrait"
---
---Portrait orientation (flipped).
---
----| '"portraitflipped"'
+---| "portraitflipped"
---
---Types of fullscreen modes.
@@ -325,15 +325,15 @@ function love.window.updateMode(width, height, settings) end
---
---Sometimes known as borderless fullscreen windowed mode. A borderless screen-sized window is created which sits on top of all desktop UI elements. The window is automatically resized to match the dimensions of the desktop, and its size cannot be changed.
---
----| '"desktop"'
+---| "desktop"
---
---Standard exclusive-fullscreen mode. Changes the display mode (actual resolution) of the monitor.
---
----| '"exclusive"'
+---| "exclusive"
---
---Standard exclusive-fullscreen mode. Changes the display mode (actual resolution) of the monitor.
---
----| '"normal"'
+---| "normal"
---
---Types of message box dialogs. Different types may have slightly different looks.
@@ -342,12 +342,12 @@ function love.window.updateMode(width, height, settings) end
---
---Informational dialog.
---
----| '"info"'
+---| "info"
---
---Warning dialog.
---
----| '"warning"'
+---| "warning"
---
---Error dialog.
---
----| '"error"'
+---| "error"
diff --git a/meta/3rd/lovr/library/lovr.audio.lua b/meta/3rd/lovr/library/lovr.audio.lua
index baac445b..22106b30 100644
--- a/meta/3rd/lovr/library/lovr.audio.lua
+++ b/meta/3rd/lovr/library/lovr.audio.lua
@@ -183,10 +183,10 @@ function lovr.audio.isStarted(type) end
---
---Creates a new Source from an ogg, wav, or mp3 file.
---
----@overload fun(blob: lovr.Blob, options: table):lovr.Source
----@overload fun(sound: lovr.Sound, options: table):lovr.Source
+---@overload fun(blob: lovr.Blob, options?: table):lovr.Source
+---@overload fun(sound: lovr.Sound, options?: table):lovr.Source
---@param filename string # The filename of the sound to load.
----@param options {decode: boolean, effects: table} # Optional options.
+---@param options? {decode: boolean, effects: table} # Optional options.
---@return lovr.Source source # The new Source.
function lovr.audio.newSource(filename, options) end
@@ -263,7 +263,7 @@ function lovr.audio.setDevice(type, id, sink, mode) end
---
---The triangles must use counterclockwise winding.
---
----@overload fun(model: lovr.Model, material: lovr.AudioMaterial):boolean
+---@overload fun(model: lovr.Model, material?: lovr.AudioMaterial):boolean
---@param vertices table # A flat table of vertices. Each vertex is 3 numbers representing its x, y, and z position. The units used for audio coordinates are up to you, but meters are recommended.
---@param indices table # A list of indices, indicating how the vertices are connected into triangles. Indices are 1-indexed and are 32 bits (they can be bigger than 65535).
---@param material? lovr.AudioMaterial # The acoustic material to use.
@@ -672,35 +672,35 @@ function Source:tell(unit) end
---
---Generic default audio material.
---
----| '"generic"'
+---| "generic"
---
---Brick.
---
----| '"brick"'
+---| "brick"
---
---Carpet.
---
----| '"carpet"'
+---| "carpet"
---
---Ceramic.
---
----| '"ceramic"'
+---| "ceramic"
---
---Concrete.
---
----| '"concrete"'
+---| "concrete"
----| '"glass"'
+---| "glass"
----| '"gravel"'
+---| "gravel"
----| '"metal"'
+---| "metal"
----| '"plaster"'
+---| "plaster"
----| '"rock"'
+---| "rock"
----| '"wood"'
+---| "wood"
---
---Audio devices can be created in shared mode or exclusive mode.
@@ -711,11 +711,11 @@ function Source:tell(unit) end
---
---Shared mode.
---
----| '"shared"'
+---| "shared"
---
---Exclusive mode.
---
----| '"exclusive"'
+---| "exclusive"
---
---When referencing audio devices, this indicates whether it's the playback or capture device.
@@ -724,11 +724,11 @@ function Source:tell(unit) end
---
---The playback device (speakers, headphones).
---
----| '"playback"'
+---| "playback"
---
---The capture device (microphone).
---
----| '"capture"'
+---| "capture"
---
---Different types of effects that can be applied with `Source:setEffectEnabled`.
@@ -747,27 +747,27 @@ function Source:tell(unit) end
---
---Models absorption as sound travels through the air, water, etc.
---
----| '"absorption"'
+---| "absorption"
---
---Decreases audio volume with distance (1 / max(distance, 1)).
---
----| '"falloff"'
+---| "falloff"
---
---Causes audio to drop off when the Source is occluded by geometry.
---
----| '"occlusion"'
+---| "occlusion"
---
---Models reverb caused by audio bouncing off of geometry.
---
----| '"reverb"'
+---| "reverb"
---
---Spatializes the Source using either simple panning or an HRTF.
---
----| '"spatialization"'
+---| "spatialization"
---
---Causes audio to be heard through walls when occluded, based on audio materials.
---
----| '"transmission"'
+---| "transmission"
---
---When figuring out how long a Source is or seeking to a specific position in the sound file, units can be expressed in terms of seconds or in terms of frames.
@@ -778,11 +778,11 @@ function Source:tell(unit) end
---
---Seconds.
---
----| '"seconds"'
+---| "seconds"
---
---Frames.
---
----| '"frames"'
+---| "frames"
---
---When accessing the volume of Sources or the audio listener, this can be done in linear units with a 0 to 1 range, or in decibels with a range of -∞ to 0.
@@ -791,8 +791,8 @@ function Source:tell(unit) end
---
---Linear volume range.
---
----| '"linear"'
+---| "linear"
---
---Decibels.
---
----| '"db"'
+---| "db"
diff --git a/meta/3rd/lovr/library/lovr.data.lua b/meta/3rd/lovr/library/lovr.data.lua
index 04276439..9c53bab0 100644
--- a/meta/3rd/lovr/library/lovr.data.lua
+++ b/meta/3rd/lovr/library/lovr.data.lua
@@ -9,8 +9,8 @@ lovr.data = {}
---
---Creates a new Blob.
---
----@overload fun(contents: string, name: string):lovr.Blob
----@overload fun(source: lovr.Blob, name: string):lovr.Blob
+---@overload fun(contents: string, name?: string):lovr.Blob
+---@overload fun(source: lovr.Blob, name?: string):lovr.Blob
---@param size number # The amount of data to allocate for the Blob, in bytes. All of the bytes will be filled with zeroes.
---@param name? string # A name for the Blob (used in error messages)
---@return lovr.Blob blob # The new Blob.
@@ -29,9 +29,9 @@ function lovr.data.newBlob(size, name) end
---
---Currently textures loaded as KTX need to be in DXT/ASTC formats.
---
----@overload fun(width: number, height: number, format: lovr.TextureFormat, data: lovr.Blob):lovr.Image
+---@overload fun(width: number, height: number, format?: lovr.TextureFormat, data?: lovr.Blob):lovr.Image
---@overload fun(source: lovr.Image):lovr.Image
----@overload fun(blob: lovr.Blob, flip: boolean):lovr.Image
+---@overload fun(blob: lovr.Blob, flip?: boolean):lovr.Image
---@param filename string # The filename of the image to load.
---@param flip? boolean # Whether to vertically flip the image on load. This should be true for normal textures, and false for textures that are going to be used in a cubemap.
---@return lovr.Image image # The new Image.
@@ -50,8 +50,8 @@ function lovr.data.newModelData(filename) end
---
---Creates a new Rasterizer from a TTF file.
---
----@overload fun(filename: string, size: number):lovr.Rasterizer
----@overload fun(blob: lovr.Blob, size: number):lovr.Rasterizer
+---@overload fun(filename: string, size?: number):lovr.Rasterizer
+---@overload fun(blob: lovr.Blob, size?: number):lovr.Rasterizer
---@param size? number # The resolution to render the fonts at, in pixels. Higher resolutions use more memory and processing power but may provide better quality results for some fonts/situations.
---@return lovr.Rasterizer rasterizer # The new Rasterizer.
function lovr.data.newRasterizer(size) end
@@ -325,8 +325,9 @@ function Rasterizer:getLineHeight() end
---
---Check if the Rasterizer can rasterize a set of glyphs.
---
+---@vararg any # Strings (sets of characters) or numbers (character codes) to check for.
---@return boolean hasGlyphs # true if the Rasterizer can rasterize all of the supplied characters, false otherwise.
-function Rasterizer:hasGlyphs() end
+function Rasterizer:hasGlyphs(...) end
---
---A Sound stores the data for a sound.
@@ -469,9 +470,9 @@ function Sound:getFrameCount() end
---
---Reads frames from the Sound into a table, Blob, or another Sound.
---
----@overload fun(self: lovr.Sound, t: table, count: number, srcOffset: number, dstOffset: number):table, number
----@overload fun(self: lovr.Sound, blob: lovr.Blob, count: number, srcOffset: number, dstOffset: number):number
----@overload fun(self: lovr.Sound, sound: lovr.Sound, count: number, srcOffset: number, dstOffset: number):number
+---@overload fun(self: lovr.Sound, t: table, count?: number, srcOffset?: number, dstOffset?: number):table, number
+---@overload fun(self: lovr.Sound, blob: lovr.Blob, count?: number, srcOffset?: number, dstOffset?: number):number
+---@overload fun(self: lovr.Sound, sound: lovr.Sound, count?: number, srcOffset?: number, dstOffset?: number):number
---@param count? number # The number of frames to read. If nil, reads as many frames as possible.
Compressed sounds will automatically be decoded.
@@ -523,8 +524,8 @@ function Sound:isStream() end
---
---Writes frames to the Sound.
---
----@overload fun(self: lovr.Sound, blob: lovr.Blob, count: number, dstOffset: number, srcOffset: number):number
----@overload fun(self: lovr.Sound, sound: lovr.Sound, count: number, dstOffset: number, srcOffset: number):number
+---@overload fun(self: lovr.Sound, blob: lovr.Blob, count?: number, dstOffset?: number, srcOffset?: number):number
+---@overload fun(self: lovr.Sound, sound: lovr.Sound, count?: number, dstOffset?: number, srcOffset?: number):number
---@param t table # A table containing frames to write.
---@param count? number # How many frames to write. If nil, writes as many as possible.
---@param dstOffset? number # A frame offset to apply when writing the frames.
@@ -539,13 +540,13 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end
---
---1 channel.
---
----| '"mono"'
+---| "mono"
---
---2 channels.
---
---The first channel is for the left speaker and the second is for the right.
---
----| '"stereo"'
+---| "stereo"
---
---4 channels.
---
@@ -553,7 +554,7 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end
---
---Currently, ambisonic sounds can only be loaded, not played.
---
----| '"ambisonic"'
+---| "ambisonic"
---
---Sounds can store audio samples as 16 bit integers or 32 bit floats.
@@ -562,8 +563,8 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end
---
---32 bit floating point samples (between -1.0 and 1.0).
---
----| '"f32"'
+---| "f32"
---
---16 bit integer samples (between -32768 and 32767).
---
----| '"i16"'
+---| "i16"
diff --git a/meta/3rd/lovr/library/lovr.event.lua b/meta/3rd/lovr/library/lovr.event.lua
index f2e9509d..a515c1ab 100644
--- a/meta/3rd/lovr/library/lovr.event.lua
+++ b/meta/3rd/lovr/library/lovr.event.lua
@@ -48,7 +48,8 @@ function lovr.event.pump() end
---Only nil, booleans, numbers, strings, and LÖVR objects are supported types for event data.
---
---@param name string # The name of the event.
-function lovr.event.push(name) end
+---@vararg any # The arguments for the event. Currently, up to 4 are supported.
+function lovr.event.push(name, ...) end
---
---Pushes an event to quit.
@@ -90,340 +91,340 @@ function lovr.event.restart() end
---
---The A key.
---
----| '"a"'
+---| "a"
---
---The B key.
---
----| '"b"'
+---| "b"
---
---The C key.
---
----| '"c"'
+---| "c"
---
---The D key.
---
----| '"d"'
+---| "d"
---
---The E key.
---
----| '"e"'
+---| "e"
---
---The F key.
---
----| '"f"'
+---| "f"
---
---The G key.
---
----| '"g"'
+---| "g"
---
---The H key.
---
----| '"h"'
+---| "h"
---
---The I key.
---
----| '"i"'
+---| "i"
---
---The J key.
---
----| '"j"'
+---| "j"
---
---The K key.
---
----| '"k"'
+---| "k"
---
---The L key.
---
----| '"l"'
+---| "l"
---
---The M key.
---
----| '"m"'
+---| "m"
---
---The N key.
---
----| '"n"'
+---| "n"
---
---The O key.
---
----| '"o"'
+---| "o"
---
---The P key.
---
----| '"p"'
+---| "p"
---
---The Q key.
---
----| '"q"'
+---| "q"
---
---The R key.
---
----| '"r"'
+---| "r"
---
---The S key.
---
----| '"s"'
+---| "s"
---
---The T key.
---
----| '"t"'
+---| "t"
---
---The U key.
---
----| '"u"'
+---| "u"
---
---The V key.
---
----| '"v"'
+---| "v"
---
---The W key.
---
----| '"w"'
+---| "w"
---
---The X key.
---
----| '"x"'
+---| "x"
---
---The Y key.
---
----| '"y"'
+---| "y"
---
---The Z key.
---
----| '"z"'
+---| "z"
---
---The 0 key.
---
----| '"0"'
+---| "0"
---
---The 1 key.
---
----| '"1"'
+---| "1"
---
---The 2 key.
---
----| '"2"'
+---| "2"
---
---The 3 key.
---
----| '"3"'
+---| "3"
---
---The 4 key.
---
----| '"4"'
+---| "4"
---
---The 5 key.
---
----| '"5"'
+---| "5"
---
---The 6 key.
---
----| '"6"'
+---| "6"
---
---The 7 key.
---
----| '"7"'
+---| "7"
---
---The 8 key.
---
----| '"8"'
+---| "8"
---
---The 9 key.
---
----| '"9"'
+---| "9"
---
---The space bar.
---
----| '"space"'
+---| "space"
---
---The enter key.
---
----| '"return"'
+---| "return"
---
---The tab key.
---
----| '"tab"'
+---| "tab"
---
---The escape key.
---
----| '"escape"'
+---| "escape"
---
---The backspace key.
---
----| '"backspace"'
+---| "backspace"
---
---The up arrow key.
---
----| '"up"'
+---| "up"
---
---The down arrow key.
---
----| '"down"'
+---| "down"
---
---The left arrow key.
---
----| '"left"'
+---| "left"
---
---The right arrow key.
---
----| '"right"'
+---| "right"
---
---The home key.
---
----| '"home"'
+---| "home"
---
---The end key.
---
----| '"end"'
+---| "end"
---
---The page up key.
---
----| '"pageup"'
+---| "pageup"
---
---The page down key.
---
----| '"pagedown"'
+---| "pagedown"
---
---The insert key.
---
----| '"insert"'
+---| "insert"
---
---The delete key.
---
----| '"delete"'
+---| "delete"
---
---The F1 key.
---
----| '"f1"'
+---| "f1"
---
---The F2 key.
---
----| '"f2"'
+---| "f2"
---
---The F3 key.
---
----| '"f3"'
+---| "f3"
---
---The F4 key.
---
----| '"f4"'
+---| "f4"
---
---The F5 key.
---
----| '"f5"'
+---| "f5"
---
---The F6 key.
---
----| '"f6"'
+---| "f6"
---
---The F7 key.
---
----| '"f7"'
+---| "f7"
---
---The F8 key.
---
----| '"f8"'
+---| "f8"
---
---The F9 key.
---
----| '"f9"'
+---| "f9"
---
---The F10 key.
---
----| '"f10"'
+---| "f10"
---
---The F11 key.
---
----| '"f11"'
+---| "f11"
---
---The F12 key.
---
----| '"f12"'
+---| "f12"
---
---The backtick/backquote/grave accent key.
---
----| '"`"'
+---| "`"
---
---The dash/hyphen/minus key.
---
----| '"-"'
+---| "-"
---
---The equal sign key.
---
----| '"="'
+---| "="
---
---The left bracket key.
---
----| '"["'
+---| "["
---
---The right bracket key.
---
----| '"]"'
+---| "]"
---
---The backslash key.
---
----| '"\\"'
+---| "\\"
---
---The semicolon key.
---
----| '";"'
+---| ";"
---
---The single quote key.
---
----| '"\'"'
+---| "'"
---
---The comma key.
---
----| '","'
+---| ","
---
---The period key.
---
----| '"."'
+---| "."
---
---The slash key.
---
----| '"/"'
+---| "/"
---
---The left control key.
---
----| '"lctrl"'
+---| "lctrl"
---
---The left shift key.
---
----| '"lshift"'
+---| "lshift"
---
---The left alt key.
---
----| '"lalt"'
+---| "lalt"
---
---The left OS key (windows, command, super).
---
----| '"lgui"'
+---| "lgui"
---
---The right control key.
---
----| '"rctrl"'
+---| "rctrl"
---
---The right shift key.
---
----| '"rshift"'
+---| "rshift"
---
---The right alt key.
---
----| '"ralt"'
+---| "ralt"
---
---The right OS key (windows, command, super).
---
----| '"rgui"'
+---| "rgui"
---
---The caps lock key.
---
----| '"capslock"'
+---| "capslock"
---
---The scroll lock key.
---
----| '"scrolllock"'
+---| "scrolllock"
---
---The numlock key.
---
----| '"numlock"'
+---| "numlock"
diff --git a/meta/3rd/lovr/library/lovr.graphics.lua b/meta/3rd/lovr/library/lovr.graphics.lua
index 42a859a5..88dd378b 100644
--- a/meta/3rd/lovr/library/lovr.graphics.lua
+++ b/meta/3rd/lovr/library/lovr.graphics.lua
@@ -15,13 +15,13 @@ lovr.graphics = {}
---### NOTE:
---The local normal vector of the circle is `(0, 0, 1)`.
---
----@overload fun(material: lovr.Material, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, start: number, end: number, segments: number)
----@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, start: number, end: number, segments: number)
----@overload fun(material: lovr.Material, transform: lovr.mat4, start: number, end: number, segments: number)
----@overload fun(mode: lovr.DrawStyle, arcmode: lovr.ArcMode, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, start: number, end: number, segments: number)
----@overload fun(material: lovr.Material, arcmode: lovr.ArcMode, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, start: number, end: number, segments: number)
----@overload fun(mode: lovr.DrawStyle, arcmode: lovr.ArcMode, transform: lovr.mat4, start: number, end: number, segments: number)
----@overload fun(material: lovr.Material, arcmode: lovr.ArcMode, transform: lovr.mat4, start: number, end: number, segments: number)
+---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, start?: number, end?: number, segments?: number)
+---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, start?: number, end?: number, segments?: number)
+---@overload fun(material: lovr.Material, transform: lovr.mat4, start?: number, end?: number, segments?: number)
+---@overload fun(mode: lovr.DrawStyle, arcmode?: lovr.ArcMode, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, start?: number, end?: number, segments?: number)
+---@overload fun(material: lovr.Material, arcmode?: lovr.ArcMode, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, start?: number, end?: number, segments?: number)
+---@overload fun(mode: lovr.DrawStyle, arcmode?: lovr.ArcMode, transform: lovr.mat4, start?: number, end?: number, segments?: number)
+---@overload fun(material: lovr.Material, arcmode?: lovr.ArcMode, transform: lovr.mat4, start?: number, end?: number, segments?: number)
---@param mode lovr.DrawStyle # Whether the arc is filled or outlined.
---@param x? number # The x coordinate of the center of the arc.
---@param y? number # The y coordinate of the center of the arc.
@@ -41,7 +41,7 @@ function lovr.graphics.arc(mode, x, y, z, radius, angle, ax, ay, az, start, end,
---
---This is similar to `lovr.graphics.cube` except you can have different values for the width, height, and depth of the box.
---
----@overload fun(material: lovr.Material, x: number, y: number, z: number, width: number, height: number, depth: number, angle: number, ax: number, ay: number, az: number)
+---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, width?: number, height?: number, depth?: number, angle?: number, ax?: number, ay?: number, az?: number)
---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4)
---@overload fun(material: lovr.Material, transform: lovr.mat4)
---@param mode lovr.DrawStyle # How to draw the box.
@@ -64,9 +64,9 @@ function lovr.graphics.box(mode, x, y, z, width, height, depth, angle, ax, ay, a
---### NOTE:
---The local normal vector of the circle is `(0, 0, 1)`.
---
----@overload fun(material: lovr.Material, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number, segments: number)
----@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, segments: number)
----@overload fun(material: lovr.Material, transform: lovr.mat4, segments: number)
+---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number, segments?: number)
+---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4, segments?: number)
+---@overload fun(material: lovr.Material, transform: lovr.mat4, segments?: number)
---@param mode lovr.DrawStyle # Whether the circle is filled or outlined.
---@param x? number # The x coordinate of the center of the circle.
---@param y? number # The y coordinate of the center of the circle.
@@ -90,7 +90,7 @@ function lovr.graphics.circle(mode, x, y, z, radius, angle, ax, ay, az, segments
---
---If you are using `lovr.graphics.setStencilTest`, it will not affect how the screen gets cleared. Instead, you can use `lovr.graphics.fill` to draw a fullscreen quad, which will get masked by the active stencil.
---
----@overload fun(r: number, g: number, b: number, a: number, z: number, s: number)
+---@overload fun(r: number, g: number, b: number, a: number, z?: number, s?: number)
---@overload fun(hex: number)
---@param color? boolean # Whether or not to clear color information on the screen.
---@param depth? boolean # Whether or not to clear the depth information on the screen.
@@ -129,13 +129,13 @@ function lovr.graphics.compute(shader, x, y, z) end
---
---The window must be created before any `lovr.graphics` functions can be used.
---
----@param flags {width: number, height: number, fullscreen: boolean, resizable: boolean, msaa: number, title: string, icon: string, vsync: number} # Flags to customize the window's appearance and behavior.
+---@param flags? {width: number, height: number, fullscreen: boolean, resizable: boolean, msaa: number, title: string, icon: string, vsync: number} # Flags to customize the window's appearance and behavior.
function lovr.graphics.createWindow(flags) end
---
---Draws a cube.
---
----@overload fun(material: lovr.Material, x: number, y: number, z: number, size: number, angle: number, ax: number, ay: number, az: number)
+---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, size?: number, angle?: number, ax?: number, ay?: number, az?: number)
---@overload fun(mode: lovr.DrawStyle, transform: lovr.mat4)
---@overload fun(material: lovr.Material, transform: lovr.mat4)
---@param mode lovr.DrawStyle # How to draw the cube.
@@ -156,7 +156,7 @@ function lovr.graphics.cube(mode, x, y, z, size, angle, ax, ay, az) end
---### NOTE:
---Currently, cylinders don't have UVs.
---
----@overload fun(material: lovr.Material, x: number, y: number, z: number, length: number, angle: number, ax: number, ay: number, az: number, r1: number, r2: number, capped: boolean, segments: number)
+---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, length?: number, angle?: number, ax?: number, ay?: number, az?: number, r1?: number, r2?: number, capped?: boolean, segments?: number)
---@param x? number # The x coordinate of the center of the cylinder.
---@param y? number # The y coordinate of the center of the cylinder.
---@param z? number # The z coordinate of the center of the cylinder.
@@ -533,7 +533,8 @@ function lovr.graphics.isWireframe() end
---@param x2 number # The x coordinate of the second point.
---@param y2 number # The y coordinate of the second point.
---@param z2 number # The z coordinate of the second point.
-function lovr.graphics.line(x1, y1, z1, x2, y2, z2) end
+---@vararg number # More points.
+function lovr.graphics.line(x1, y1, z1, x2, y2, z2, ...) end
---
---Creates a new Canvas.
@@ -548,8 +549,8 @@ function lovr.graphics.line(x1, y1, z1, x2, y2, z2) end
---
---Stereo Canvases will either have their width doubled or use array textures for their attachments, depending on their implementation.
---
----@overload fun(..., flags: table):lovr.Canvas
----@overload fun(attachments: table, flags: table):lovr.Canvas
+---@overload fun(..., flags?: table):lovr.Canvas
+---@overload fun(attachments: table, flags?: table):lovr.Canvas
---@param width number # The width of the canvas, in pixels.
---@param height number # The height of the canvas, in pixels.
---@param flags? {format: lovr.TextureFormat, depth: lovr.TextureFormat, stereo: boolean, msaa: number, mipmaps: boolean} # Optional settings for the Canvas.
@@ -585,8 +586,8 @@ function lovr.graphics.newComputeShader(source, options) end
---### NOTE:
---Larger font sizes will lead to more detailed curves at the cost of performance.
---
----@overload fun(size: number, padding: number, spread: number):lovr.Font
----@overload fun(rasterizer: lovr.Rasterizer, padding: number, spread: number):lovr.Font
+---@overload fun(size?: number, padding?: number, spread?: number):lovr.Font
+---@overload fun(rasterizer: lovr.Rasterizer, padding?: number, spread?: number):lovr.Font
---@param filename string # The filename of the font file.
---@param size? number # The size of the font, in pixels.
---@param padding? number # The number of pixels of padding around each glyph.
@@ -608,10 +609,10 @@ function lovr.graphics.newFont(filename, size, padding, spread) end
--- default to `(0.0, 0.0, 0.0, 0.0)`.
---- Textures will default to `nil` (a single 1x1 white pixel will be used for them).
---
----@overload fun(texture: lovr.Texture, r: number, g: number, b: number, a: number):lovr.Material
----@overload fun(canvas: lovr.Canvas, r: number, g: number, b: number, a: number):lovr.Material
----@overload fun(r: number, g: number, b: number, a: number):lovr.Material
----@overload fun(hex: number, a: number):lovr.Material
+---@overload fun(texture: lovr.Texture, r?: number, g?: number, b?: number, a?: number):lovr.Material
+---@overload fun(canvas: lovr.Canvas, r?: number, g?: number, b?: number, a?: number):lovr.Material
+---@overload fun(r?: number, g?: number, b?: number, a?: number):lovr.Material
+---@overload fun(hex?: number, a?: number):lovr.Material
---@return lovr.Material material # The new Material.
function lovr.graphics.newMaterial() end
@@ -638,11 +639,11 @@ function lovr.graphics.newMaterial() end
--- { 'lovrTexCoord', 'float', 2 }
--- }
---
----@overload fun(vertices: table, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh
----@overload fun(blob: lovr.Blob, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh
----@overload fun(format: table, size: number, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh
----@overload fun(format: table, vertices: table, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh
----@overload fun(format: table, blob: lovr.Blob, mode: lovr.DrawMode, usage: lovr.MeshUsage, readable: boolean):lovr.Mesh
+---@overload fun(vertices: table, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh
+---@overload fun(blob: lovr.Blob, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh
+---@overload fun(format: table, size: number, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh
+---@overload fun(format: table, vertices: table, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh
+---@overload fun(format: table, blob: lovr.Blob, mode?: lovr.DrawMode, usage?: lovr.MeshUsage, readable?: boolean):lovr.Mesh
---@param size number # The maximum number of vertices the Mesh can store.
---@param mode? lovr.DrawMode # How the Mesh will connect its vertices into triangles.
---@param usage? lovr.MeshUsage # An optimization hint indicating how often the data in the Mesh will be updated.
@@ -758,7 +759,7 @@ function lovr.graphics.newModel(filename) end
---
---Currently on Android, only stereo shaders can be used with stereo Canvases, and mono Shaders can only be used with mono Canvases.
---
----@overload fun(default: lovr.DefaultShader, options: table):lovr.Shader
+---@overload fun(default: lovr.DefaultShader, options?: table):lovr.Shader
---@param vertex string # The code or filename of the vertex shader. If nil, the default vertex shader is used.
---@param fragment string # The code or filename of the fragment shader. If nil, the default fragment shader is used.
---@param options? {flags: table, stereo: boolean} # Optional settings for the Shader.
@@ -791,10 +792,10 @@ function lovr.graphics.newShaderBlock(type, uniforms, flags) end
---
---Right now the supported image file formats are png, jpg, hdr, dds (DXT1, DXT3, DXT5), ktx, and astc.
---
----@overload fun(images: table, flags: table):lovr.Texture
----@overload fun(width: number, height: number, depth: number, flags: table):lovr.Texture
----@overload fun(blob: lovr.Blob, flags: table):lovr.Texture
----@overload fun(image: lovr.Image, flags: table):lovr.Texture
+---@overload fun(images: table, flags?: table):lovr.Texture
+---@overload fun(width: number, height: number, depth: number, flags?: table):lovr.Texture
+---@overload fun(blob: lovr.Blob, flags?: table):lovr.Texture
+---@overload fun(image: lovr.Image, flags?: table):lovr.Texture
---@param filename string # The filename of the image to load.
---@param flags? {linear: boolean, mipmaps: boolean, type: lovr.TextureType, format: lovr.TextureFormat, msaa: number} # Optional settings for the texture.
---@return lovr.Texture texture # The new Texture.
@@ -818,7 +819,7 @@ function lovr.graphics.origin() end
---
---One efficient technique for rendering many planes with different textures is to pack all of the textures into a single image, and then use the uv arguments to select a sub-rectangle to use for each plane.
---
----@overload fun(material: lovr.Material, x: number, y: number, z: number, width: number, height: number, angle: number, ax: number, ay: number, az: number, u: number, v: number, w: number, h: number)
+---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, width?: number, height?: number, angle?: number, ax?: number, ay?: number, az?: number, u?: number, v?: number, w?: number, h?: number)
---@param mode lovr.DrawStyle # How to draw the plane.
---@param x? number # The x coordinate of the center of the plane.
---@param y? number # The y coordinate of the center of the plane.
@@ -842,7 +843,8 @@ function lovr.graphics.plane(mode, x, y, z, width, height, angle, ax, ay, az, u,
---@param x number # The x coordinate of the point.
---@param y number # The y coordinate of the point.
---@param z number # The z coordinate of the point.
-function lovr.graphics.points(x, y, z) end
+---@vararg number # More points.
+function lovr.graphics.points(x, y, z, ...) end
---
---Pops the current transform from the stack, returning to the transformation that was applied before `lovr.graphics.push` was called.
@@ -970,7 +972,7 @@ function lovr.graphics.setAlphaSampling(enabled) end
---### NOTE:
---The default background color is `(0.0, 0.0, 0.0, 1.0)`.
---
----@overload fun(hex: number, a: number)
+---@overload fun(hex: number, a?: number)
---@overload fun(color: table)
---@param r number # The red component of the background color.
---@param g number # The green component of the background color.
@@ -1013,7 +1015,7 @@ function lovr.graphics.setCanvas(canvas) end
---### NOTE:
---The default color is `(1.0, 1.0, 1.0, 1.0)`.
---
----@overload fun(hex: number, a: number)
+---@overload fun(hex: number, a?: number)
---@overload fun(color: table)
---@param r number # The red component of the color.
---@param g number # The green component of the color.
@@ -1259,7 +1261,7 @@ function lovr.graphics.skybox(texture) end
---
---Draws a sphere.
---
----@overload fun(material: lovr.Material, x: number, y: number, z: number, radius: number, angle: number, ax: number, ay: number, az: number)
+---@overload fun(material: lovr.Material, x?: number, y?: number, z?: number, radius?: number, angle?: number, ax?: number, ay?: number, az?: number)
---@param x? number # The x coordinate of the center of the sphere.
---@param y? number # The y coordinate of the center of the sphere.
---@param z? number # The z coordinate of the center of the sphere.
@@ -1277,7 +1279,7 @@ function lovr.graphics.sphere(x, y, z, radius, angle, ax, ay, az) end
---### NOTE:
---Stencil values are between 0 and 255.
---
----@overload fun(callback: function, action: lovr.StencilAction, value: number, initial: number)
+---@overload fun(callback: function, action?: lovr.StencilAction, value?: number, initial?: number)
---@param callback function # The function that will be called to render to the stencil buffer.
---@param action? lovr.StencilAction # How to modify the stencil value of pixels that are rendered to.
---@param value? number # If `action` is "replace", this is the value that pixels are replaced with.
@@ -1474,7 +1476,8 @@ function Canvas:newImage(index) end
---If you plan on modifying the transform stack inside your callback it may be a good idea to use `lovr.graphics.push` and `lovr.graphics.pop` so you can revert to the previous transform afterwards.
---
---@param callback function # The function to use to render to the Canvas.
-function Canvas:renderTo(callback) end
+---@vararg any # Additional arguments to pass to the callback.
+function Canvas:renderTo(callback, ...) end
---
---Attaches one or more Textures to the Canvas.
@@ -1494,7 +1497,8 @@ function Canvas:renderTo(callback) end
---
---You can also optionally wrap them in a table.
---
-function Canvas:setTexture() end
+---@vararg any # One or more Textures to attach to the Canvas.
+function Canvas:setTexture(...) end
---
---A Font is an object created from a TTF file.
@@ -1592,8 +1596,9 @@ function Font:getWidth(text, wrap) end
---### NOTE:
---It is a good idea to use this function when you're rendering an unknown or user-supplied string to avoid utterly embarrassing crashes.
---
+---@vararg any # Strings or numbers to test.
---@return boolean has # Whether the Font has the glyphs.
-function Font:hasGlyphs() end
+function Font:hasGlyphs(...) end
---
---Sets the line height of the Font, which controls how far lines apart lines are vertically separated.
@@ -1677,9 +1682,9 @@ function Material:getTransform() end
---
---Colors default to `(1.0, 1.0, 1.0, 1.0)` and are gamma corrected.
---
----@overload fun(self: lovr.Material, r: number, g: number, b: number, a: number)
----@overload fun(self: lovr.Material, colorType: lovr.MaterialColor, hex: number, a: number)
----@overload fun(self: lovr.Material, hex: number, a: number)
+---@overload fun(self: lovr.Material, r: number, g: number, b: number, a?: number)
+---@overload fun(self: lovr.Material, colorType?: lovr.MaterialColor, hex: number, a?: number)
+---@overload fun(self: lovr.Material, hex: number, a?: number)
---@param colorType? lovr.MaterialColor # The type of color to set.
---@param r number # The red component of the color.
---@param g number # The green component of the color.
@@ -1811,8 +1816,8 @@ local Mesh = {}
---
---To prevent cycles, it is not possible to attach attributes onto a Mesh that already has attributes attached to a different Mesh.
---
----@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor: number, ...)
----@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor: number, attributes: table)
+---@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor?: number, ...)
+---@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, divisor?: number, attributes: table)
---@param mesh lovr.Mesh # The Mesh to attach attributes from.
---@param divisor? number # The attribute divisor for all attached attributes.
function Mesh:attachAttributes(mesh, divisor) end
@@ -1828,7 +1833,7 @@ function Mesh:detachAttributes(mesh) end
---
---Draws the contents of the Mesh.
---
----@overload fun(self: lovr.Mesh, transform: lovr.mat4, instances: number)
+---@overload fun(self: lovr.Mesh, transform: lovr.mat4, instances?: number)
---@param x? number # The x coordinate to draw the Mesh at.
---@param y? number # The y coordinate to draw the Mesh at.
---@param z? number # The z coordinate to draw the Mesh at.
@@ -1962,7 +1967,8 @@ function Mesh:setMaterial(material) end
---Any unspecified components will be set to 0.
---
---@param index number # The index of the vertex to set.
-function Mesh:setVertex(index) end
+---@vararg number # The attributes of the vertex.
+function Mesh:setVertex(index, ...) end
---
---Set the components of a specific attribute of a vertex in the Mesh.
@@ -1973,7 +1979,8 @@ function Mesh:setVertex(index) end
---
---@param index number # The index of the vertex to update.
---@param attribute number # The index of the attribute to update.
-function Mesh:setVertexAttribute(index, attribute) end
+---@vararg number # The new components for the attribute.
+function Mesh:setVertexAttribute(index, attribute, ...) end
---
---Sets the vertex map.
@@ -1982,7 +1989,7 @@ function Mesh:setVertexAttribute(index, attribute) end
---
---Often, a vertex map is used to improve performance, since it usually requires less data to specify the index of a vertex than it does to specify all of the data for a vertex.
---
----@overload fun(self: lovr.Mesh, blob: lovr.Blob, size: number)
+---@overload fun(self: lovr.Mesh, blob: lovr.Blob, size?: number)
---@param map table # The new vertex map. Each element of the table is an index of a vertex.
function Mesh:setVertexMap(map) end
@@ -1993,7 +2000,7 @@ function Mesh:setVertexMap(map) end
---### NOTE:
---The start index plus the number of vertices in the table should not exceed the maximum size of the Mesh.
---
----@overload fun(self: lovr.Mesh, blob: lovr.Blob, start: number, count: number)
+---@overload fun(self: lovr.Mesh, blob: lovr.Blob, start?: number, count?: number)
---@param vertices table # The new set of vertices.
---@param start? number # The index of the vertex to start replacing at.
---@param count? number # The number of vertices to replace. If nil, all vertices will be used.
@@ -2022,7 +2029,7 @@ local Model = {}
---
---To clear the pose of a Model to the default, use `Model:pose(nil)`.
---
----@overload fun(self: lovr.Model, index: number, time: number, alpha: number)
+---@overload fun(self: lovr.Model, index: number, time: number, alpha?: number)
---@param name string # The name of an animation.
---@param time number # The timestamp to evaluate the keyframes at, in seconds.
---@param alpha? number # How much of the animation to mix in, from 0 to 1.
@@ -2031,7 +2038,7 @@ function Model:animate(name, time, alpha) end
---
---Draw the Model.
---
----@overload fun(self: lovr.Model, transform: lovr.mat4, instances: number)
+---@overload fun(self: lovr.Model, transform: lovr.mat4, instances?: number)
---@param x? number # The x coordinate to draw the Model at.
---@param y? number # The y coordinate to draw the Model at.
---@param z? number # The z coordinate to draw the Model at.
@@ -2120,7 +2127,7 @@ function Model:getNodeName(index) end
---
---See `lovr.graphics.newShader` for more.
---
----@overload fun(self: lovr.Model, index: number, space: lovr.CoordinateSpace):number, number, number, number, number, number, number
+---@overload fun(self: lovr.Model, index: number, space?: lovr.CoordinateSpace):number, number, number, number, number, number, number
---@param name string # The name of the node.
---@param space? lovr.CoordinateSpace # Whether the pose should be returned relative to the node's parent or relative to the root node of the Model.
---@return number x # The x position of the node.
@@ -2174,7 +2181,7 @@ function Model:hasJoints() end
---
---See `lovr.graphics.newShader` for more.
---
----@overload fun(self: lovr.Model, index: number, x: number, y: number, z: number, angle: number, ax: number, ay: number, az: number, alpha: number)
+---@overload fun(self: lovr.Model, index: number, x: number, y: number, z: number, angle: number, ax: number, ay: number, az: number, alpha?: number)
---@overload fun(self: lovr.Model)
---@param name string # The name of the node.
---@param x number # The x position.
@@ -2436,7 +2443,7 @@ function Shader:sendBlock(name, block, access) end
---
---The normal `Shader:send` function accepts Textures and should be used most of the time.
---
----@overload fun(self: lovr.Shader, name: string, index: number, texture: lovr.Texture, slice: number, mipmap: number, access: lovr.UniformAccess)
+---@overload fun(self: lovr.Shader, name: string, index: number, texture: lovr.Texture, slice?: number, mipmap?: number, access?: lovr.UniformAccess)
---@param name string # The name of the image uniform.
---@param texture lovr.Texture # The Texture to assign.
---@param slice? number # The slice of a cube, array, or volume texture to use, or `nil` for all slices.
@@ -2533,7 +2540,7 @@ function ShaderBlock:read(name) end
---
---`Blob`s can also be used to pass arbitrary binary data to individual variables.
---
----@overload fun(self: lovr.ShaderBlock, blob: lovr.Blob, srcOffset: number, dstOffset: number, extent: number):number
+---@overload fun(self: lovr.ShaderBlock, blob: lovr.Blob, srcOffset?: number, dstOffset?: number, extent?: number):number
---@param variable string # The name of the variable to update.
---@param value any # The new value of the uniform.
function ShaderBlock:send(variable, value) end
@@ -2673,15 +2680,15 @@ function Texture:setWrap(horizontal, vertical) end
---
---The arc is drawn with the center of its circle included in the list of points (default).
---
----| '"pie"'
+---| "pie"
---
---The curve of the arc is drawn as a single line.
---
----| '"open"'
+---| "open"
---
---The starting and ending points of the arc's curve are connected.
---
----| '"closed"'
+---| "closed"
---
---Here are the different data types available for vertex attributes in a Mesh.
@@ -2694,31 +2701,31 @@ function Texture:setWrap(horizontal, vertical) end
---
---A signed 8 bit number, from -128 to 127.
---
----| '"byte"'
+---| "byte"
---
---An unsigned 8 bit number, from 0 to 255.
---
----| '"ubyte"'
+---| "ubyte"
---
---A signed 16 bit number, from -32768 to 32767.
---
----| '"short"'
+---| "short"
---
---An unsigned 16 bit number, from 0 to 65535.
---
----| '"ushort"'
+---| "ushort"
---
---A signed 32 bit number, from -2147483648 to 2147483647.
---
----| '"int"'
+---| "int"
---
---An unsigned 32 bit number, from 0 to 4294967295.
---
----| '"uint"'
+---| "uint"
---
---A 32 bit floating-point number (large range, but can start to lose precision).
---
----| '"float"'
+---| "float"
---
---Different ways the alpha channel of pixels affects blending.
@@ -2733,13 +2740,13 @@ function Texture:setWrap(horizontal, vertical) end
---
---Color channel values are multiplied by the alpha channel during blending.
---
----| '"alphamultiply"'
+---| "alphamultiply"
---
---Color channels are not multiplied by the alpha channel.
---
---This should be used if the pixels being drawn have already been blended, or "pre-multiplied", by the alpha channel.
---
----| '"premultiplied"'
+---| "premultiplied"
---
---Blend modes control how overlapping pixels are blended together, similar to layers in Photoshop.
@@ -2748,31 +2755,31 @@ function Texture:setWrap(horizontal, vertical) end
---
---Normal blending where the alpha value controls how the colors are blended.
---
----| '"alpha"'
+---| "alpha"
---
---The incoming pixel color is added to the destination pixel color.
---
----| '"add"'
+---| "add"
---
---The incoming pixel color is subtracted from the destination pixel color.
---
----| '"subtract"'
+---| "subtract"
---
---The color channels from the two pixel values are multiplied together to produce a result.
---
----| '"multiply"'
+---| "multiply"
---
---The maximum value from each color channel is used, resulting in a lightening effect.
---
----| '"lighten"'
+---| "lighten"
---
---The minimum value from each color channel is used, resulting in a darkening effect.
---
----| '"darken"'
+---| "darken"
---
---The opposite of multiply: The pixel values are inverted, multiplied, and inverted again, resulting in a lightening effect.
---
----| '"screen"'
+---| "screen"
---
---There are two types of ShaderBlocks that can be used: `uniform` and `compute`.
@@ -2785,11 +2792,11 @@ function Texture:setWrap(horizontal, vertical) end
---
---A uniform block.
---
----| '"uniform"'
+---| "uniform"
---
---A compute block.
---
----| '"compute"'
+---| "compute"
---
---This acts as a hint to the graphics driver about what kinds of data access should be optimized for.
@@ -2798,15 +2805,15 @@ function Texture:setWrap(horizontal, vertical) end
---
---A buffer that you intend to create once and never modify.
---
----| '"static"'
+---| "static"
---
---A buffer which is modified occasionally.
---
----| '"dynamic"'
+---| "dynamic"
---
---A buffer which is entirely replaced on the order of every frame.
---
----| '"stream"'
+---| "stream"
---
---The method used to compare z values when deciding how to overlap rendered objects.
@@ -2821,27 +2828,27 @@ function Texture:setWrap(horizontal, vertical) end
---
---The depth test passes when the depth values are equal.
---
----| '"equal"'
+---| "equal"
---
---The depth test passes when the depth values are not equal.
---
----| '"notequal"'
+---| "notequal"
---
---The depth test passes when the new depth value is less than the existing one.
---
----| '"less"'
+---| "less"
---
---The depth test passes when the new depth value is less than or equal to the existing one.
---
----| '"lequal"'
+---| "lequal"
---
---The depth test passes when the new depth value is greater than or equal to the existing one.
---
----| '"gequal"'
+---| "gequal"
---
---The depth test passes when the new depth value is greater than the existing one.
---
----| '"greater"'
+---| "greater"
---
---Different coordinate spaces for nodes in a Model.
@@ -2850,11 +2857,11 @@ function Texture:setWrap(horizontal, vertical) end
---
---The coordinate space relative to the node's parent.
---
----| '"local"'
+---| "local"
---
---The coordinate space relative to the root node of the Model.
---
----| '"global"'
+---| "global"
---
---The following shaders are built in to LÖVR, and can be used as an argument to `lovr.graphics.newShader` instead of providing raw GLSL shader code.
@@ -2867,27 +2874,27 @@ function Texture:setWrap(horizontal, vertical) end
---
---A simple shader without lighting, using only colors and a diffuse texture.
---
----| '"unlit"'
+---| "unlit"
---
---A physically-based rendering (PBR) shader, using advanced material properties.
---
----| '"standard"'
+---| "standard"
---
---A shader that renders a cubemap texture.
---
----| '"cube"'
+---| "cube"
---
---A shader that renders a 2D equirectangular texture with spherical coordinates.
---
----| '"pano"'
+---| "pano"
---
---A shader that renders font glyphs.
---
----| '"font"'
+---| "font"
---
---A shader that passes its vertex coordinates unmodified to the fragment shader, used to render view-independent fixed geometry like fullscreen quads.
---
----| '"fill"'
+---| "fill"
---
---Meshes are lists of arbitrary vertices.
@@ -2898,35 +2905,35 @@ function Texture:setWrap(horizontal, vertical) end
---
---Draw each vertex as a single point.
---
----| '"points"'
+---| "points"
---
---The vertices represent a list of line segments. Each pair of vertices will have a line drawn between them.
---
----| '"lines"'
+---| "lines"
---
---The first two vertices have a line drawn between them, and each vertex after that will be connected to the previous vertex with a line.
---
----| '"linestrip"'
+---| "linestrip"
---
---Similar to linestrip, except the last vertex is connected back to the first.
---
----| '"lineloop"'
+---| "lineloop"
---
---The first three vertices define a triangle.
---
---Each vertex after that creates a triangle using the new vertex and last two vertices.
---
----| '"strip"'
+---| "strip"
---
---Each set of three vertices represents a discrete triangle.
---
----| '"triangles"'
+---| "triangles"
---
---Draws a set of triangles.
---
---Each one shares the first vertex as a common point, leading to a fan-like shape.
---
----| '"fan"'
+---| "fan"
---
---Most graphics primitives can be drawn in one of two modes: a filled mode and a wireframe mode.
@@ -2935,11 +2942,11 @@ function Texture:setWrap(horizontal, vertical) end
---
---The shape is drawn as a filled object.
---
----| '"fill"'
+---| "fill"
---
---The shape is drawn as a wireframe object.
---
----| '"line"'
+---| "line"
---
---The method used to downsample (or upsample) a texture.
@@ -2954,15 +2961,15 @@ function Texture:setWrap(horizontal, vertical) end
---
---Leads to a pixelated style.
---
----| '"nearest"'
+---| "nearest"
---
---Smooth pixel sampling.
---
----| '"bilinear"'
+---| "bilinear"
---
---Smooth pixel sampling, with smooth sampling across mipmap levels.
---
----| '"trilinear"'
+---| "trilinear"
---
---Different ways to horizontally align text when using `lovr.graphics.print`.
@@ -2971,15 +2978,15 @@ function Texture:setWrap(horizontal, vertical) end
---
---Left aligned lines of text.
---
----| '"left"'
+---| "left"
---
---Centered aligned lines of text.
---
----| '"center"'
+---| "center"
---
---Right aligned lines of text.
---
----| '"right"'
+---| "right"
---
---The different types of color parameters `Material`s can hold.
@@ -2988,11 +2995,11 @@ function Texture:setWrap(horizontal, vertical) end
---
---The diffuse color.
---
----| '"diffuse"'
+---| "diffuse"
---
---The emissive color.
---
----| '"emissive"'
+---| "emissive"
---
---The different types of float parameters `Material`s can hold.
@@ -3001,11 +3008,11 @@ function Texture:setWrap(horizontal, vertical) end
---
---The constant metalness factor.
---
----| '"metalness"'
+---| "metalness"
---
---The constant roughness factor.
---
----| '"roughness"'
+---| "roughness"
---
---The different types of texture parameters `Material`s can hold.
@@ -3014,31 +3021,31 @@ function Texture:setWrap(horizontal, vertical) end
---
---The diffuse texture.
---
----| '"diffuse"'
+---| "diffuse"
---
---The emissive texture.
---
----| '"emissive"'
+---| "emissive"
---
---The metalness texture.
---
----| '"metalness"'
+---| "metalness"
---
---The roughness texture.
---
----| '"roughness"'
+---| "roughness"
---
---The ambient occlusion texture.
---
----| '"occlusion"'
+---| "occlusion"
---
---The normal map.
---
----| '"normal"'
+---| "normal"
---
---The environment map, should be specified as a cubemap texture.
---
----| '"environment"'
+---| "environment"
---
---Meshes can have a usage hint, describing how they are planning on being updated.
@@ -3049,15 +3056,15 @@ function Texture:setWrap(horizontal, vertical) end
---
---The Mesh contents will rarely change.
---
----| '"static"'
+---| "static"
---
---The Mesh contents will change often.
---
----| '"dynamic"'
+---| "dynamic"
---
---The Mesh contents will change constantly, potentially multiple times each frame.
---
----| '"stream"'
+---| "stream"
---
---Shaders can be used for either rendering operations or generic compute tasks.
@@ -3070,11 +3077,11 @@ function Texture:setWrap(horizontal, vertical) end
---
---A graphics shader.
---
----| '"graphics"'
+---| "graphics"
---
---A compute shader.
---
----| '"compute"'
+---| "compute"
---
---How to modify pixels in the stencil buffer when using `lovr.graphics.stencil`.
@@ -3083,27 +3090,27 @@ function Texture:setWrap(horizontal, vertical) end
---
---Stencil values will be replaced with a custom value.
---
----| '"replace"'
+---| "replace"
---
---Stencil values will increment every time they are rendered to.
---
----| '"increment"'
+---| "increment"
---
---Stencil values will decrement every time they are rendered to.
---
----| '"decrement"'
+---| "decrement"
---
---Similar to `increment`, but the stencil value will be set to 0 if it exceeds 255.
---
----| '"incrementwrap"'
+---| "incrementwrap"
---
---Similar to `decrement`, but the stencil value will be set to 255 if it drops below 0.
---
----| '"decrementwrap"'
+---| "decrementwrap"
---
---Stencil values will be bitwise inverted every time they are rendered to.
---
----| '"invert"'
+---| "invert"
---
---Textures can store their pixels in different formats.
@@ -3114,63 +3121,63 @@ function Texture:setWrap(horizontal, vertical) end
---
---Each pixel is 24 bits, or 8 bits for each channel.
---
----| '"rgb"'
+---| "rgb"
---
---Each pixel is 32 bits, or 8 bits for each channel (including alpha).
---
----| '"rgba"'
+---| "rgba"
---
---An rgba format where the colors occupy 4 bits instead of the usual 8.
---
----| '"rgba4"'
+---| "rgba4"
---
---Each pixel is 64 bits. Each channel is a 16 bit floating point number.
---
----| '"rgba16f"'
+---| "rgba16f"
---
---Each pixel is 128 bits. Each channel is a 32 bit floating point number.
---
----| '"rgba32f"'
+---| "rgba32f"
---
---A 16-bit floating point format with a single color channel.
---
----| '"r16f"'
+---| "r16f"
---
---A 32-bit floating point format with a single color channel.
---
----| '"r32f"'
+---| "r32f"
---
---A 16-bit floating point format with two color channels.
---
----| '"rg16f"'
+---| "rg16f"
---
---A 32-bit floating point format with two color channels.
---
----| '"rg32f"'
+---| "rg32f"
---
---A 16 bit format with 5-bit color channels and a single alpha bit.
---
----| '"rgb5a1"'
+---| "rgb5a1"
---
---A 32 bit format with 10-bit color channels and two alpha bits.
---
----| '"rgb10a2"'
+---| "rgb10a2"
---
---Each pixel is 32 bits, and packs three color channels into 10 or 11 bits each.
---
----| '"rg11b10f"'
+---| "rg11b10f"
---
---A 16 bit depth buffer.
---
----| '"d16"'
+---| "d16"
---
---A 32 bit floating point depth buffer.
---
----| '"d32f"'
+---| "d32f"
---
---A depth buffer with 24 bits for depth and 8 bits for stencil.
---
----| '"d24s8"'
+---| "d24s8"
---
---Different types of Textures.
@@ -3179,19 +3186,19 @@ function Texture:setWrap(horizontal, vertical) end
---
---A 2D texture.
---
----| '"2d"'
+---| "2d"
---
---A 2D array texture with multiple independent 2D layers.
---
----| '"array"'
+---| "array"
---
---A cubemap texture with 6 2D faces.
---
----| '"cube"'
+---| "cube"
---
---A 3D volumetric texture consisting of multiple 2D layers.
---
----| '"volume"'
+---| "volume"
---
---When binding writable resources to shaders using `Shader:sendBlock` and `Shader:sendImage`, an access pattern can be specified as a hint that says whether you plan to read or write to the resource (or both).
@@ -3202,15 +3209,15 @@ function Texture:setWrap(horizontal, vertical) end
---
---The Shader will use the resource in a read-only fashion.
---
----| '"read"'
+---| "read"
---
---The Shader will use the resource in a write-only fashion.
---
----| '"write"'
+---| "write"
---
---The resource will be available for reading and writing.
---
----| '"readwrite"'
+---| "readwrite"
---
---Different ways to vertically align text when using `lovr.graphics.print`.
@@ -3219,15 +3226,15 @@ function Texture:setWrap(horizontal, vertical) end
---
---Align the top of the text to the origin.
---
----| '"top"'
+---| "top"
---
---Vertically center the text.
---
----| '"middle"'
+---| "middle"
---
---Align the bottom of the text to the origin.
---
----| '"bottom"'
+---| "bottom"
---
---Whether the points on triangles are specified in a clockwise or counterclockwise order.
@@ -3236,11 +3243,11 @@ function Texture:setWrap(horizontal, vertical) end
---
---Triangle vertices are specified in a clockwise order.
---
----| '"clockwise"'
+---| "clockwise"
---
---Triangle vertices are specified in a counterclockwise order.
---
----| '"counterclockwise"'
+---| "counterclockwise"
---
---The method used to render textures when texture coordinates are outside of the 0-1 range.
@@ -3249,12 +3256,12 @@ function Texture:setWrap(horizontal, vertical) end
---
---The texture will be clamped at its edges.
---
----| '"clamp"'
+---| "clamp"
---
---The texture repeats.
---
----| '"repeat"'
+---| "repeat"
---
---The texture will repeat, mirroring its appearance each time it repeats.
---
----| '"mirroredrepeat"'
+---| "mirroredrepeat"
diff --git a/meta/3rd/lovr/library/lovr.headset.lua b/meta/3rd/lovr/library/lovr.headset.lua
index 0b70a3ba..419a8180 100644
--- a/meta/3rd/lovr/library/lovr.headset.lua
+++ b/meta/3rd/lovr/library/lovr.headset.lua
@@ -86,7 +86,7 @@ function lovr.headset.getBoundsDimensions() end
---
---Returns a list of points representing the boundaries of the play area, or `nil` if the current headset driver does not expose this information.
---
----@param t? table # A table to fill with the points. If `nil`, a new table will be created.
+---@param t table # A table to fill with the points. If `nil`, a new table will be created.
---@return table points # A flat table of 3D points representing the play area boundaries.
function lovr.headset.getBoundsGeometry(t) end
@@ -627,95 +627,95 @@ function lovr.headset.wasReleased(device, button) end
---
---The headset.
---
----| '"head"'
+---| "head"
---
---The left controller.
---
----| '"hand/left"'
+---| "hand/left"
---
---The right controller.
---
----| '"hand/right"'
+---| "hand/right"
---
---A shorthand for hand/left.
---
----| '"left"'
+---| "left"
---
---A shorthand for hand/right.
---
----| '"right"'
+---| "right"
---
---A device tracking the left elbow.
---
----| '"elbow/left"'
+---| "elbow/left"
---
---A device tracking the right elbow.
---
----| '"elbow/right"'
+---| "elbow/right"
---
---A device tracking the left shoulder.
---
----| '"shoulder/left"'
+---| "shoulder/left"
---
---A device tracking the right shoulder.
---
----| '"shoulder/right"'
+---| "shoulder/right"
---
---A device tracking the chest.
---
----| '"chest"'
+---| "chest"
---
---A device tracking the waist.
---
----| '"waist"'
+---| "waist"
---
---A device tracking the left knee.
---
----| '"knee/left"'
+---| "knee/left"
---
---A device tracking the right knee.
---
----| '"knee/right"'
+---| "knee/right"
---
---A device tracking the left foot or ankle.
---
----| '"foot/left"'
+---| "foot/left"
---
---A device tracking the right foot or ankle.
---
----| '"foot/right"'
+---| "foot/right"
---
---A camera device, often used for recording "mixed reality" footage.
---
----| '"camera"'
+---| "camera"
---
---A tracked keyboard.
---
----| '"keyboard"'
+---| "keyboard"
---
---The left eye.
---
----| '"eye/left"'
+---| "eye/left"
---
---The right eye.
---
----| '"eye/right"'
+---| "eye/right"
---
---The first tracking device (i.e. lighthouse).
---
----| '"beacon/1"'
+---| "beacon/1"
---
---The second tracking device (i.e. lighthouse).
---
----| '"beacon/2"'
+---| "beacon/2"
---
---The third tracking device (i.e. lighthouse).
---
----| '"beacon/3"'
+---| "beacon/3"
---
---The fourth tracking device (i.e. lighthouse).
---
----| '"beacon/4"'
+---| "beacon/4"
---
---Axes on an input device.
@@ -724,19 +724,19 @@ function lovr.headset.wasReleased(device, button) end
---
---A trigger (1D).
---
----| '"trigger"'
+---| "trigger"
---
---A thumbstick (2D).
---
----| '"thumbstick"'
+---| "thumbstick"
---
---A touchpad (2D).
---
----| '"touchpad"'
+---| "touchpad"
---
---A grip button or grab gesture (1D).
---
----| '"grip"'
+---| "grip"
---
---Buttons on an input device.
@@ -745,43 +745,43 @@ function lovr.headset.wasReleased(device, button) end
---
---The trigger button.
---
----| '"trigger"'
+---| "trigger"
---
---The thumbstick.
---
----| '"thumbstick"'
+---| "thumbstick"
---
---The touchpad.
---
----| '"touchpad"'
+---| "touchpad"
---
---The grip button.
---
----| '"grip"'
+---| "grip"
---
---The menu button.
---
----| '"menu"'
+---| "menu"
---
---The A button.
---
----| '"a"'
+---| "a"
---
---The B button.
---
----| '"b"'
+---| "b"
---
---The X button.
---
----| '"x"'
+---| "x"
---
---The Y button.
---
----| '"y"'
+---| "y"
---
---The proximity sensor on a headset.
---
----| '"proximity"'
+---| "proximity"
---
---These are all of the supported VR APIs that LÖVR can use to power the lovr.headset module.
@@ -800,31 +800,31 @@ function lovr.headset.wasReleased(device, button) end
---
---A VR simulator using keyboard/mouse.
---
----| '"desktop"'
+---| "desktop"
---
---Oculus Desktop SDK.
---
----| '"oculus"'
+---| "oculus"
---
---OpenVR.
---
----| '"openvr"'
+---| "openvr"
---
---OpenXR.
---
----| '"openxr"'
+---| "openxr"
---
---Oculus Mobile SDK.
---
----| '"vrapi"'
+---| "vrapi"
---
---Pico.
---
----| '"pico"'
+---| "pico"
---
---WebXR.
---
----| '"webxr"'
+---| "webxr"
---
---Represents the different types of origins for coordinate spaces.
@@ -837,8 +837,8 @@ function lovr.headset.wasReleased(device, button) end
---
---The origin is at the head.
---
----| '"head"'
+---| "head"
---
---The origin is on the floor.
---
----| '"floor"'
+---| "floor"
diff --git a/meta/3rd/lovr/library/lovr.math.lua b/meta/3rd/lovr/library/lovr.math.lua
index 2b3d3059..c53ffac2 100644
--- a/meta/3rd/lovr/library/lovr.math.lua
+++ b/meta/3rd/lovr/library/lovr.math.lua
@@ -60,8 +60,9 @@ function lovr.math.mat4() end
---@param x number # The x coordinate of the first control point.
---@param y number # The y coordinate of the first control point.
---@param z number # The z coordinate of the first control point.
+---@vararg any # Additional control points.
---@return lovr.Curve curve # The new Curve.
-function lovr.math.newCurve(x, y, z) end
+function lovr.math.newCurve(x, y, z, ...) end
---
---Creates a new 4D matrix.
@@ -406,7 +407,7 @@ function Mat4:perspective(near, far, fov, aspect) end
---
---Rotates the matrix using a quaternion or an angle/axis rotation.
---
----@overload fun(self: lovr.Mat4, angle: number, ax: number, ay: number, az: number):lovr.Mat4
+---@overload fun(self: lovr.Mat4, angle: number, ax?: number, ay?: number, az?: number):lovr.Mat4
---@param q lovr.Quat # The rotation to apply to the matrix.
---@return lovr.Mat4 m # The original matrix.
function Mat4:rotate(q) end
@@ -414,7 +415,7 @@ function Mat4:rotate(q) end
---
---Scales the matrix.
---
----@overload fun(self: lovr.Mat4, sx: number, sy: number, sz: number):lovr.Mat4
+---@overload fun(self: lovr.Mat4, sx: number, sy?: number, sz?: number):lovr.Mat4
---@param scale lovr.Vec3 # The 3D scale to apply.
---@return lovr.Mat4 m # The original matrix.
function Mat4:scale(scale) end
@@ -423,8 +424,8 @@ function Mat4:scale(scale) end
---Sets the components of the matrix from separate position, rotation, and scale arguments or an existing matrix.
---
---@overload fun(self: lovr.Mat4, n: lovr.mat4):lovr.Mat4
----@overload fun(self: lovr.Mat4, position: lovr.Vec3, scale: lovr.Vec3, rotation: lovr.Quat):lovr.Mat4
----@overload fun(self: lovr.Mat4, position: lovr.Vec3, rotation: lovr.Quat):lovr.Mat4
+---@overload fun(self: lovr.Mat4, position?: lovr.Vec3, scale?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4
+---@overload fun(self: lovr.Mat4, position?: lovr.Vec3, rotation?: lovr.Quat):lovr.Mat4
---@overload fun(self: lovr.Mat4, ...):lovr.Mat4
---@overload fun(self: lovr.Mat4, d: number):lovr.Mat4
---@return lovr.Mat4 m # The input matrix.
@@ -652,7 +653,7 @@ local Vec2 = {}
---
---Adds a vector or a number to the vector.
---
----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2
+---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2
---@param u lovr.Vec2 # The other vector.
---@return lovr.Vec2 v # The original vector.
function Vec2:add(u) end
@@ -682,7 +683,7 @@ function Vec2:distance(u) end
---
---Divides the vector by a vector or a number.
---
----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2
+---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2
---@param u lovr.Vec2 # The other vector to divide the components by.
---@return lovr.Vec2 v # The original vector.
function Vec2:div(u) end
@@ -739,7 +740,7 @@ function Vec2:lerp() end
---
---Multiplies the vector by a vector or a number.
---
----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2
+---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2
---@param u lovr.Vec2 # The other vector to multiply the components by.
---@return lovr.Vec2 v # The original vector.
function Vec2:mul(u) end
@@ -762,7 +763,7 @@ function Vec2:set(x, y) end
---
---Subtracts a vector or a number from the vector.
---
----@overload fun(self: lovr.Vec2, x: number, y: number):lovr.Vec2
+---@overload fun(self: lovr.Vec2, x: number, y?: number):lovr.Vec2
---@param u lovr.Vec2 # The other vector.
---@return lovr.Vec2 v # The original vector.
function Vec2:sub(u) end
@@ -783,7 +784,7 @@ local Vec3 = {}
---
---Adds a vector or a number to the vector.
---
----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3
+---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3
---@param u lovr.Vec3 # The other vector.
---@return lovr.Vec3 v # The original vector.
function Vec3:add(u) end
@@ -827,7 +828,7 @@ function Vec3:distance(u) end
---
---Divides the vector by a vector or a number.
---
----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3
+---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3
---@param u lovr.Vec3 # The other vector to divide the components by.
---@return lovr.Vec3 v # The original vector.
function Vec3:div(u) end
@@ -886,7 +887,7 @@ function Vec3:lerp(u, t) end
---
---Multiplies the vector by a vector or a number.
---
----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3
+---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3
---@param u lovr.Vec3 # The other vector to multiply the components by.
---@return lovr.Vec3 v # The original vector.
function Vec3:mul(u) end
@@ -911,7 +912,7 @@ function Vec3:set(x, y, z) end
---
---Subtracts a vector or a number from the vector.
---
----@overload fun(self: lovr.Vec3, x: number, y: number, z: number):lovr.Vec3
+---@overload fun(self: lovr.Vec3, x: number, y?: number, z?: number):lovr.Vec3
---@param u lovr.Vec3 # The other vector.
---@return lovr.Vec3 v # The original vector.
function Vec3:sub(u) end
@@ -933,7 +934,7 @@ local Vec4 = {}
---
---Adds a vector or a number to the vector.
---
----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4
+---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4
---@param u lovr.Vec4 # The other vector.
---@return lovr.Vec4 v # The original vector.
function Vec4:add(u) end
@@ -963,7 +964,7 @@ function Vec4:distance(u) end
---
---Divides the vector by a vector or a number.
---
----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4
+---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4
---@param u lovr.Vec4 # The other vector to divide the components by.
---@return lovr.Vec4 v # The original vector.
function Vec4:div(u) end
@@ -1022,7 +1023,7 @@ function Vec4:lerp(u, t) end
---
---Multiplies the vector by a vector or a number.
---
----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4
+---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4
---@param u lovr.Vec4 # The other vector to multiply the components by.
---@return lovr.Vec4 v # The original vector.
function Vec4:mul(u) end
@@ -1047,7 +1048,7 @@ function Vec4:set(x, y, z, w) end
---
---Subtracts a vector or a number from the vector.
---
----@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):lovr.Vec4
+---@overload fun(self: lovr.Vec4, x: number, y?: number, z?: number, w?: number):lovr.Vec4
---@param u lovr.Vec4 # The other vector.
---@return lovr.Vec4 v # The original vector.
function Vec4:sub(u) end
diff --git a/meta/3rd/lovr/library/lovr.physics.lua b/meta/3rd/lovr/library/lovr.physics.lua
index b2fb22f4..d081d2f4 100644
--- a/meta/3rd/lovr/library/lovr.physics.lua
+++ b/meta/3rd/lovr/library/lovr.physics.lua
@@ -139,7 +139,7 @@ function lovr.physics.newSphereShape(radius) end
---@param yg? number # The y component of the gravity force.
---@param zg? number # The z component of the gravity force.
---@param allowSleep? boolean # Whether or not colliders will automatically be put to sleep.
----@param tags? table # A list of collision tags colliders can be assigned to.
+---@param tags table # A list of collision tags colliders can be assigned to.
---@return lovr.World world # A whole new World.
function lovr.physics.newWorld(xg, yg, zg, allowSleep, tags) end
@@ -1676,19 +1676,19 @@ function World:update(dt, resolver) end
---
---A BallJoint.
---
----| '"ball"'
+---| "ball"
---
---A DistanceJoint.
---
----| '"distance"'
+---| "distance"
---
---A HingeJoint.
---
----| '"hinge"'
+---| "hinge"
---
---A SliderJoint.
---
----| '"slider"'
+---| "slider"
---
---Represents the different types of physics Shapes available.
@@ -1697,16 +1697,16 @@ function World:update(dt, resolver) end
---
---A BoxShape.
---
----| '"box"'
+---| "box"
---
---A CapsuleShape.
---
----| '"capsule"'
+---| "capsule"
---
---A CylinderShape.
---
----| '"cylinder"'
+---| "cylinder"
---
---A SphereShape.
---
----| '"sphere"'
+---| "sphere"
diff --git a/meta/3rd/lovr/library/lovr.system.lua b/meta/3rd/lovr/library/lovr.system.lua
index 35161332..b3be6d49 100644
--- a/meta/3rd/lovr/library/lovr.system.lua
+++ b/meta/3rd/lovr/library/lovr.system.lua
@@ -37,4 +37,4 @@ function lovr.system.requestPermission(permission) end
---
---Requests microphone access.
---
----| '"audiocapture"'
+---| "audiocapture"
diff --git a/script/config/config.lua b/script/config/config.lua
index 1dda8c0b..46e80994 100644
--- a/script/config/config.lua
+++ b/script/config/config.lua
@@ -167,6 +167,9 @@ local Template = {
>> util.deepCopy(define.DiagnosticDefaultSeverity),
['Lua.diagnostics.neededFileStatus'] = Type.Hash(Type.String, Type.String)
>> util.deepCopy(define.DiagnosticDefaultNeededFileStatus),
+ ['Lua.diagnostics.disableScheme'] = Type.Hash(Type.String, Type.Boolean, ';') >> {
+ ['git'] = true,
+ },
['Lua.diagnostics.workspaceDelay'] = Type.Integer >> 5,
['Lua.diagnostics.workspaceRate'] = Type.Integer >> 100,
['Lua.diagnostics.libraryFiles'] = Type.String >> 'Opened',
@@ -179,6 +182,11 @@ local Template = {
['Lua.workspace.library'] = Type.Hash(Type.String, Type.Boolean, ';'),
['Lua.workspace.checkThirdParty'] = Type.Boolean >> true,
['Lua.workspace.userThirdParty'] = Type.Array(Type.String),
+ ['Lua.workspace.supportScheme'] = Type.Hash(Type.String, Type.Boolean, ';') >> {
+ ['file'] = true,
+ ['untitled'] = true,
+ ['git'] = true,
+ },
['Lua.completion.enable'] = Type.Boolean >> true,
['Lua.completion.callSnippet'] = Type.String >> 'Disable',
['Lua.completion.keywordSnippet'] = Type.String >> 'Replace',
@@ -214,6 +222,8 @@ local Template = {
>> {},
['Lua.spell.dict'] = Type.Array(Type.String),
['Lua.telemetry.enable'] = Type.Or(Type.Boolean >> false, Type.Nil) >> nil,
+
+ -- VSCode
['files.associations'] = Type.Hash(Type.String, Type.String),
['files.exclude'] = Type.Hash(Type.String, Type.Boolean),
['editor.semanticHighlighting.enabled'] = Type.Or(Type.Boolean, Type.String),
@@ -425,7 +435,7 @@ function m.update(scp, ...)
local news = table.pack(...)
for i = 1, news.n do
- if news[i] then
+ if type(news[i]) == 'table' then
expand(news[i])
end
end
diff --git a/script/core/code-action.lua b/script/core/code-action.lua
index 09b271c6..116fff24 100644
--- a/script/core/code-action.lua
+++ b/script/core/code-action.lua
@@ -333,6 +333,8 @@ local function solveAwaitInSync(uri, diag, results)
end
local row = guide.rowColOf(parentFunction.start)
local pos = guide.positionOf(row, 0)
+ local offset = guide.positionToOffset(state, pos + 1)
+ local space = state.lua:match('[ \t]*', offset)
results[#results+1] = {
title = lang.script.ACTION_MARK_ASYNC,
kind = 'quickfix',
@@ -342,7 +344,7 @@ local function solveAwaitInSync(uri, diag, results)
{
start = pos,
finish = pos,
- newText = '---@async\n',
+ newText = space .. '---@async\n',
}
}
}
diff --git a/script/core/folding.lua b/script/core/folding.lua
index 4f93aed9..0034313a 100644
--- a/script/core/folding.lua
+++ b/script/core/folding.lua
@@ -66,7 +66,8 @@ local care = {
['repeat'] = function (source, text, results)
local start = source.start
local finish = source.keyword[#source.keyword]
- if text:sub(finish - #'until' + 1, finish) ~= 'until' then
+ -- must end with 'until'
+ if #source.keyword ~= 4 then
return
end
local folding = {
@@ -143,6 +144,15 @@ local care = {
}
results[#results+1] = folding
end,
+ ['doc.alias'] = function (source, text, results)
+ local folding = {
+ start = source.start,
+ finish = source.bindGroup[#source.bindGroup].finish,
+ kind = 'comment',
+ hideLastLine = true,
+ }
+ results[#results+1] = folding
+ end
}
---@async
diff --git a/script/glob/gitignore.lua b/script/glob/gitignore.lua
index 4dad2747..a6a3df3e 100644
--- a/script/glob/gitignore.lua
+++ b/script/glob/gitignore.lua
@@ -164,8 +164,9 @@ function mt:getRelativePath(path)
end
---@param callback async fun(path: string)
+---@param hook? async fun(ev: string, ...)
---@async
-function mt:scan(path, callback)
+function mt:scan(path, callback, hook)
local files = {}
if type(callback) ~= 'function' then
callback = nil
@@ -203,6 +204,9 @@ function mt:scan(path, callback)
break
end
list[#list] = nil
+ if hook then
+ hook('scan', current)
+ end
if not self:simpleMatch(current) then
check(current)
end
diff --git a/script/lclient.lua b/script/lclient.lua
index ad1fff3d..ce47a816 100644
--- a/script/lclient.lua
+++ b/script/lclient.lua
@@ -208,6 +208,7 @@ function mt:registerFakers()
'textDocument/publishDiagnostics',
'workspace/configuration',
'workspace/semanticTokens/refresh',
+ 'workspace/diagnostic/refresh',
'window/workDoneProgress/create',
'window/showMessage',
'window/logMessage',
diff --git a/script/library.lua b/script/library.lua
index 66c4d364..c7b9ea9a 100644
--- a/script/library.lua
+++ b/script/library.lua
@@ -477,6 +477,9 @@ local function check3rd(uri)
if hasAsked then
return
end
+ if not ws.isReady(uri) then
+ return
+ end
if not config.get(uri, 'Lua.workspace.checkThirdParty') then
return
end
diff --git a/script/proto/define.lua b/script/proto/define.lua
index 13ae05e2..52006992 100644
--- a/script/proto/define.lua
+++ b/script/proto/define.lua
@@ -262,6 +262,7 @@ m.TokenTypes = {
["number"] = 19,
["regexp"] = 20,
["operator"] = 21,
+ ["decorator"] = 22,
}
m.BuiltIn = {
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua
index 15b08d49..076a613e 100644
--- a/script/provider/diagnostic.lua
+++ b/script/provider/diagnostic.lua
@@ -14,6 +14,9 @@ local loading = require 'workspace.loading'
local scope = require 'workspace.scope'
local time = require 'bee.time'
local ltable = require 'linked-table'
+local furi = require 'file-uri'
+local json = require 'json'
+local fw = require 'filewatch'
---@class diagnosticProvider
local m = {}
@@ -154,6 +157,18 @@ function m.clearCache(uri)
m.cache[uri] = false
end
+function m.clearCacheExcept(uris)
+ local excepts = {}
+ for _, uri in ipairs(uris) do
+ excepts[uri] = true
+ end
+ for uri in pairs(m.cache) do
+ if not excepts[uri] then
+ m.cache[uri] = false
+ end
+ end
+end
+
function m.clearAll()
for luri in pairs(m.cache) do
m.clear(luri)
@@ -193,30 +208,45 @@ local function copyDiagsWithoutSyntax(diags)
end
---@async
-function m.doDiagnostic(uri, isScopeDiag)
+---@param uri uri
+---@return boolean
+local function isValid(uri)
if not config.get(uri, 'Lua.diagnostics.enable') then
- return
+ return false
end
if files.isLibrary(uri, true) then
local status = config.get(uri, 'Lua.diagnostics.libraryFiles')
if status == 'Disable' then
- return
+ return false
elseif status == 'Opened' then
if not files.isOpen(uri) then
- return
+ return false
end
end
end
if ws.isIgnored(uri) then
local status = config.get(uri, 'Lua.diagnostics.ignoredFiles')
if status == 'Disable' then
- return
+ return false
elseif status == 'Opened' then
if not files.isOpen(uri) then
- return
+ return false
end
end
end
+ local scheme = furi.split(uri)
+ local disableScheme = config.get(uri, 'Lua.diagnostics.disableScheme')
+ if disableScheme[scheme] then
+ return false
+ end
+ return true
+end
+
+---@async
+function m.doDiagnostic(uri, isScopeDiag)
+ if not isValid(uri) then
+ return
+ end
await.delay()
@@ -287,6 +317,42 @@ function m.doDiagnostic(uri, isScopeDiag)
pushResult()
end
+---@async
+---@return table|nil result
+---@return boolean? unchanged
+function m.pullDiagnostic(uri, isScopeDiag)
+ if not isValid(uri) then
+ return nil, util.equal(m.cache[uri], nil)
+ end
+
+ await.delay()
+
+ local state = files.getState(uri)
+ if not state then
+ return nil, util.equal(m.cache[uri], nil)
+ end
+
+ local prog <close> = progress.create(uri, lang.script.WINDOW_DIAGNOSING, 0.5)
+ prog:setMessage(ws.getRelativePath(uri))
+
+ local syntax = m.syntaxErrors(uri, state)
+ local diags = {}
+
+ xpcall(core, log.error, uri, isScopeDiag, function (result)
+ diags[#diags+1] = buildDiagnostic(uri, result)
+ end)
+
+ local full = mergeDiags(syntax, diags)
+
+ if util.equal(m.cache[uri], full) then
+ return full, true
+ end
+
+ m.cache[uri] = full
+
+ return full
+end
+
function m.refresh(uri)
if not ws.isReady(uri) then
return
@@ -359,7 +425,7 @@ local function askForDisable(uri)
end
---@async
-function m.awaitDiagnosticsScope(suri)
+function m.awaitDiagnosticsScope(suri, callback)
local scp = scope.getScope(suri)
while loading.count() > 0 do
await.sleep(1.0)
@@ -393,7 +459,7 @@ function m.awaitDiagnosticsScope(suri)
i = i + 1
bar:setMessage(('%d/%d'):format(i, #uris))
bar:setPercentage(i / #uris * 100)
- xpcall(m.doDiagnostic, log.error, uri, true)
+ callback(uri)
await.delay()
if cancelled then
log.info('Break workspace diagnostics')
@@ -416,13 +482,65 @@ function m.diagnosticsScope(uri, force)
local id = 'diagnosticsScope:' .. scp:getName()
await.close(id)
await.call(function () ---@async
- m.awaitDiagnosticsScope(uri)
+ m.awaitDiagnosticsScope(uri, function (fileUri)
+ xpcall(m.doDiagnostic, log.error, fileUri, true)
+ end)
end, id)
end
+---@async
+function m.pullDiagnosticScope(callback)
+ local processing = 0
+
+ for _, scp in ipairs(scope.folders) do
+ if ws.isReady(scp.uri)
+ and config.get(scp.uri, 'Lua.diagnostics.enable') then
+ local id = 'diagnosticsScope:' .. scp:getName()
+ await.close(id)
+ await.call(function () ---@async
+ processing = processing + 1
+ local _ <close> = util.defer(function ()
+ processing = processing - 1
+ end)
+
+ local delay = config.get(scp.uri, 'Lua.diagnostics.workspaceDelay') / 1000
+ if delay < 0 then
+ return
+ end
+ print(delay)
+ await.sleep(math.max(delay, 0.2))
+ print('start')
+
+ m.awaitDiagnosticsScope(scp.uri, function (fileUri)
+ local suc, result, unchanged = xpcall(m.pullDiagnostic, log.error, fileUri, true)
+ if suc then
+ callback {
+ uri = fileUri,
+ result = result,
+ unchanged = unchanged,
+ version = files.getVersion(fileUri),
+ }
+ end
+ end)
+ end, id)
+ end
+ end
+
+ -- sleep for ever
+ while true do
+ await.sleep(1.0)
+ end
+end
+
+function m.refreshClient()
+ log.debug('Refresh client diagnostics')
+ proto.request('workspace/diagnostic/refresh', json.null)
+end
+
ws.watch(function (ev, uri)
if ev == 'reload' then
m.diagnosticsScope(uri)
+ m.refreshClient()
end
end)
@@ -449,6 +567,16 @@ config.watch(function (uri, key, value, oldValue)
if key:find 'Lua.diagnostics' then
if value ~= oldValue then
m.diagnosticsScope(uri)
+ m.refreshClient()
+ end
+ end
+end)
+
+fw.event(function (ev, path)
+ if util.stringEndWith(path, '.editorconfig') then
+ for _, scp in ipairs(ws.folders) do
+ m.diagnosticsScope(scp.uri)
+ m.refreshClient()
end
end
end)
diff --git a/script/provider/formatting.lua b/script/provider/formatting.lua
index 2c8a222e..da31ef65 100644
--- a/script/provider/formatting.lua
+++ b/script/provider/formatting.lua
@@ -30,9 +30,6 @@ fw.event(function(ev, path)
end
end
end
- for _, scp in ipairs(ws.folders) do
- diagnostics.diagnosticsScope(scp.uri)
- end
end
end)
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 08b6ca93..af78cd26 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -236,9 +236,10 @@ m.register 'workspace/didRenameFiles' {
m.register 'textDocument/didOpen' {
function (params)
- local doc = params.textDocument
- local scheme = furi.split(doc.uri)
- if scheme ~= 'file' then
+ local doc = params.textDocument
+ local scheme = furi.split(doc.uri)
+ local supports = config.get(doc.uri, 'Lua.workspace.supportScheme')
+ if not supports[scheme] then
return
end
local uri = files.getRealUri(doc.uri)
@@ -265,9 +266,10 @@ m.register 'textDocument/didClose' {
m.register 'textDocument/didChange' {
function (params)
- local doc = params.textDocument
- local scheme = furi.split(doc.uri)
- if scheme ~= 'file' then
+ local doc = params.textDocument
+ local scheme = furi.split(doc.uri)
+ local supports = config.get(doc.uri, 'Lua.workspace.supportScheme')
+ if not supports[scheme] then
return
end
local changes = params.contentChanges
@@ -1210,6 +1212,94 @@ m.register 'inlayHint/resolve' {
end
}
+m.register 'textDocument/diagnostic' {
+ preview = true,
+ capability = {
+ diagnosticProvider = {
+ identifier = 'identifier',
+ interFileDependencies = true,
+ workspaceDiagnostics = false,
+ }
+ },
+ ---@async
+ function (params)
+ local uri = files.getRealUri(params.textDocument.uri)
+ workspace.awaitReady(uri)
+ local core = require 'provider.diagnostic'
+ -- TODO: do some trick
+ core.refresh(uri)
+
+ return {
+ kind = 'unchanged',
+ resultId = uri,
+ }
+
+ --if not params.previousResultId then
+ -- core.clearCache(uri)
+ --end
+ --local results, unchanged = core.pullDiagnostic(uri, false)
+ --if unchanged then
+ -- return {
+ -- kind = 'unchanged',
+ -- resultId = uri,
+ -- }
+ --else
+ -- return {
+ -- kind = 'full',
+ -- resultId = uri,
+ -- items = results or {},
+ -- }
+ --end
+ end
+}
+
+m.register 'workspace/diagnostic' {
+ --preview = true,
+ --capability = {
+ -- diagnosticProvider = {
+ -- workspaceDiagnostics = false,
+ -- }
+ --},
+ ---@async
+ function (params)
+ local core = require 'provider.diagnostic'
+ local excepts = {}
+ for _, id in ipairs(params.previousResultIds) do
+ excepts[#excepts+1] = id.value
+ end
+ core.clearCacheExcept(excepts)
+ local function convertItem(result)
+ if result.unchanged then
+ return {
+ kind = 'unchanged',
+ resultId = result.uri,
+ uri = result.uri,
+ version = result.version,
+ }
+ else
+ return {
+ kind = 'full',
+ resultId = result.uri,
+ items = result.result or {},
+ uri = result.uri,
+ version = result.version,
+ }
+ end
+ end
+ core.pullDiagnosticScope(function (result)
+ proto.notify('$/progress', {
+ token = params.partialResultToken,
+ value = {
+ items = {
+ convertItem(result)
+ }
+ }
+ })
+ end)
+ return { items = {} }
+ end
+}
+
local function refreshStatusBar()
local valid = config.get(nil, 'Lua.window.statusBar')
for _, scp in ipairs(workspace.folders) do
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 6c95b5bd..cd2b602d 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -533,7 +533,7 @@ end
-- 该函数有副作用,会给source绑定node!
local function bindDocs(source)
local isParam = source.parent.type == 'funcargs'
- or source.parent.type == 'in'
+ or (source.parent.type == 'in' and source.finish <= source.parent.keys.finish)
local docs = source.bindDocs
for i = #docs, 1, -1 do
local doc = docs[i]
diff --git a/script/vm/generic.lua b/script/vm/generic.lua
index 6462028e..fafda518 100644
--- a/script/vm/generic.lua
+++ b/script/vm/generic.lua
@@ -15,6 +15,9 @@ mt.type = 'generic'
---@param resolved? table<string, vm.node>
---@return parser.object | vm.node
local function cloneObject(source, resolved)
+ if not source then
+ return nil
+ end
if not resolved then
return source
end
diff --git a/script/vm/ref.lua b/script/vm/ref.lua
index 545c294a..fbb9d015 100644
--- a/script/vm/ref.lua
+++ b/script/vm/ref.lua
@@ -279,10 +279,22 @@ local function searchByDef(source, pushResult)
defMap[source] = true
return defMap
end
- local defs = vm.getDefs(source)
- for _, def in ipairs(defs) do
- pushResult(def)
- defMap[def] = true
+ if source.type == 'field'
+ or source.type == 'method' then
+ source = source.parent
+ end
+ defMap[source] = true
+ if guide.isSet(source) then
+ local defs = vm.getDefs(source)
+ for _, def in ipairs(defs) do
+ pushResult(def)
+ end
+ else
+ local defs = vm.getDefs(source)
+ for _, def in ipairs(defs) do
+ pushResult(def)
+ defMap[def] = true
+ end
end
return defMap
end
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua
index 33f8784d..33252b9d 100644
--- a/script/workspace/workspace.lua
+++ b/script/workspace/workspace.lua
@@ -13,6 +13,7 @@ local fw = require 'filewatch'
local scope = require 'workspace.scope'
local loading = require 'workspace.loading'
local inspect = require 'inspect'
+local lang = require 'language'
---@class workspace
local m = {}
@@ -46,6 +47,11 @@ end
--- 初始化工作区
function m.create(uri)
log.info('Workspace create: ', uri)
+ if uri == furi.encode '/'
+ or uri == furi.encode(os.getenv 'HOME') then
+ client.showMessage('Error', lang.script('WORKSPACE_NOT_ALLOWED', furi.decode(uri)))
+ return
+ end
local path = m.normalize(furi.decode(uri))
fw.watch(path)
local scp = scope.createFolder(uri)
@@ -283,22 +289,34 @@ function m.awaitPreload(scp)
if scp.uri then
log.info('Scan files at:', scp:getName())
+ local count = 0
---@async
native:scan(furi.decode(scp.uri), function (path)
local uri = files.getRealUri(furi.encode(path))
scp:get('cachedUris')[uri] = true
ld:loadFile(uri)
+ end, function () ---@async
+ count = count + 1
+ if count == 100000 then
+ client.showMessage('Warning', lang.script('WORKSPACE_SCAN_TOO_MUCH', count, furi.decode(scp.uri)))
+ end
end)
end
for _, libMatcher in ipairs(librarys) do
log.info('Scan library at:', libMatcher.uri)
+ local count = 0
scp:addLink(libMatcher.uri)
---@async
libMatcher.matcher:scan(furi.decode(libMatcher.uri), function (path)
local uri = files.getRealUri(furi.encode(path))
scp:get('cachedUris')[uri] = true
ld:loadFile(uri, libMatcher.uri)
+ end, function () ---@async
+ count = count + 1
+ if count == 100000 then
+ client.showMessage('Warning', lang.script('WORKSPACE_SCAN_TOO_MUCH', count, furi.decode(libMatcher.uri)))
+ end
end)
scp:gc(fw.watch(furi.decode(libMatcher.uri)))
end
@@ -353,6 +371,7 @@ function m.normalize(path)
if platform.OS == 'Windows' then
path = path:gsub('[/\\]+', '\\')
:gsub('[/\\]+$', '')
+ :gsub('^(%a:)$', '%1\\')
else
path = path:gsub('[/\\]+', '/')
:gsub('[/\\]+$', '')
diff --git a/test/references/common.lua b/test/references/common.lua
index 5217200d..47dfb099 100644
--- a/test/references/common.lua
+++ b/test/references/common.lua
@@ -184,3 +184,13 @@ local <~t~>
--b.<~x~> = 1
--c.<!x!> = 1
--]]
+
+TEST [[
+---@class a
+local a = { }
+---@class b
+local b = { }
+
+a.color = { 1, 1, 1 }
+b.<~color~> = a.color
+]]
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 947b97b3..5f54cebf 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2323,3 +2323,29 @@ end
local <?z?> = f()
]]
+
+TEST 'number' [[
+for _ in _ do
+ ---@type number
+ local <?x?>
+end
+]]
+
+TEST 'unknown' [[
+for _ in _ do
+ ---@param x number
+ local <?x?>
+end
+]]
+
+TEST 'unknown' [[
+---@type number
+for <?x?> in _ do
+end
+]]
+
+TEST 'number' [[
+---@param x number
+for <?x?> in _ do
+end
+]]
diff --git a/tools/love-api.lua b/tools/love-api.lua
index 54369acb..7300ccc3 100644
--- a/tools/love-api.lua
+++ b/tools/love-api.lua
@@ -50,6 +50,22 @@ local function formatIndex(key)
return ('[%q]'):format(key)
end
+local function getOptional(param)
+ if param.type == 'table' then
+ if not param.table then
+ return ''
+ end
+ for _, field in ipairs(param.table) do
+ if field.default == nil then
+ return ''
+ end
+ end
+ return '?'
+ else
+ return (param.default ~= nil) and '?' or ''
+ end
+end
+
local buildType
local function buildDocTable(tbl)
@@ -112,9 +128,9 @@ local function buildDocFunc(variant, overload)
params[#params+1] = '...'
else
if param.name:find '^[\'"]' then
- params[#params+1] = ('%s: %s|%q'):format(param.name:sub(2, -2), getTypeName(param.type), param.name)
+ params[#params+1] = ('%s%s: %s|%s'):format(param.name, getOptional(param), getTypeName(param.type), param.name)
else
- params[#params+1] = ('%s: %s'):format(param.name, getTypeName(param.type))
+ params[#params+1] = ('%s%s: %s'):format(param.name, getOptional(param), getTypeName(param.type))
end
end
end
@@ -148,7 +164,15 @@ local function buildFunction(func, node, typeName)
params[#params+1] = paramName
text[#text+1] = ('---@param %s%s %s # %s'):format(
paramName,
- param.default == nil and '' or '?',
+ getOptional(param),
+ buildType(param),
+ param.description
+ )
+ end
+
+ if param.name == "..." then
+ params[#params+1] = param.name
+ text[#text+1] = ('---@vararg %s # %s'):format(
buildType(param),
param.description
)
@@ -216,7 +240,7 @@ local function buildFile(class, defs)
text[#text+1] = ('---@alias %s'):format(getTypeName(enum.name))
for _, constant in ipairs(enum.constants) do
text[#text+1] = buildDescription(constant.description, constant.notes)
- text[#text+1] = ([[---| '%s']]):format(('%q'):format(constant.name):gsub("'", "\\'"))
+ text[#text+1] = ([[---| %q]]):format(constant.name)
end
end
diff --git a/tools/lovr-api.lua b/tools/lovr-api.lua
index ca7c414e..f045afa8 100644
--- a/tools/lovr-api.lua
+++ b/tools/lovr-api.lua
@@ -51,6 +51,22 @@ local function formatIndex(key)
return ('[%q]'):format(key)
end
+local function getOptional(param)
+ if param.type == 'table' then
+ if not param.table then
+ return ''
+ end
+ for _, field in ipairs(param.table) do
+ if field.default == nil then
+ return ''
+ end
+ end
+ return '?'
+ else
+ return (param.default ~= nil) and '?' or ''
+ end
+end
+
local buildType
local function buildDocTable(tbl)
@@ -116,9 +132,9 @@ local function buildDocFunc(variant, overload)
params[#params+1] = '...'
else
if param.name:find '^[\'"]' then
- params[#params+1] = ('%s: %s|%q'):format(param.name:sub(2, -2), getTypeName(param.type), param.name)
+ params[#params+1] = ('%s%s: %s|%s'):format(param.name, getOptional(param), getTypeName(param.type), param.name)
else
- params[#params+1] = ('%s: %s'):format(param.name, getTypeName(param.type))
+ params[#params+1] = ('%s%s: %s'):format(param.name, getOptional(param), getTypeName(param.type))
end
end
end
@@ -152,7 +168,15 @@ local function buildFunction(func, typeName)
params[#params+1] = paramName
text[#text+1] = ('---@param %s%s %s # %s'):format(
paramName,
- param.default == nil and '' or '?',
+ getOptional(param),
+ buildType(param),
+ param.description
+ )
+ end
+
+ if param.name == "..." then
+ params[#params+1] = param.name
+ text[#text+1] = ('---@vararg %s # %s'):format(
buildType(param),
param.description
)
@@ -211,7 +235,7 @@ local function buildFile(defs)
text[#text+1] = ('---@alias %s'):format(getTypeName(enum.name))
for _, constant in ipairs(enum.values) do
text[#text+1] = buildDescription(constant.description, constant.notes)
- text[#text+1] = ([[---| '%s']]):format(('%q'):format(constant.name):gsub("'", "\\'"))
+ text[#text+1] = ([[---| %q]]):format(constant.name)
end
end