From 9bbe7a925f0aa3a7cff981933dd48e5fe0533452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 5 Aug 2022 17:39:13 +0800 Subject: [PATCH 001/965] update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/bee.lua | 2 +- 3rd/luamake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index eda85bbac..603456179 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit eda85bbaceee4f98cac87ef77870b236ac3b0997 +Subproject commit 6034561790f28147a8f4112d7d764863c5aeaf28 diff --git a/3rd/bee.lua b/3rd/bee.lua index 4b7e3d724..a77f313e4 160000 --- a/3rd/bee.lua +++ b/3rd/bee.lua @@ -1 +1 @@ -Subproject commit 4b7e3d724d9d64836b0823dfc7ccc1a4713b6421 +Subproject commit a77f313e44f9d5f0b2be47539009d3ed2427ba26 diff --git a/3rd/luamake b/3rd/luamake index 074888f8e..cae5b44eb 160000 --- a/3rd/luamake +++ b/3rd/luamake @@ -1 +1 @@ -Subproject commit 074888f8e5a47e109fc92257508d7b40ea7cceb8 +Subproject commit cae5b44ebd580108dc06391b44279176ffeba3f0 From 819ca34144213cc2a65faf91915d50d9b42f47f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 5 Aug 2022 17:40:55 +0800 Subject: [PATCH 002/965] `main` is treated as async --- script/vm/doc.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/vm/doc.lua b/script/vm/doc.lua index c3b924d22..293cf5c31 100644 --- a/script/vm/doc.lua +++ b/script/vm/doc.lua @@ -164,6 +164,9 @@ local function isAsync(value) value._async = false return false end + if value.type == 'main' then + return true + end return value.async == true end From 2cd35f5a0877bc0abbc6ecc2cc27f2136cfe448f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 5 Aug 2022 17:48:56 +0800 Subject: [PATCH 003/965] pass tests --- test/diagnostics/common.lua | 56 +++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index e10ac52cc..f7cbbb0dc 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -1359,9 +1359,11 @@ local function f(cb) cb() end -(function () ---@async - return nil -end) +return function() + (function () ---@async + return nil + end) +end ]] TEST [[ @@ -1369,9 +1371,11 @@ local function f(cb) pcall(cb) end -(function () ---@async - return nil -end) +return function() + (function () ---@async + return nil + end) +end ]] TEST [[ @@ -1380,9 +1384,11 @@ local function f(c) return c end -f(function () ---@async - return nil -end) +return function () + f(function () ---@async + return nil + end) +end ]] TEST [[ @@ -1391,9 +1397,11 @@ local function f(...) return ... end -f(function () ---@async - return nil -end) +return function () + f(function () ---@async + return nil + end) +end ]] TEST [[ @@ -1402,9 +1410,11 @@ local function f(...) return ... end -f(function () ---@async - return nil -end) +return function () + f(function () ---@async + return nil + end) +end ]] TEST [[ @@ -1412,9 +1422,11 @@ local function f(...) return ... end -f(function () ---@async - return nil -end) +return function () + f(function () ---@async + return nil + end) +end ]] TEST [[ @@ -1422,9 +1434,11 @@ local function f(...) return ... end -f(1, function () ---@async - return nil -end) +return function () + f(function () ---@async + return nil + end) +end ]] TEST [[ From e22adc461f0743614bfdd6bdb8ce4d91ad6ba596 Mon Sep 17 00:00:00 2001 From: carsakiller <61925890+carsakiller@users.noreply.github.com> Date: Fri, 5 Aug 2022 21:28:48 -0400 Subject: [PATCH 004/965] fix #1444 Replaced SVGs in README with PNGs so they can display in VS Code properly --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b51ae7db2..652ac4db4 100644 --- a/README.md +++ b/README.md @@ -119,4 +119,4 @@ Software that the language server (or the development of it) uses: * [inspect.lua](https://github.com/kikito/inspect.lua) -[checkmark]: https://gist.githubusercontent.com/carsakiller/362482775731de88cdafeeca9f6a392e/raw/cd3976e92a85aafe1f33e3f9fe3d0e0bd451902c/checkmark.svg +[checkmark]: https://user-images.githubusercontent.com/61925890/183228083-d3aa4eca-30c7-4b9f-aaab-26ce3d8a14fb.png From 35c3ffc8690b265e93b37575989206e15275b5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 8 Aug 2022 18:36:55 +0800 Subject: [PATCH 005/965] update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/lovr-api | 2 +- meta/3rd/lovr/library/lovr.system.lua | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 603456179..13ccea5e2 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 6034561790f28147a8f4112d7d764863c5aeaf28 +Subproject commit 13ccea5e2e0cd8d0df1599b792ff181f99327545 diff --git a/3rd/lovr-api b/3rd/lovr-api index 5bc82dc8b..deccaa8f5 160000 --- a/3rd/lovr-api +++ b/3rd/lovr-api @@ -1 +1 @@ -Subproject commit 5bc82dc8b3a05207d14e8ef7ab6334c672845fb6 +Subproject commit deccaa8f594a25c1bfb1ae8d24466db70da099d7 diff --git a/meta/3rd/lovr/library/lovr.system.lua b/meta/3rd/lovr/library/lovr.system.lua index b3be6d492..431ce4b64 100644 --- a/meta/3rd/lovr/library/lovr.system.lua +++ b/meta/3rd/lovr/library/lovr.system.lua @@ -18,6 +18,13 @@ function lovr.system.getCoreCount() end ---@return string os # Either "Windows", "macOS", "Linux", "Android" or "Web". function lovr.system.getOS() end +--- +---Returns whether a key on the keyboard is pressed. +--- +---@param key lovr.KeyCode # The key. +---@return boolean down # Whether the key is currently pressed. +function lovr.system.isKeyDown(key) end + --- ---Requests permission to use a feature. --- From 9b5ac5353c6c63e09d7b8862fb9f5535d5f014fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 8 Aug 2022 20:24:54 +0800 Subject: [PATCH 006/965] fix #1409 --- changelog.md | 3 ++ script/core/hover/return.lua | 32 +---------------- script/vm/function.lua | 69 ++++++++++++++++++++++-------------- test/hover/init.lua | 33 +++++++++-------- 4 files changed, 62 insertions(+), 75 deletions(-) diff --git a/changelog.md b/changelog.md index 18d8569a6..a34642471 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 3.5.3 +* `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409) + ## 3.5.2 `2022-8-1` * `FIX` [#1395](https://github.com/sumneko/lua-language-server/issues/1395) diff --git a/script/core/hover/return.lua b/script/core/hover/return.lua index b496990b5..b71b9e5d6 100644 --- a/script/core/hover/return.lua +++ b/script/core/hover/return.lua @@ -1,36 +1,6 @@ local vm = require 'vm.vm' local guide = require 'parser.guide' ----@param source parser.object ----@return integer -local function countReturns(source) - local n = 0 - - local docs = source.bindDocs - if docs then - for _, doc in ipairs(docs) do - if doc.type == 'doc.return' then - for _, rtn in ipairs(doc.returns) do - if rtn.returnIndex and rtn.returnIndex > n then - n = rtn.returnIndex - end - end - end - end - end - - local returns = source.returns - if returns then - for _, rtn in ipairs(returns) do - if #rtn > n then - n = #rtn - end - end - end - - return n -end - ---@param source parser.object ---@return parser.object[] local function getReturnDocs(source) @@ -51,7 +21,7 @@ local function getReturnDocs(source) end local function asFunction(source) - local num = countReturns(source) + local _, _, num = vm.countReturnsOfFunction(source) if num == 0 then return nil end diff --git a/script/vm/function.lua b/script/vm/function.lua index f64b22624..7cde62985 100644 --- a/script/vm/function.lua +++ b/script/vm/function.lua @@ -19,12 +19,15 @@ end ---@param func parser.object ---@return integer min ---@return number max +---@return integer def function vm.countParamsOfFunction(func) local min = 0 local max = 0 + local def = 0 if func.type == 'function' then if func.args then max = #func.args + def = max for i = #func.args, 1, -1 do local arg = func.args[i] if arg.type == '...' then @@ -44,6 +47,7 @@ function vm.countParamsOfFunction(func) if func.type == 'doc.type.function' then if func.args then max = #func.args + def = max for i = #func.args, 1, -1 do local arg = func.args[i] if arg.name and arg.name[1] =='...' then @@ -55,28 +59,32 @@ function vm.countParamsOfFunction(func) end end end - return min, max + return min, max, def end ---@param node vm.node ---@return integer min ---@return number max +---@return integer def function vm.countParamsOfNode(node) - local min, max + local min, max, def for n in node:eachObject() do if n.type == 'function' or n.type == 'doc.type.function' then ---@cast n parser.object - local fmin, fmax = vm.countParamsOfFunction(n) + local fmin, fmax, fdef = vm.countParamsOfFunction(n) if not min or fmin < min then min = fmin end if not max or fmax > max then max = fmax end + if not def or fdef > def then + def = fdef + end end end - return min or 0, max or math.huge + return min or 0, max or math.huge, def or 0 end ---@param func parser.object @@ -84,20 +92,17 @@ end ---@param mark? table ---@return integer min ---@return number max +---@return integer def function vm.countReturnsOfFunction(func, onlyDoc, mark) if func.type == 'function' then - ---@type integer? - local min - ---@type number? - local max + ---@type integer?, number?, integer? + local min, max, def local hasDocReturn if func.bindDocs then local lastReturn local n = 0 - ---@type integer? - local dmin - ---@type number? - local dmax + ---@type integer?, number?, integer? + local dmin, dmax, ddef for _, doc in ipairs(func.bindDocs) do if doc.type == 'doc.return' then hasDocReturn = true @@ -105,6 +110,7 @@ function vm.countReturnsOfFunction(func, onlyDoc, mark) n = n + 1 lastReturn = ret dmax = n + ddef = n if (not ret.name or ret.name[1] ~= '...') and not vm.compileNode(ret):isNullable() then dmin = n @@ -123,19 +129,25 @@ function vm.countReturnsOfFunction(func, onlyDoc, mark) if dmax and (not max or (dmax > max)) then max = dmax end + if ddef and (not def or (ddef > def)) then + def = ddef + end end if not onlyDoc and not hasDocReturn and func.returns then for _, ret in ipairs(func.returns) do - local rmin, rmax = vm.countList(ret, mark) + local rmin, rmax, ddef = vm.countList(ret, mark) if not min or rmin < min then min = rmin end if not max or rmax > max then max = rmax end + if not def or ddef > def then + def = ddef + end end end - return min or 0, max or math.huge + return min or 0, max or math.huge, def or 0 end if func.type == 'doc.type.function' then return vm.countList(func.returns) @@ -147,52 +159,55 @@ end ---@param mark? table ---@return integer min ---@return number max +---@return integer def function vm.countReturnsOfCall(func, args, mark) local funcs = vm.getMatchedFunctions(func, args, mark) - ---@type integer? - local min - ---@type number? - local max + ---@type integer?, number?, integer? + local min, max, def for _, f in ipairs(funcs) do - local rmin, rmax = vm.countReturnsOfFunction(f, false, mark) + local rmin, rmax, rdef = vm.countReturnsOfFunction(f, false, mark) if not min or rmin < min then min = rmin end if not max or rmax > max then max = rmax end + if not def or rdef > def then + def = rdef + end end - return min or 0, max or math.huge + return min or 0, max or math.huge, def or 0 end ---@param list parser.object[]? ---@param mark? table ---@return integer min ---@return number max +---@return integer def function vm.countList(list, mark) if not list then - return 0, 0 + return 0, 0, 0 end local lastArg = list[#list] if not lastArg then - return 0, 0 + return 0, 0, 0 end if lastArg.type == '...' or lastArg.type == 'varargs' then - return #list - 1, math.huge + return #list - 1, math.huge, #list end if lastArg.type == 'call' then if not mark then mark = {} end if mark[lastArg] then - return #list - 1, math.huge + return #list - 1, math.huge, #list end mark[lastArg] = true - local rmin, rmax = vm.countReturnsOfCall(lastArg.node, lastArg.args, mark) - return #list - 1 + rmin, #list - 1 + rmax + local rmin, rmax, rdef = vm.countReturnsOfCall(lastArg.node, lastArg.args, mark) + return #list - 1 + rmin, #list - 1 + rmax, #list - 1 + rdef end - return #list, #list + return #list, #list, #list end ---@param func parser.object diff --git a/test/hover/init.lua b/test/hover/init.lua index 40474bf5a..e720ffc20 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -5,22 +5,6 @@ local config = require 'config' rawset(_G, 'TEST', true) -local accept = { - ['local'] = true, - ['setlocal'] = true, - ['getlocal'] = true, - ['setglobal'] = true, - ['getglobal'] = true, - ['field'] = true, - ['method'] = true, - ['string'] = true, - ['number'] = true, - ['integer'] = true, - ['doc.type.name'] = true, - ['doc.class.name'] = true, - ['function'] = true, -} - ---@diagnostic disable: await-in-sync function TEST(script) return function (expect) @@ -312,7 +296,6 @@ end ]] [[ function x() - -> unknown ]] TEST [[ @@ -2137,3 +2120,19 @@ local = 1 << 2 [[ local x: integer = 4 ]] + +TEST [[ +local function test1() + return 1, 2, 3 +end + +local function () + return test1() +end +]] +[[ +function test2() + -> integer + 2. integer + 3. integer +]] From 13bb2c666342b7dbe14e6118f761738711491539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 8 Aug 2022 21:02:36 +0800 Subject: [PATCH 007/965] fix #1422 --- changelog.md | 1 + locale/en-us/script.lua | 2 ++ locale/pt-br/script.lua | 2 ++ locale/zh-cn/script.lua | 2 ++ locale/zh-tw/script.lua | 2 ++ script/parser/compile.lua | 18 ++++++++++++++++++ 6 files changed, 27 insertions(+) diff --git a/changelog.md b/changelog.md index a34642471..6376d8d2d 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## 3.5.3 * `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409) +* `FIX` [#1422](https://github.com/sumneko/lua-language-server/issues/1422) ## 3.5.2 `2022-8-1` diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua index 05a5c0d1f..9135644b7 100644 --- a/locale/en-us/script.lua +++ b/locale/en-us/script.lua @@ -269,6 +269,8 @@ PARSER_INDEX_IN_FUNC_NAME = 'The `[name]` form cannot be used in the name of a named function.' PARSER_UNKNOWN_ATTRIBUTE = 'Local attribute should be `const` or `close`' +PARSER_AMBIGUOUS_SYNTAX = -- TODO: need translate! +'In Lua 5.1, the left brackets called by the function must be in the same line as the function.' PARSER_LUADOC_MISS_CLASS_NAME = ' expected.' PARSER_LUADOC_MISS_EXTENDS_SYMBOL = diff --git a/locale/pt-br/script.lua b/locale/pt-br/script.lua index 5e954d06f..d1ae41b8f 100644 --- a/locale/pt-br/script.lua +++ b/locale/pt-br/script.lua @@ -269,6 +269,8 @@ PARSER_INDEX_IN_FUNC_NAME = 'A forma `[name]` não pode ser usada em nome de uma função nomeada.' PARSER_UNKNOWN_ATTRIBUTE = 'Atributo local deve ser `const` ou `close`' +PARSER_AMBIGUOUS_SYNTAX = -- TODO: need translate! +'In Lua 5.1, the left brackets called by the function must be in the same line as the function.' PARSER_LUADOC_MISS_CLASS_NAME = 'Esperado .' PARSER_LUADOC_MISS_EXTENDS_SYMBOL = diff --git a/locale/zh-cn/script.lua b/locale/zh-cn/script.lua index e839e92c4..775400ece 100644 --- a/locale/zh-cn/script.lua +++ b/locale/zh-cn/script.lua @@ -269,6 +269,8 @@ PARSER_INDEX_IN_FUNC_NAME = '命名函数的名称中不能使用 `[name]` 形式。' PARSER_UNKNOWN_ATTRIBUTE = '局部变量属性应该是 `const` 或 `close`' +PARSER_AMBIGUOUS_SYNTAX = +'在 Lua 5.1 中,函数调用的左括号必须与函数在同一行。' PARSER_LUADOC_MISS_CLASS_NAME = '缺少类名称。' PARSER_LUADOC_MISS_EXTENDS_SYMBOL = diff --git a/locale/zh-tw/script.lua b/locale/zh-tw/script.lua index bb6ab94e0..e234f5aef 100644 --- a/locale/zh-tw/script.lua +++ b/locale/zh-tw/script.lua @@ -269,6 +269,8 @@ PARSER_INDEX_IN_FUNC_NAME = '命名函式的名稱中不能使用 `[name]` 形式。' PARSER_UNKNOWN_ATTRIBUTE = '區域變數屬性應該是 `const` 或 `close` 。' +PARSER_AMBIGUOUS_SYNTAX = -- TODO: need translate! +'在 Lua 5.1 中,函数调用的左括号必须与函数在同一行。' PARSER_LUADOC_MISS_CLASS_NAME = '缺少類別名稱。' PARSER_LUADOC_MISS_EXTENDS_SYMBOL = diff --git a/script/parser/compile.lua b/script/parser/compile.lua index 8b2ae1e36..915a2764b 100644 --- a/script/parser/compile.lua +++ b/script/parser/compile.lua @@ -1767,6 +1767,23 @@ local function addDummySelf(node, call) tinsert(call.args, 1, self) end +local function checkAmbiguityCall(call, parenPos) + if State.version ~= 'Lua 5.1' then + return + end + local node = call.node + local nodeRow = guide.rowColOf(node.finish) + local callRow = guide.rowColOf(parenPos) + if nodeRow == callRow then + return + end + pushError { + type = 'AMBIGUOUS_SYNTAX', + start = parenPos, + finish = call.finish, + } +end + local function parseSimple(node, funcName) local lastMethod while true do @@ -1869,6 +1886,7 @@ local function parseSimple(node, funcName) call.args = args end addDummySelf(node, call) + checkAmbiguityCall(call, startPos) node.parent = call node = call elseif token == '{' then From 533dd62a862a9f4bc2491411515bca1511d319ac Mon Sep 17 00:00:00 2001 From: Xxiong <597272622@qq.com> Date: Tue, 9 Aug 2022 17:19:41 +0800 Subject: [PATCH 008/965] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A2=9D=E5=A4=96Lib?= =?UTF-8?q?rary=E6=96=87=E4=BB=B6=E5=A4=B9=E5=90=8D=E5=89=8D=E5=B8=A6?= =?UTF-8?q?=E6=9C=89".."=E5=AD=97=E7=AC=A6=E6=97=B6=EF=BC=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E7=A1=AE=E8=8E=B7=E5=8F=96=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/workspace/workspace.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 8ee7ad29a..9d2ad6373 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -391,7 +391,7 @@ function m.normalize(path) break end local count - path, count = path:gsub('[^/\\]+[/\\]+%.%.', '', 1) + path, count = path:gsub('[^/\\]+[/\\]+%.%.[/\\]', '/', 1) if count == 0 then break end From 40f191a85ea21bb64c427f9dab4bc597e2a0ea1b Mon Sep 17 00:00:00 2001 From: CppCXY <812125110@qq.com> Date: Thu, 11 Aug 2022 19:36:29 +0800 Subject: [PATCH 009/965] =?UTF-8?q?=E6=94=AF=E6=8C=81typeformat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rd/EmmyLuaCodeStyle | 2 +- script/core/type-formatting.lua | 39 +++++++++++++++++++++++++++++++-- script/provider/provider.lua | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index a92e5ca88..e89f5c460 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit a92e5ca884c7bb4c31eb1ee1577201676c9c732d +Subproject commit e89f5c4608c411d602a0dcdf24159809e715859b diff --git a/script/core/type-formatting.lua b/script/core/type-formatting.lua index cc3059825..c6316d805 100644 --- a/script/core/type-formatting.lua +++ b/script/core/type-formatting.lua @@ -1,11 +1,15 @@ local files = require 'files' local lookBackward = require 'core.look-backward' local guide = require "parser.guide" +local codeFormat = require "code_format" local function insertIndentation(uri, position, edits) local text = files.getText(uri) local state = files.getState(uri) local row = guide.rowColOf(position) + if not state or not text then + return + end local offset = state.lines[row] local indent = text:match('^%s*', offset) for _, edit in ipairs(edits) do @@ -16,6 +20,9 @@ end local function findForward(uri, position, ...) local text = files.getText(uri) local state = files.getState(uri) + if not state or not text then + return nil + end local offset = guide.positionToOffset(state, position) local firstOffset = text:match('^[ \t]*()', offset + 1) if not firstOffset then @@ -32,6 +39,9 @@ end local function findBackward(uri, position, ...) local text = files.getText(uri) local state = files.getState(uri) + if not state or not text then + return nil + end local offset = guide.positionToOffset(state, position) local lastOffset = lookBackward.findAnyOffset(text, offset) for _, symbol in ipairs { ... } do @@ -48,7 +58,7 @@ local function checkSplitOneLine(results, uri, position, ch) end local fPosition, fSymbol = findForward(uri, position, 'end', '}') - if not fPosition then + if not fPosition or not fSymbol then return end local bPosition = findBackward(uri, position, 'then', 'do', ')', '{') @@ -77,7 +87,29 @@ local function checkSplitOneLine(results, uri, position, ch) end end -return function (uri, position, ch) +local function typeFormat(results, uri, position, ch, options) + if ch ~= '\n' then + return + end + local text = files.getOriginText(uri) + local state = files.getState(uri) + if not state then + return + end + local converter = require("proto.converter") + local pos = converter.packPosition(uri, position) + local success, result = codeFormat.type_format(uri, text, pos.line, pos.character, options) + if success then + local range = result.range + results[#results+1] = { + text = result.newText, + start = converter.unpackPosition(uri, { line = range.start.line, character = range.start.character }), + finish = converter.unpackPosition(uri, { line = range["end"].line, character = range["end"].character }), + } + end +end + +return function (uri, position, ch, options) local ast = files.getState(uri) if not ast then return nil @@ -86,6 +118,9 @@ return function (uri, position, ch) local results = {} -- split `function () $ end` checkSplitOneLine(results, uri, position, ch) + if #results == 0 then + typeFormat(results, uri, position, ch, options) + end return results end diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 08b6ca937..3d0127574 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -1107,7 +1107,7 @@ m.register 'textDocument/onTypeFormatting' { end local core = require 'core.type-formatting' local pos = converter.unpackPosition(uri, params.position) - local edits = core(uri, pos, ch) + local edits = core(uri, pos, ch, params.options) if not edits or #edits == 0 then return nil end From b287db94a779a435438a407ea17c8418b7b35152 Mon Sep 17 00:00:00 2001 From: CppCXY <812125110@qq.com> Date: Thu, 11 Aug 2022 20:28:58 +0800 Subject: [PATCH 010/965] =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/type_formatting/init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/type_formatting/init.lua b/test/type_formatting/init.lua index 363303cc4..0e2873b90 100644 --- a/test/type_formatting/init.lua +++ b/test/type_formatting/init.lua @@ -6,7 +6,7 @@ local catch = require 'catch' rawset(_G, 'TEST', true) function TEST(script) - return function (expect) + return function(expect) local newScript, catched = catch(script, '?') files.setText('', newScript) local edits = core('', catched['?'][1][1], expect.ch) @@ -123,5 +123,11 @@ end ]] { ch = '\n', - edits = {} + edits = { + { + start = 0, + finish = 10000, + text = 'if true then\n', + } + } } From 95a4dc527a04385f29b03321cbc1ef20f18fb255 Mon Sep 17 00:00:00 2001 From: Martin Armbruster Date: Fri, 12 Aug 2022 16:16:53 +0200 Subject: [PATCH 011/965] Added missing descriptions for diagnostics. --- doc/en-us/config.md | 217 +++++++++++++++++++++++++++++++++++++++ doc/pt-br/config.md | 1 + doc/zh-cn/config.md | 1 + doc/zh-tw/config.md | 1 + locale/en-us/setting.lua | 74 +++++++++++++ locale/pt-br/setting.lua | 74 +++++++++++++ locale/zh-cn/setting.lua | 74 +++++++++++++ locale/zh-tw/setting.lua | 74 +++++++++++++ 8 files changed, 516 insertions(+) diff --git a/doc/en-us/config.md b/doc/en-us/config.md index 719a4a6e5..584ab2d14 100644 --- a/doc/en-us/config.md +++ b/doc/en-us/config.md @@ -190,6 +190,7 @@ Array * ``"action-after-return"`` * ``"ambiguity-1"`` +* ``"ambiguous-syntax"`` * ``"args-after-dots"`` * ``"assign-type-mismatch"`` * ``"await-in-sync"`` @@ -654,26 +655,74 @@ object Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead. */ "ambiguity-1": "Any", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Opened", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "None", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Opened", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Opened", "circle-doc-class": "Any", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Any", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Opened", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "None", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Any", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Any", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Any", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Any", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Any", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Any", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Any", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Any", /* Enable duplicate table index diagnostics. */ "duplicate-index": "Any", + /* + Enable diagnostics for setting the same field in a class more than once. + */ "duplicate-set-field": "Any", /* Enable empty code block diagnostics. @@ -687,9 +736,21 @@ object Enable lowercase global variable definition diagnostics. */ "lowercase-global": "Any", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Any", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Any", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Any", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Opened", /* Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table. @@ -699,8 +760,17 @@ object Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line. */ "newline-call": "Any", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "None", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "None", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Opened", /* Enable redefined local variable diagnostics. @@ -710,34 +780,73 @@ object Enable redundant function parameter diagnostics. */ "redundant-parameter": "Any", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Opened", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Any", /* Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned. */ "redundant-value": "Any", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Opened", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "None", /* Enable trailing space diagnostics. */ "trailing-space": "Opened", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Any", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Any", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Any", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Any", /* Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment. */ "undefined-env-child": "Any", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Opened", /* Enable undefined global variable diagnostics. */ "undefined-global": "Any", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Any", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Any", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Any", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Opened", /* Enable unused function diagnostics. @@ -790,26 +899,74 @@ object Enable ambiguous operator precedence diagnostics. For example, the `num or 0 + 1` expression will be suggested `(num or 0) + 1` instead. */ "ambiguity-1": "Warning", + /* + Enable diagnostics for assignments in which the value's type does not match the type of the assigned variable. + */ "assign-type-mismatch": "Warning", + /* + Enable diagnostics for calls of asynchronous functions within a synchronous function. + */ "await-in-sync": "Warning", + /* + Enable diagnostics for casts of local variables where the target type does not match the defined type. + */ "cast-local-type": "Warning", + /* + Enable diagnostics for casts where the target type does not match the initial type. + */ "cast-type-mismatch": "Warning", "circle-doc-class": "Warning", + /* + Enable diagnostics for attempts to close a variable with a non-object. + */ "close-non-object": "Warning", + /* + Enable diagnostics for code placed after a break statement in a loop. + */ "code-after-break": "Hint", + /* + Enable diagnostics for incorrectly styled lines. + */ "codestyle-check": "Warning", + /* + Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing. + */ "count-down-loop": "Warning", + /* + Enable diagnostics to highlight deprecated API. + */ "deprecated": "Warning", + /* + Enable diagnostics for files which are required by two different paths. + */ "different-requires": "Warning", + /* + Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored. + */ "discard-returns": "Warning", + /* + Enable diagnostics to highlight a field annotation without a defining class annotation. + */ "doc-field-no-class": "Warning", + /* + Enable diagnostics for a duplicated alias annotation name. + */ "duplicate-doc-alias": "Warning", + /* + Enable diagnostics for a duplicated field annotation name. + */ "duplicate-doc-field": "Warning", + /* + Enable diagnostics for a duplicated param annotation name. + */ "duplicate-doc-param": "Warning", /* Enable duplicate table index diagnostics. */ "duplicate-index": "Warning", + /* + Enable diagnostics for setting the same field in a class more than once. + */ "duplicate-set-field": "Warning", /* Enable empty code block diagnostics. @@ -823,9 +980,21 @@ object Enable lowercase global variable definition diagnostics. */ "lowercase-global": "Information", + /* + Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters. + */ "missing-parameter": "Warning", + /* + Enable diagnostics for functions with return annotations which have no return statement. + */ "missing-return": "Warning", + /* + Enable diagnostics for return statements without values although the containing function declares returns. + */ "missing-return-value": "Warning", + /* + Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before. + */ "need-check-nil": "Warning", /* Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table. @@ -835,8 +1004,17 @@ object Enable newline call diagnostics. Is's raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line. */ "newline-call": "Warning", + /* + Enable diagnostics for cases in which the type cannot be inferred. + */ "no-unknown": "Warning", + /* + Enable diagnostics for calls to `coroutine.yield()` when it is not permitted. + */ "not-yieldable": "Warning", + /* + Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition. + */ "param-type-mismatch": "Warning", /* Enable redefined local variable diagnostics. @@ -846,34 +1024,73 @@ object Enable redundant function parameter diagnostics. */ "redundant-parameter": "Warning", + /* + Enable diagnostics for return statements which are not needed because the function would exit on its own. + */ "redundant-return": "Hint", + /* + Enable diagnostics for return statements which return an extra value which is not specified by a return annotation. + */ "redundant-return-value": "Warning", /* Enable the redundant values assigned diagnostics. It's raised during assignment operation, when the number of values is higher than the number of objects being assigned. */ "redundant-value": "Warning", + /* + Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation. + */ "return-type-mismatch": "Warning", + /* + Enable diagnostics for typos in strings. + */ "spell-check": "Information", /* Enable trailing space diagnostics. */ "trailing-space": "Hint", + /* + Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`). + */ "unbalanced-assignments": "Warning", + /* + Enable diagnostics for class annotations in which an undefined class is referenced. + */ "undefined-doc-class": "Warning", + /* + Enable diagnostics for type annotations referencing an undefined type or alias. + */ "undefined-doc-name": "Warning", + /* + Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition. + */ "undefined-doc-param": "Warning", /* Enable undefined environment variable diagnostics. It's raised when `_ENV` table is set to a new literal table, but the used global variable is no longer present in the global environment. */ "undefined-env-child": "Information", + /* + Enable diagnostics for cases in which an undefined field of a variable is read. + */ "undefined-field": "Warning", /* Enable undefined global variable diagnostics. */ "undefined-global": "Warning", + /* + Enable diagnostics for casts of undefined variables. + */ "unknown-cast-variable": "Warning", + /* + Enable diagnostics in cases in which an unknown diagnostics code is entered. + */ "unknown-diag-code": "Warning", + /* + Enable diagnostics for unknown operators. + */ "unknown-operator": "Warning", + /* + Enable diagnostics for unreachable code. + */ "unreachable-code": "Hint", /* Enable unused function diagnostics. diff --git a/doc/pt-br/config.md b/doc/pt-br/config.md index ddd613fb5..e984f1721 100644 --- a/doc/pt-br/config.md +++ b/doc/pt-br/config.md @@ -190,6 +190,7 @@ Array * ``"action-after-return"`` * ``"ambiguity-1"`` +* ``"ambiguous-syntax"`` * ``"args-after-dots"`` * ``"assign-type-mismatch"`` * ``"await-in-sync"`` diff --git a/doc/zh-cn/config.md b/doc/zh-cn/config.md index 07d07a743..00739179c 100644 --- a/doc/zh-cn/config.md +++ b/doc/zh-cn/config.md @@ -190,6 +190,7 @@ Array * ``"action-after-return"`` * ``"ambiguity-1"`` +* ``"ambiguous-syntax"`` * ``"args-after-dots"`` * ``"assign-type-mismatch"`` * ``"await-in-sync"`` diff --git a/doc/zh-tw/config.md b/doc/zh-tw/config.md index 08fab32b9..95a030114 100644 --- a/doc/zh-tw/config.md +++ b/doc/zh-tw/config.md @@ -190,6 +190,7 @@ Array * ``"action-after-return"`` * ``"ambiguity-1"`` +* ``"ambiguous-syntax"`` * ``"args-after-dots"`` * ``"assign-type-mismatch"`` * ``"await-in-sync"`` diff --git a/locale/en-us/setting.lua b/locale/en-us/setting.lua index 112640c02..fd6b069fb 100644 --- a/locale/en-us/setting.lua +++ b/locale/en-us/setting.lua @@ -319,3 +319,77 @@ config.diagnostics['empty-block'] = 'Enable empty code block diagnostics.' config.diagnostics['redundant-value'] = 'Enable the redundant values assigned diagnostics. It\'s raised during assignment operation, when the number of values is higher than the number of objects being assigned.' +config.diagnostics['assign-type-mismatch'] = +'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.' +config.diagnostics['await-in-sync'] = +'Enable diagnostics for calls of asynchronous functions within a synchronous function.' +config.diagnostics['cast-local-type'] = +'Enable diagnostics for casts of local variables where the target type does not match the defined type.' +config.diagnostics['cast-type-mismatch'] = +'Enable diagnostics for casts where the target type does not match the initial type.' +config.diagnostics['circular-doc-class'] = +'Enable diagnostics for two classes inheriting from each other introducing a circular relation.' +config.diagnostics['close-non-object'] = +'Enable diagnostics for attempts to close a variable with a non-object.' +config.diagnostics['code-after-break'] = +'Enable diagnostics for code placed after a break statement in a loop.' +config.diagnostics['codestyle-check'] = +'Enable diagnostics for incorrectly styled lines.' +config.diagnostics['count-down-loop'] = +'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.' +config.diagnostics['deprecated'] = +'Enable diagnostics to highlight deprecated API.' +config.diagnostics['different-requires'] = +'Enable diagnostics for files which are required by two different paths.' +config.diagnostics['discard-returns'] = +'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.' +config.diagnostics['doc-field-no-class'] = +'Enable diagnostics to highlight a field annotation without a defining class annotation.' +config.diagnostics['duplicate-doc-alias'] = +'Enable diagnostics for a duplicated alias annotation name.' +config.diagnostics['duplicate-doc-field'] = +'Enable diagnostics for a duplicated field annotation name.' +config.diagnostics['duplicate-doc-param'] = +'Enable diagnostics for a duplicated param annotation name.' +config.diagnostics['duplicate-set-field'] = +'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['missing-parameter'] = +'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' +config.diagnostics['missing-return'] = +'Enable diagnostics for functions with return annotations which have no return statement.' +config.diagnostics['missing-return-value'] = +'Enable diagnostics for return statements without values although the containing function declares returns.' +config.diagnostics['need-check-nil'] = +'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.' +config.diagnostics['no-unknown'] = +'Enable diagnostics for cases in which the type cannot be inferred.' +config.diagnostics['not-yieldable'] = +'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.' +config.diagnostics['param-type-mismatch'] = +'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.' +config.diagnostics['redundant-return'] = +'Enable diagnostics for return statements which are not needed because the function would exit on its own.' +config.diagnostics['redundant-return-value']= +'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.' +config.diagnostics['return-type-mismatch'] = +'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' +config.diagnostics['spell-check'] = +'Enable diagnostics for typos in strings.' +config.diagnostics['unbalanced-assignments']= +'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' +config.diagnostics['undefined-doc-class'] = +'Enable diagnostics for class annotations in which an undefined class is referenced.' +config.diagnostics['undefined-doc-name'] = +'Enable diagnostics for type annotations referencing an undefined type or alias.' +config.diagnostics['undefined-doc-param'] = +'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.' +config.diagnostics['undefined-field'] = +'Enable diagnostics for cases in which an undefined field of a variable is read.' +config.diagnostics['unknown-cast-variable'] = +'Enable diagnostics for casts of undefined variables.' +config.diagnostics['unknown-diag-code'] = +'Enable diagnostics in cases in which an unknown diagnostics code is entered.' +config.diagnostics['unknown-operator'] = +'Enable diagnostics for unknown operators.' +config.diagnostics['unreachable-code'] = +'Enable diagnostics for unreachable code.' diff --git a/locale/pt-br/setting.lua b/locale/pt-br/setting.lua index 79c3770be..9f597ca6f 100644 --- a/locale/pt-br/setting.lua +++ b/locale/pt-br/setting.lua @@ -319,3 +319,77 @@ config.diagnostics['empty-block'] = -- TODO: need translate! '空代码块' config.diagnostics['redundant-value'] = -- TODO: need translate! '赋值操作时,值的数量比被赋值的对象多' +config.diagnostics['assign-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.' +config.diagnostics['await-in-sync'] = -- TODO: need translate! +'Enable diagnostics for calls of asynchronous functions within a synchronous function.' +config.diagnostics['cast-local-type'] = -- TODO: need translate! +'Enable diagnostics for casts of local variables where the target type does not match the defined type.' +config.diagnostics['cast-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for casts where the target type does not match the initial type.' +config.diagnostics['circular-doc-class'] = -- TODO: need translate! +'Enable diagnostics for two classes inheriting from each other introducing a circular relation.' +config.diagnostics['close-non-object'] = -- TODO: need translate! +'Enable diagnostics for attempts to close a variable with a non-object.' +config.diagnostics['code-after-break'] = -- TODO: need translate! +'Enable diagnostics for code placed after a break statement in a loop.' +config.diagnostics['codestyle-check'] = -- TODO: need translate! +'Enable diagnostics for incorrectly styled lines.' +config.diagnostics['count-down-loop'] = -- TODO: need translate! +'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.' +config.diagnostics['deprecated'] = -- TODO: need translate! +'Enable diagnostics to highlight deprecated API.' +config.diagnostics['different-requires'] = -- TODO: need translate! +'Enable diagnostics for files which are required by two different paths.' +config.diagnostics['discard-returns'] = -- TODO: need translate! +'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.' +config.diagnostics['doc-field-no-class'] = -- TODO: need translate! +'Enable diagnostics to highlight a field annotation without a defining class annotation.' +config.diagnostics['duplicate-doc-alias'] = -- TODO: need translate! +'Enable diagnostics for a duplicated alias annotation name.' +config.diagnostics['duplicate-doc-field'] = -- TODO: need translate! +'Enable diagnostics for a duplicated field annotation name.' +config.diagnostics['duplicate-doc-param'] = -- TODO: need translate! +'Enable diagnostics for a duplicated param annotation name.' +config.diagnostics['duplicate-set-field'] = -- TODO: need translate! +'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['missing-parameter'] = -- TODO: need translate! +'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' +config.diagnostics['missing-return'] = -- TODO: need translate! +'Enable diagnostics for functions with return annotations which have no return statement.' +config.diagnostics['missing-return-value'] = -- TODO: need translate! +'Enable diagnostics for return statements without values although the containing function declares returns.' +config.diagnostics['need-check-nil'] = -- TODO: need translate! +'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.' +config.diagnostics['no-unknown'] = -- TODO: need translate! +'Enable diagnostics for cases in which the type cannot be inferred.' +config.diagnostics['not-yieldable'] = -- TODO: need translate! +'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.' +config.diagnostics['param-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.' +config.diagnostics['redundant-return'] = -- TODO: need translate! +'Enable diagnostics for return statements which are not needed because the function would exit on its own.' +config.diagnostics['redundant-return-value']= -- TODO: need translate! +'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.' +config.diagnostics['return-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' +config.diagnostics['spell-check'] = -- TODO: need translate! +'Enable diagnostics for typos in strings.' +config.diagnostics['unbalanced-assignments']= -- TODO: need translate! +'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' +config.diagnostics['undefined-doc-class'] = -- TODO: need translate! +'Enable diagnostics for class annotations in which an undefined class is referenced.' +config.diagnostics['undefined-doc-name'] = -- TODO: need translate! +'Enable diagnostics for type annotations referencing an undefined type or alias.' +config.diagnostics['undefined-doc-param'] = -- TODO: need translate! +'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.' +config.diagnostics['undefined-field'] = -- TODO: need translate! +'Enable diagnostics for cases in which an undefined field of a variable is read.' +config.diagnostics['unknown-cast-variable'] = -- TODO: need translate! +'Enable diagnostics for casts of undefined variables.' +config.diagnostics['unknown-diag-code'] = -- TODO: need translate! +'Enable diagnostics in cases in which an unknown diagnostics code is entered.' +config.diagnostics['unknown-operator'] = -- TODO: need translate! +'Enable diagnostics for unknown operators.' +config.diagnostics['unreachable-code'] = -- TODO: need translate! +'Enable diagnostics for unreachable code.' diff --git a/locale/zh-cn/setting.lua b/locale/zh-cn/setting.lua index baa3a92f8..dde3e9d12 100644 --- a/locale/zh-cn/setting.lua +++ b/locale/zh-cn/setting.lua @@ -318,3 +318,77 @@ config.diagnostics['empty-block'] = '空代码块' config.diagnostics['redundant-value'] = '赋值操作时,值的数量比被赋值的对象多' +config.diagnostics['assign-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.' +config.diagnostics['await-in-sync'] = -- TODO: need translate! +'Enable diagnostics for calls of asynchronous functions within a synchronous function.' +config.diagnostics['cast-local-type'] = -- TODO: need translate! +'Enable diagnostics for casts of local variables where the target type does not match the defined type.' +config.diagnostics['cast-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for casts where the target type does not match the initial type.' +config.diagnostics['circular-doc-class'] = -- TODO: need translate! +'Enable diagnostics for two classes inheriting from each other introducing a circular relation.' +config.diagnostics['close-non-object'] = -- TODO: need translate! +'Enable diagnostics for attempts to close a variable with a non-object.' +config.diagnostics['code-after-break'] = -- TODO: need translate! +'Enable diagnostics for code placed after a break statement in a loop.' +config.diagnostics['codestyle-check'] = -- TODO: need translate! +'Enable diagnostics for incorrectly styled lines.' +config.diagnostics['count-down-loop'] = -- TODO: need translate! +'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.' +config.diagnostics['deprecated'] = -- TODO: need translate! +'Enable diagnostics to highlight deprecated API.' +config.diagnostics['different-requires'] = -- TODO: need translate! +'Enable diagnostics for files which are required by two different paths.' +config.diagnostics['discard-returns'] = -- TODO: need translate! +'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.' +config.diagnostics['doc-field-no-class'] = -- TODO: need translate! +'Enable diagnostics to highlight a field annotation without a defining class annotation.' +config.diagnostics['duplicate-doc-alias'] = -- TODO: need translate! +'Enable diagnostics for a duplicated alias annotation name.' +config.diagnostics['duplicate-doc-field'] = -- TODO: need translate! +'Enable diagnostics for a duplicated field annotation name.' +config.diagnostics['duplicate-doc-param'] = -- TODO: need translate! +'Enable diagnostics for a duplicated param annotation name.' +config.diagnostics['duplicate-set-field'] = -- TODO: need translate! +'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['missing-parameter'] = -- TODO: need translate! +'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' +config.diagnostics['missing-return'] = -- TODO: need translate! +'Enable diagnostics for functions with return annotations which have no return statement.' +config.diagnostics['missing-return-value'] = -- TODO: need translate! +'Enable diagnostics for return statements without values although the containing function declares returns.' +config.diagnostics['need-check-nil'] = -- TODO: need translate! +'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.' +config.diagnostics['no-unknown'] = -- TODO: need translate! +'Enable diagnostics for cases in which the type cannot be inferred.' +config.diagnostics['not-yieldable'] = -- TODO: need translate! +'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.' +config.diagnostics['param-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.' +config.diagnostics['redundant-return'] = -- TODO: need translate! +'Enable diagnostics for return statements which are not needed because the function would exit on its own.' +config.diagnostics['redundant-return-value']= -- TODO: need translate! +'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.' +config.diagnostics['return-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' +config.diagnostics['spell-check'] = -- TODO: need translate! +'Enable diagnostics for typos in strings.' +config.diagnostics['unbalanced-assignments']= -- TODO: need translate! +'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' +config.diagnostics['undefined-doc-class'] = -- TODO: need translate! +'Enable diagnostics for class annotations in which an undefined class is referenced.' +config.diagnostics['undefined-doc-name'] = -- TODO: need translate! +'Enable diagnostics for type annotations referencing an undefined type or alias.' +config.diagnostics['undefined-doc-param'] = -- TODO: need translate! +'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.' +config.diagnostics['undefined-field'] = -- TODO: need translate! +'Enable diagnostics for cases in which an undefined field of a variable is read.' +config.diagnostics['unknown-cast-variable'] = -- TODO: need translate! +'Enable diagnostics for casts of undefined variables.' +config.diagnostics['unknown-diag-code'] = -- TODO: need translate! +'Enable diagnostics in cases in which an unknown diagnostics code is entered.' +config.diagnostics['unknown-operator'] = -- TODO: need translate! +'Enable diagnostics for unknown operators.' +config.diagnostics['unreachable-code'] = -- TODO: need translate! +'Enable diagnostics for unreachable code.' diff --git a/locale/zh-tw/setting.lua b/locale/zh-tw/setting.lua index 37269484d..3129b3138 100644 --- a/locale/zh-tw/setting.lua +++ b/locale/zh-tw/setting.lua @@ -318,3 +318,77 @@ config.diagnostics['empty-block'] = '空程式碼區塊' config.diagnostics['redundant-value'] = '賦值操作時,值的數量比被賦值的對象多' +config.diagnostics['assign-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for assignments in which the value\'s type does not match the type of the assigned variable.' +config.diagnostics['await-in-sync'] = -- TODO: need translate! +'Enable diagnostics for calls of asynchronous functions within a synchronous function.' +config.diagnostics['cast-local-type'] = -- TODO: need translate! +'Enable diagnostics for casts of local variables where the target type does not match the defined type.' +config.diagnostics['cast-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for casts where the target type does not match the initial type.' +config.diagnostics['circular-doc-class'] = -- TODO: need translate! +'Enable diagnostics for two classes inheriting from each other introducing a circular relation.' +config.diagnostics['close-non-object'] = -- TODO: need translate! +'Enable diagnostics for attempts to close a variable with a non-object.' +config.diagnostics['code-after-break'] = -- TODO: need translate! +'Enable diagnostics for code placed after a break statement in a loop.' +config.diagnostics['codestyle-check'] = -- TODO: need translate! +'Enable diagnostics for incorrectly styled lines.' +config.diagnostics['count-down-loop'] = -- TODO: need translate! +'Enable diagnostics for `for` loops which will never reach their max/limit because the loop is incrementing instead of decrementing.' +config.diagnostics['deprecated'] = -- TODO: need translate! +'Enable diagnostics to highlight deprecated API.' +config.diagnostics['different-requires'] = -- TODO: need translate! +'Enable diagnostics for files which are required by two different paths.' +config.diagnostics['discard-returns'] = -- TODO: need translate! +'Enable diagnostics for calls of functions annotated with `---@nodiscard` where the return values are ignored.' +config.diagnostics['doc-field-no-class'] = -- TODO: need translate! +'Enable diagnostics to highlight a field annotation without a defining class annotation.' +config.diagnostics['duplicate-doc-alias'] = -- TODO: need translate! +'Enable diagnostics for a duplicated alias annotation name.' +config.diagnostics['duplicate-doc-field'] = -- TODO: need translate! +'Enable diagnostics for a duplicated field annotation name.' +config.diagnostics['duplicate-doc-param'] = -- TODO: need translate! +'Enable diagnostics for a duplicated param annotation name.' +config.diagnostics['duplicate-set-field'] = -- TODO: need translate! +'Enable diagnostics for setting the same field in a class more than once.' +config.diagnostics['missing-parameter'] = -- TODO: need translate! +'Enable diagnostics for function calls where the number of arguments is less than the number of annotated function parameters.' +config.diagnostics['missing-return'] = -- TODO: need translate! +'Enable diagnostics for functions with return annotations which have no return statement.' +config.diagnostics['missing-return-value'] = -- TODO: need translate! +'Enable diagnostics for return statements without values although the containing function declares returns.' +config.diagnostics['need-check-nil'] = -- TODO: need translate! +'Enable diagnostics for variable usages if `nil` or an optional (potentially `nil`) value was assigned to the variable before.' +config.diagnostics['no-unknown'] = -- TODO: need translate! +'Enable diagnostics for cases in which the type cannot be inferred.' +config.diagnostics['not-yieldable'] = -- TODO: need translate! +'Enable diagnostics for calls to `coroutine.yield()` when it is not permitted.' +config.diagnostics['param-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for function calls where the type of a provided parameter does not match the type of the annotated function definition.' +config.diagnostics['redundant-return'] = -- TODO: need translate! +'Enable diagnostics for return statements which are not needed because the function would exit on its own.' +config.diagnostics['redundant-return-value']= -- TODO: need translate! +'Enable diagnostics for return statements which return an extra value which is not specified by a return annotation.' +config.diagnostics['return-type-mismatch'] = -- TODO: need translate! +'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.' +config.diagnostics['spell-check'] = -- TODO: need translate! +'Enable diagnostics for typos in strings.' +config.diagnostics['unbalanced-assignments']= -- TODO: need translate! +'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).' +config.diagnostics['undefined-doc-class'] = -- TODO: need translate! +'Enable diagnostics for class annotations in which an undefined class is referenced.' +config.diagnostics['undefined-doc-name'] = -- TODO: need translate! +'Enable diagnostics for type annotations referencing an undefined type or alias.' +config.diagnostics['undefined-doc-param'] = -- TODO: need translate! +'Enable diagnostics for cases in which a parameter annotation is given without declaring the parameter in the function definition.' +config.diagnostics['undefined-field'] = -- TODO: need translate! +'Enable diagnostics for cases in which an undefined field of a variable is read.' +config.diagnostics['unknown-cast-variable'] = -- TODO: need translate! +'Enable diagnostics for casts of undefined variables.' +config.diagnostics['unknown-diag-code'] = -- TODO: need translate! +'Enable diagnostics in cases in which an unknown diagnostics code is entered.' +config.diagnostics['unknown-operator'] = -- TODO: need translate! +'Enable diagnostics for unknown operators.' +config.diagnostics['unreachable-code'] = -- TODO: need translate! +'Enable diagnostics for unreachable code.' From be018d058dc936dd3881afba269268aa936e1754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 12 Aug 2022 23:37:24 +0800 Subject: [PATCH 012/965] update submodules --- 3rd/bee.lua | 2 +- 3rd/lpeglabel | 2 +- 3rd/luamake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/3rd/bee.lua b/3rd/bee.lua index a77f313e4..aae3d3092 160000 --- a/3rd/bee.lua +++ b/3rd/bee.lua @@ -1 +1 @@ -Subproject commit a77f313e44f9d5f0b2be47539009d3ed2427ba26 +Subproject commit aae3d3092d144dedb594271be605ea6fdf078eeb diff --git a/3rd/lpeglabel b/3rd/lpeglabel index ed1838602..b5d763860 160000 --- a/3rd/lpeglabel +++ b/3rd/lpeglabel @@ -1 +1 @@ -Subproject commit ed183860289664af0f3727307653c9bf2bccdc80 +Subproject commit b5d7638608b4e0b65344c361fd4b8d65a742038f diff --git a/3rd/luamake b/3rd/luamake index cae5b44eb..6c1e8348b 160000 --- a/3rd/luamake +++ b/3rd/luamake @@ -1 +1 @@ -Subproject commit cae5b44ebd580108dc06391b44279176ffeba3f0 +Subproject commit 6c1e8348bfff93f0d2ac73f52bd667e0ab033f63 From 034dc50f68d9d58b4a45b91d41d37eb682800f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 00:01:55 +0800 Subject: [PATCH 013/965] fix #1425 --- changelog.md | 1 + script/workspace/loading.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 6376d8d2d..e8e60de6f 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## 3.5.3 * `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409) * `FIX` [#1422](https://github.com/sumneko/lua-language-server/issues/1422) +* `FIX` [#1425](https://github.com/sumneko/lua-language-server/issues/1425) ## 3.5.2 `2022-8-1` diff --git a/script/workspace/loading.lua b/script/workspace/loading.lua index 66e0a3aad..468e19084 100644 --- a/script/workspace/loading.lua +++ b/script/workspace/loading.lua @@ -46,7 +46,7 @@ function mt:checkMaxPreload(uri) client.requestMessage('Info' , lang.script('MWS_MAX_PRELOAD', max) , { - lang.script + lang.script('WINDOW_INCREASE_UPPER_LIMIT'), } , function (_, index) if index == 1 then From 7cc86b43e1284bf173f46c3e3ba760551831ddf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 00:08:42 +0800 Subject: [PATCH 014/965] fix #1428 --- changelog.md | 1 + script/proto/diagnostic.lua | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/changelog.md b/changelog.md index e8e60de6f..2ef6643de 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ * `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409) * `FIX` [#1422](https://github.com/sumneko/lua-language-server/issues/1422) * `FIX` [#1425](https://github.com/sumneko/lua-language-server/issues/1425) +* `FIX` [#1428](https://github.com/sumneko/lua-language-server/issues/1428) ## 3.5.2 `2022-8-1` diff --git a/script/proto/diagnostic.lua b/script/proto/diagnostic.lua index 9b0303cc5..f6645e89c 100644 --- a/script/proto/diagnostic.lua +++ b/script/proto/diagnostic.lua @@ -244,18 +244,20 @@ function m.getDiagAndErrNameMap() for name in pairs(m.getDefaultSeverity()) do names[name] = true end - local path = package.searchpath('parser.compile', package.path) - if path then - local f = io.open(path) - if f then - for line in f:lines() do - local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=]) - if name then - local id = name:lower():gsub('_', '-') - names[id] = true + for _, fileName in ipairs {'parser.compile', 'parser.luadoc'} do + local path = package.searchpath(fileName, package.path) + if path then + local f = io.open(path) + if f then + for line in f:lines() do + local name = line:match([=[type%s*=%s*['"](%u[%u_]+%u)['"]]=]) + if name then + local id = name:lower():gsub('_', '-') + names[id] = true + end end + f:close() end - f:close() end end table.sort(names) From e8e5becffd87486347db7b3b191c1a1eff19c664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 00:30:40 +0800 Subject: [PATCH 015/965] fix #1430 --- changelog.md | 1 + script/vm/compiler.lua | 3 ++- test/type_inference/init.lua | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 2ef6643de..4f4ab7f6d 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ * `FIX` [#1422](https://github.com/sumneko/lua-language-server/issues/1422) * `FIX` [#1425](https://github.com/sumneko/lua-language-server/issues/1425) * `FIX` [#1428](https://github.com/sumneko/lua-language-server/issues/1428) +* `FIX` [#1430](https://github.com/sumneko/lua-language-server/issues/1430) ## 3.5.2 `2022-8-1` diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 60c7243ea..c973ab8e3 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -373,7 +373,8 @@ function vm.getClassFields(suri, object, key, ref, pushResult) local fieldKey = guide.getKeyName(field) if fieldKey and not searchedFields[fieldKey] then if not searchedFields[fieldKey] - and guide.isSet(field) then + and guide.isSet(field) + and guide.isLiteral(field.value) then hasFounded[fieldKey] = true pushResult(field, true) end diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 5f71dfa2d..8c18bfb50 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3761,3 +3761,15 @@ TEST 'integerA' [[ for = 1, 10 do end ]] + +TEST 'string' [[ +---@class A +---@field x string + +---@class B : A +local t = {} + +t.x = t.x + +print(t.) +]] From c30c5c2e267f6917600afe4f19e1e0d674bad9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 01:08:34 +0800 Subject: [PATCH 016/965] #1431 --- .../{love.audio.lua => love/audio.lua} | 0 .../library/{love.data.lua => love/data.lua} | 0 .../{love.event.lua => love/event.lua} | 0 .../filesystem.lua} | 0 .../library/{love.font.lua => love/font.lua} | 0 .../{love.graphics.lua => love/graphics.lua} | 0 .../{love.image.lua => love/image.lua} | 0 .../{love.joystick.lua => love/joystick.lua} | 0 .../{love.keyboard.lua => love/keyboard.lua} | 0 .../library/{love.math.lua => love/math.lua} | 0 .../{love.mouse.lua => love/mouse.lua} | 0 .../{love.physics.lua => love/physics.lua} | 0 .../{love.sound.lua => love/sound.lua} | 0 .../{love.system.lua => love/system.lua} | 0 .../{love.thread.lua => love/thread.lua} | 0 .../{love.timer.lua => love/timer.lua} | 0 .../{love.touch.lua => love/touch.lua} | 0 .../{love.video.lua => love/video.lua} | 0 .../{love.window.lua => love/window.lua} | 0 meta/3rd/lovr/library/lovr.lovr.lua | 15 ---------- .../{lovr.audio.lua => lovr/audio.lua} | 0 .../library/{lovr.data.lua => lovr/data.lua} | 0 .../{lovr.event.lua => lovr/event.lua} | 0 .../filesystem.lua} | 0 .../{lovr.graphics.lua => lovr/graphics.lua} | 0 .../{lovr.headset.lua => lovr/headset.lua} | 0 .../library/{lovr.math.lua => lovr/math.lua} | 0 .../{lovr.physics.lua => lovr/physics.lua} | 0 .../{lovr.system.lua => lovr/system.lua} | 0 .../{lovr.thread.lua => lovr/thread.lua} | 0 .../{lovr.timer.lua => lovr/timer.lua} | 0 tools/love-api.lua | 29 ++++++++++--------- tools/lovr-api.lua | 29 ++++++++++--------- 33 files changed, 30 insertions(+), 43 deletions(-) rename meta/3rd/love2d/library/{love.audio.lua => love/audio.lua} (100%) rename meta/3rd/love2d/library/{love.data.lua => love/data.lua} (100%) rename meta/3rd/love2d/library/{love.event.lua => love/event.lua} (100%) rename meta/3rd/love2d/library/{love.filesystem.lua => love/filesystem.lua} (100%) rename meta/3rd/love2d/library/{love.font.lua => love/font.lua} (100%) rename meta/3rd/love2d/library/{love.graphics.lua => love/graphics.lua} (100%) rename meta/3rd/love2d/library/{love.image.lua => love/image.lua} (100%) rename meta/3rd/love2d/library/{love.joystick.lua => love/joystick.lua} (100%) rename meta/3rd/love2d/library/{love.keyboard.lua => love/keyboard.lua} (100%) rename meta/3rd/love2d/library/{love.math.lua => love/math.lua} (100%) rename meta/3rd/love2d/library/{love.mouse.lua => love/mouse.lua} (100%) rename meta/3rd/love2d/library/{love.physics.lua => love/physics.lua} (100%) rename meta/3rd/love2d/library/{love.sound.lua => love/sound.lua} (100%) rename meta/3rd/love2d/library/{love.system.lua => love/system.lua} (100%) rename meta/3rd/love2d/library/{love.thread.lua => love/thread.lua} (100%) rename meta/3rd/love2d/library/{love.timer.lua => love/timer.lua} (100%) rename meta/3rd/love2d/library/{love.touch.lua => love/touch.lua} (100%) rename meta/3rd/love2d/library/{love.video.lua => love/video.lua} (100%) rename meta/3rd/love2d/library/{love.window.lua => love/window.lua} (100%) delete mode 100644 meta/3rd/lovr/library/lovr.lovr.lua rename meta/3rd/lovr/library/{lovr.audio.lua => lovr/audio.lua} (100%) rename meta/3rd/lovr/library/{lovr.data.lua => lovr/data.lua} (100%) rename meta/3rd/lovr/library/{lovr.event.lua => lovr/event.lua} (100%) rename meta/3rd/lovr/library/{lovr.filesystem.lua => lovr/filesystem.lua} (100%) rename meta/3rd/lovr/library/{lovr.graphics.lua => lovr/graphics.lua} (100%) rename meta/3rd/lovr/library/{lovr.headset.lua => lovr/headset.lua} (100%) rename meta/3rd/lovr/library/{lovr.math.lua => lovr/math.lua} (100%) rename meta/3rd/lovr/library/{lovr.physics.lua => lovr/physics.lua} (100%) rename meta/3rd/lovr/library/{lovr.system.lua => lovr/system.lua} (100%) rename meta/3rd/lovr/library/{lovr.thread.lua => lovr/thread.lua} (100%) rename meta/3rd/lovr/library/{lovr.timer.lua => lovr/timer.lua} (100%) diff --git a/meta/3rd/love2d/library/love.audio.lua b/meta/3rd/love2d/library/love/audio.lua similarity index 100% rename from meta/3rd/love2d/library/love.audio.lua rename to meta/3rd/love2d/library/love/audio.lua diff --git a/meta/3rd/love2d/library/love.data.lua b/meta/3rd/love2d/library/love/data.lua similarity index 100% rename from meta/3rd/love2d/library/love.data.lua rename to meta/3rd/love2d/library/love/data.lua diff --git a/meta/3rd/love2d/library/love.event.lua b/meta/3rd/love2d/library/love/event.lua similarity index 100% rename from meta/3rd/love2d/library/love.event.lua rename to meta/3rd/love2d/library/love/event.lua diff --git a/meta/3rd/love2d/library/love.filesystem.lua b/meta/3rd/love2d/library/love/filesystem.lua similarity index 100% rename from meta/3rd/love2d/library/love.filesystem.lua rename to meta/3rd/love2d/library/love/filesystem.lua diff --git a/meta/3rd/love2d/library/love.font.lua b/meta/3rd/love2d/library/love/font.lua similarity index 100% rename from meta/3rd/love2d/library/love.font.lua rename to meta/3rd/love2d/library/love/font.lua diff --git a/meta/3rd/love2d/library/love.graphics.lua b/meta/3rd/love2d/library/love/graphics.lua similarity index 100% rename from meta/3rd/love2d/library/love.graphics.lua rename to meta/3rd/love2d/library/love/graphics.lua diff --git a/meta/3rd/love2d/library/love.image.lua b/meta/3rd/love2d/library/love/image.lua similarity index 100% rename from meta/3rd/love2d/library/love.image.lua rename to meta/3rd/love2d/library/love/image.lua diff --git a/meta/3rd/love2d/library/love.joystick.lua b/meta/3rd/love2d/library/love/joystick.lua similarity index 100% rename from meta/3rd/love2d/library/love.joystick.lua rename to meta/3rd/love2d/library/love/joystick.lua diff --git a/meta/3rd/love2d/library/love.keyboard.lua b/meta/3rd/love2d/library/love/keyboard.lua similarity index 100% rename from meta/3rd/love2d/library/love.keyboard.lua rename to meta/3rd/love2d/library/love/keyboard.lua diff --git a/meta/3rd/love2d/library/love.math.lua b/meta/3rd/love2d/library/love/math.lua similarity index 100% rename from meta/3rd/love2d/library/love.math.lua rename to meta/3rd/love2d/library/love/math.lua diff --git a/meta/3rd/love2d/library/love.mouse.lua b/meta/3rd/love2d/library/love/mouse.lua similarity index 100% rename from meta/3rd/love2d/library/love.mouse.lua rename to meta/3rd/love2d/library/love/mouse.lua diff --git a/meta/3rd/love2d/library/love.physics.lua b/meta/3rd/love2d/library/love/physics.lua similarity index 100% rename from meta/3rd/love2d/library/love.physics.lua rename to meta/3rd/love2d/library/love/physics.lua diff --git a/meta/3rd/love2d/library/love.sound.lua b/meta/3rd/love2d/library/love/sound.lua similarity index 100% rename from meta/3rd/love2d/library/love.sound.lua rename to meta/3rd/love2d/library/love/sound.lua diff --git a/meta/3rd/love2d/library/love.system.lua b/meta/3rd/love2d/library/love/system.lua similarity index 100% rename from meta/3rd/love2d/library/love.system.lua rename to meta/3rd/love2d/library/love/system.lua diff --git a/meta/3rd/love2d/library/love.thread.lua b/meta/3rd/love2d/library/love/thread.lua similarity index 100% rename from meta/3rd/love2d/library/love.thread.lua rename to meta/3rd/love2d/library/love/thread.lua diff --git a/meta/3rd/love2d/library/love.timer.lua b/meta/3rd/love2d/library/love/timer.lua similarity index 100% rename from meta/3rd/love2d/library/love.timer.lua rename to meta/3rd/love2d/library/love/timer.lua diff --git a/meta/3rd/love2d/library/love.touch.lua b/meta/3rd/love2d/library/love/touch.lua similarity index 100% rename from meta/3rd/love2d/library/love.touch.lua rename to meta/3rd/love2d/library/love/touch.lua diff --git a/meta/3rd/love2d/library/love.video.lua b/meta/3rd/love2d/library/love/video.lua similarity index 100% rename from meta/3rd/love2d/library/love.video.lua rename to meta/3rd/love2d/library/love/video.lua diff --git a/meta/3rd/love2d/library/love.window.lua b/meta/3rd/love2d/library/love/window.lua similarity index 100% rename from meta/3rd/love2d/library/love.window.lua rename to meta/3rd/love2d/library/love/window.lua diff --git a/meta/3rd/lovr/library/lovr.lovr.lua b/meta/3rd/lovr/library/lovr.lovr.lua deleted file mode 100644 index 6367c7681..000000000 --- a/meta/3rd/lovr/library/lovr.lovr.lua +++ /dev/null @@ -1,15 +0,0 @@ ----@meta - ---- ----`lovr` is the single global table that is exposed to every LÖVR app. It contains a set of **modules** and a set of **callbacks**. ---- ----@class lovr.lovr -lovr.lovr = {} - ---- ----Get the current major, minor, and patch version of LÖVR. ---- ----@return number major # The major version. ----@return number minor # The minor version. ----@return number patch # The patch number. -function lovr.lovr.getVersion() end diff --git a/meta/3rd/lovr/library/lovr.audio.lua b/meta/3rd/lovr/library/lovr/audio.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.audio.lua rename to meta/3rd/lovr/library/lovr/audio.lua diff --git a/meta/3rd/lovr/library/lovr.data.lua b/meta/3rd/lovr/library/lovr/data.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.data.lua rename to meta/3rd/lovr/library/lovr/data.lua diff --git a/meta/3rd/lovr/library/lovr.event.lua b/meta/3rd/lovr/library/lovr/event.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.event.lua rename to meta/3rd/lovr/library/lovr/event.lua diff --git a/meta/3rd/lovr/library/lovr.filesystem.lua b/meta/3rd/lovr/library/lovr/filesystem.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.filesystem.lua rename to meta/3rd/lovr/library/lovr/filesystem.lua diff --git a/meta/3rd/lovr/library/lovr.graphics.lua b/meta/3rd/lovr/library/lovr/graphics.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.graphics.lua rename to meta/3rd/lovr/library/lovr/graphics.lua diff --git a/meta/3rd/lovr/library/lovr.headset.lua b/meta/3rd/lovr/library/lovr/headset.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.headset.lua rename to meta/3rd/lovr/library/lovr/headset.lua diff --git a/meta/3rd/lovr/library/lovr.math.lua b/meta/3rd/lovr/library/lovr/math.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.math.lua rename to meta/3rd/lovr/library/lovr/math.lua diff --git a/meta/3rd/lovr/library/lovr.physics.lua b/meta/3rd/lovr/library/lovr/physics.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.physics.lua rename to meta/3rd/lovr/library/lovr/physics.lua diff --git a/meta/3rd/lovr/library/lovr.system.lua b/meta/3rd/lovr/library/lovr/system.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.system.lua rename to meta/3rd/lovr/library/lovr/system.lua diff --git a/meta/3rd/lovr/library/lovr.thread.lua b/meta/3rd/lovr/library/lovr/thread.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.thread.lua rename to meta/3rd/lovr/library/lovr/thread.lua diff --git a/meta/3rd/lovr/library/lovr.timer.lua b/meta/3rd/lovr/library/lovr/timer.lua similarity index 100% rename from meta/3rd/lovr/library/lovr.timer.lua rename to meta/3rd/lovr/library/lovr/timer.lua diff --git a/tools/love-api.lua b/tools/love-api.lua index 7300ccc3a..b59b4b26d 100644 --- a/tools/love-api.lua +++ b/tools/love-api.lua @@ -51,19 +51,19 @@ local function formatIndex(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 + 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 @@ -196,7 +196,7 @@ local function buildFunction(func, node, typeName) end local function buildFile(class, defs) - local filePath = libraryPath / (class .. '.lua') + local filePath = libraryPath / (class:gsub('%.', '/') .. '.lua') local text = {} text[#text+1] = '---@meta' @@ -251,6 +251,7 @@ local function buildFile(class, defs) text[#text+1] = '' + fs.create_directories(filePath:parent_path()) fsu.saveFile(filePath, table.concat(text, '\n')) end diff --git a/tools/lovr-api.lua b/tools/lovr-api.lua index f045afa87..4c4831fbc 100644 --- a/tools/lovr-api.lua +++ b/tools/lovr-api.lua @@ -52,19 +52,19 @@ local function formatIndex(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 + 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 @@ -200,7 +200,7 @@ end local function buildFile(defs) local class = defs.key - local filePath = libraryPath / (class .. '.lua') + local filePath = libraryPath / (class:gsub('%.', '/') .. '.lua') local text = {} text[#text+1] = '---@meta' @@ -246,6 +246,7 @@ local function buildFile(defs) text[#text+1] = '' + fs.create_directories(filePath:parent_path()) fsu.saveFile(filePath, table.concat(text, '\n')) end From 04fa96b7c0abba4d7cca03ed12ff3b65b3912e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 01:23:32 +0800 Subject: [PATCH 017/965] fix #1431 --- changelog.md | 1 + .../library/{cc.Action.lua => cc/Action.lua} | 0 .../ActionCamera.lua} | 0 .../{cc.ActionEase.lua => cc/ActionEase.lua} | 0 .../{cc.ActionFloat.lua => cc/ActionFloat.lua} | 0 .../ActionInstant.lua} | 0 .../ActionInterval.lua} | 0 .../ActionManager.lua} | 0 .../{cc.ActionTween.lua => cc/ActionTween.lua} | 0 .../AmbientLight.lua} | 0 .../library/{cc.Animate.lua => cc/Animate.lua} | 0 .../{cc.Animate3D.lua => cc/Animate3D.lua} | 0 .../{cc.Animation.lua => cc/Animation.lua} | 0 .../{cc.Animation3D.lua => cc/Animation3D.lua} | 0 .../AnimationCache.lua} | 0 .../AnimationFrame.lua} | 0 .../{cc.Application.lua => cc/Application.lua} | 0 .../AssetsManager.lua} | 0 .../AssetsManagerEx.lua} | 0 .../AsyncTaskPool.lua} | 0 .../{cc.AtlasNode.lua => cc/AtlasNode.lua} | 0 .../{cc.AttachNode.lua => cc/AttachNode.lua} | 0 .../{cc.AudioEngine.lua => cc/AudioEngine.lua} | 0 .../AudioProfile.lua} | 0 .../{cc.AutoPolygon.lua => cc/AutoPolygon.lua} | 0 .../{cc.BaseLight.lua => cc/BaseLight.lua} | 0 .../{cc.BezierBy.lua => cc/BezierBy.lua} | 0 .../{cc.BezierTo.lua => cc/BezierTo.lua} | 0 .../{cc.BillBoard.lua => cc/BillBoard.lua} | 0 .../library/{cc.Blink.lua => cc/Blink.lua} | 0 .../{cc.Bundle3D.lua => cc/Bundle3D.lua} | 0 .../{cc.CSLoader.lua => cc/CSLoader.lua} | 0 .../{cc.CallFunc.lua => cc/CallFunc.lua} | 0 .../library/{cc.Camera.lua => cc/Camera.lua} | 0 .../CameraBackgroundBrush.lua} | 0 .../CameraBackgroundColorBrush.lua} | 0 .../CameraBackgroundDepthBrush.lua} | 0 .../CameraBackgroundSkyBoxBrush.lua} | 0 .../CardinalSplineBy.lua} | 0 .../CardinalSplineTo.lua} | 0 .../CatmullRomBy.lua} | 0 .../CatmullRomTo.lua} | 0 .../ClippingNode.lua} | 0 .../ClippingRectangleNode.lua} | 0 .../{cc.Component.lua => cc/Component.lua} | 0 .../ComponentLua.lua} | 0 .../library/{cc.Console.lua => cc/Console.lua} | 0 .../library/{cc.Control.lua => cc/Control.lua} | 0 .../ControlButton.lua} | 0 .../ControlColourPicker.lua} | 0 .../ControlHuePicker.lua} | 0 .../ControlPotentiometer.lua} | 0 .../ControlSaturationBrightnessPicker.lua} | 0 .../ControlSlider.lua} | 0 .../ControlStepper.lua} | 0 .../ControlSwitch.lua} | 0 .../{cc.Controller.lua => cc/Controller.lua} | 0 .../{cc.DelayTime.lua => cc/DelayTime.lua} | 0 .../library/{cc.Device.lua => cc/Device.lua} | 0 .../DirectionLight.lua} | 0 .../{cc.Director.lua => cc/Director.lua} | 0 .../{cc.DrawNode.lua => cc/DrawNode.lua} | 0 .../{cc.EaseBackIn.lua => cc/EaseBackIn.lua} | 0 .../EaseBackInOut.lua} | 0 .../{cc.EaseBackOut.lua => cc/EaseBackOut.lua} | 0 .../EaseBezierAction.lua} | 0 .../{cc.EaseBounce.lua => cc/EaseBounce.lua} | 0 .../EaseBounceIn.lua} | 0 .../EaseBounceInOut.lua} | 0 .../EaseBounceOut.lua} | 0 .../EaseCircleActionIn.lua} | 0 .../EaseCircleActionInOut.lua} | 0 .../EaseCircleActionOut.lua} | 0 .../EaseCubicActionIn.lua} | 0 .../EaseCubicActionInOut.lua} | 0 .../EaseCubicActionOut.lua} | 0 .../{cc.EaseElastic.lua => cc/EaseElastic.lua} | 0 .../EaseElasticIn.lua} | 0 .../EaseElasticInOut.lua} | 0 .../EaseElasticOut.lua} | 0 .../EaseExponentialIn.lua} | 0 .../EaseExponentialInOut.lua} | 0 .../EaseExponentialOut.lua} | 0 .../library/{cc.EaseIn.lua => cc/EaseIn.lua} | 0 .../{cc.EaseInOut.lua => cc/EaseInOut.lua} | 0 .../library/{cc.EaseOut.lua => cc/EaseOut.lua} | 0 .../EaseQuadraticActionIn.lua} | 0 .../EaseQuadraticActionInOut.lua} | 0 .../EaseQuadraticActionOut.lua} | 0 .../EaseQuarticActionIn.lua} | 0 .../EaseQuarticActionInOut.lua} | 0 .../EaseQuarticActionOut.lua} | 0 .../EaseQuinticActionIn.lua} | 0 .../EaseQuinticActionInOut.lua} | 0 .../EaseQuinticActionOut.lua} | 0 .../EaseRateAction.lua} | 0 .../{cc.EaseSineIn.lua => cc/EaseSineIn.lua} | 0 .../EaseSineInOut.lua} | 0 .../{cc.EaseSineOut.lua => cc/EaseSineOut.lua} | 0 .../library/{cc.Event.lua => cc/Event.lua} | 0 .../EventAcceleration.lua} | 0 .../EventAssetsManagerEx.lua} | 0 .../EventController.lua} | 0 .../{cc.EventCustom.lua => cc/EventCustom.lua} | 0 .../EventDispatcher.lua} | 0 .../{cc.EventFocus.lua => cc/EventFocus.lua} | 0 .../EventKeyboard.lua} | 0 .../EventListener.lua} | 0 .../EventListenerAcceleration.lua} | 0 .../EventListenerAssetsManagerEx.lua} | 0 .../EventListenerController.lua} | 0 .../EventListenerCustom.lua} | 0 .../EventListenerFocus.lua} | 0 .../EventListenerKeyboard.lua} | 0 .../EventListenerMouse.lua} | 0 .../EventListenerPhysicsContact.lua} | 0 .../EventListenerPhysicsContactWithBodies.lua} | 0 .../EventListenerPhysicsContactWithGroup.lua} | 0 .../EventListenerPhysicsContactWithShapes.lua} | 0 .../EventListenerTouchAllAtOnce.lua} | 0 .../EventListenerTouchOneByOne.lua} | 0 .../{cc.EventMouse.lua => cc/EventMouse.lua} | 0 .../{cc.EventTouch.lua => cc/EventTouch.lua} | 0 .../library/{cc.FadeIn.lua => cc/FadeIn.lua} | 0 .../library/{cc.FadeOut.lua => cc/FadeOut.lua} | 0 .../FadeOutBLTiles.lua} | 0 .../FadeOutDownTiles.lua} | 0 .../FadeOutTRTiles.lua} | 0 .../FadeOutUpTiles.lua} | 0 .../library/{cc.FadeTo.lua => cc/FadeTo.lua} | 0 .../FastTMXLayer.lua} | 0 .../FastTMXTiledMap.lua} | 0 .../{cc.FileUtils.lua => cc/FileUtils.lua} | 0 .../FiniteTimeAction.lua} | 0 .../library/{cc.FlipX.lua => cc/FlipX.lua} | 0 .../library/{cc.FlipX3D.lua => cc/FlipX3D.lua} | 0 .../library/{cc.FlipY.lua => cc/FlipY.lua} | 0 .../library/{cc.FlipY3D.lua => cc/FlipY3D.lua} | 0 .../library/{cc.Follow.lua => cc/Follow.lua} | 0 .../library/{cc.GLView.lua => cc/GLView.lua} | 0 .../{cc.GLViewImpl.lua => cc/GLViewImpl.lua} | 0 .../library/{cc.Grid3D.lua => cc/Grid3D.lua} | 0 .../Grid3DAction.lua} | 0 .../{cc.GridAction.lua => cc/GridAction.lua} | 0 .../{cc.GridBase.lua => cc/GridBase.lua} | 0 .../library/{cc.Hide.lua => cc/Hide.lua} | 0 .../library/{cc.Image.lua => cc/Image.lua} | 0 .../library/{cc.JumpBy.lua => cc/JumpBy.lua} | 0 .../{cc.JumpTiles3D.lua => cc/JumpTiles3D.lua} | 0 .../library/{cc.JumpTo.lua => cc/JumpTo.lua} | 0 .../library/{cc.Label.lua => cc/Label.lua} | 0 .../{cc.LabelAtlas.lua => cc/LabelAtlas.lua} | 0 .../library/{cc.Layer.lua => cc/Layer.lua} | 0 .../{cc.LayerColor.lua => cc/LayerColor.lua} | 0 .../LayerGradient.lua} | 0 .../LayerMultiplex.lua} | 0 .../LayerRadialGradient.lua} | 0 .../library/{cc.Lens3D.lua => cc/Lens3D.lua} | 0 .../library/{cc.Liquid.lua => cc/Liquid.lua} | 0 .../{cc.Manifest.lua => cc/Manifest.lua} | 0 .../{cc.Material.lua => cc/Material.lua} | 0 .../library/{cc.Menu.lua => cc/Menu.lua} | 0 .../{cc.MenuItem.lua => cc/MenuItem.lua} | 0 .../MenuItemAtlasFont.lua} | 0 .../MenuItemFont.lua} | 0 .../MenuItemImage.lua} | 0 .../MenuItemLabel.lua} | 0 .../MenuItemSprite.lua} | 0 .../MenuItemToggle.lua} | 0 .../library/{cc.Mesh.lua => cc/Mesh.lua} | 0 .../MotionStreak.lua} | 0 .../MotionStreak3D.lua} | 0 .../library/{cc.MoveBy.lua => cc/MoveBy.lua} | 0 .../library/{cc.MoveTo.lua => cc/MoveTo.lua} | 0 .../library/{cc.NavMesh.lua => cc/NavMesh.lua} | 0 .../NavMeshAgent.lua} | 0 .../NavMeshObstacle.lua} | 0 .../library/{cc.Node.lua => cc/Node.lua} | 0 .../{cc.NodeGrid.lua => cc/NodeGrid.lua} | 0 .../{cc.OrbitCamera.lua => cc/OrbitCamera.lua} | 0 .../PUParticleSystem3D.lua} | 0 .../{cc.PageTurn3D.lua => cc/PageTurn3D.lua} | 0 .../ParallaxNode.lua} | 0 .../ParticleBatchNode.lua} | 0 .../ParticleData.lua} | 0 .../ParticleExplosion.lua} | 0 .../ParticleFire.lua} | 0 .../ParticleFireworks.lua} | 0 .../ParticleFlower.lua} | 0 .../ParticleGalaxy.lua} | 0 .../ParticleMeteor.lua} | 0 .../ParticleRain.lua} | 0 .../ParticleSmoke.lua} | 0 .../ParticleSnow.lua} | 0 .../ParticleSpiral.lua} | 0 .../{cc.ParticleSun.lua => cc/ParticleSun.lua} | 0 .../ParticleSystem.lua} | 0 .../ParticleSystem3D.lua} | 0 .../ParticleSystemQuad.lua} | 0 .../library/{cc.Pass.lua => cc/Pass.lua} | 0 .../Physics3D6DofConstraint.lua} | 0 .../Physics3DComponent.lua} | 0 .../Physics3DConeTwistConstraint.lua} | 0 .../Physics3DConstraint.lua} | 0 .../Physics3DHingeConstraint.lua} | 0 .../Physics3DObject.lua} | 0 .../Physics3DPointToPointConstraint.lua} | 0 .../Physics3DRigidBody.lua} | 0 .../Physics3DShape.lua} | 0 .../Physics3DSliderConstraint.lua} | 0 .../Physics3DWorld.lua} | 0 .../{cc.PhysicsBody.lua => cc/PhysicsBody.lua} | 0 .../PhysicsContact.lua} | 0 .../PhysicsContactPostSolve.lua} | 0 .../PhysicsContactPreSolve.lua} | 0 .../PhysicsJoint.lua} | 0 .../PhysicsJointDistance.lua} | 0 .../PhysicsJointFixed.lua} | 0 .../PhysicsJointGear.lua} | 0 .../PhysicsJointGroove.lua} | 0 .../PhysicsJointLimit.lua} | 0 .../PhysicsJointMotor.lua} | 0 .../PhysicsJointPin.lua} | 0 .../PhysicsJointRatchet.lua} | 0 .../PhysicsJointRotaryLimit.lua} | 0 .../PhysicsJointRotarySpring.lua} | 0 .../PhysicsJointSpring.lua} | 0 .../PhysicsShape.lua} | 0 .../PhysicsShapeBox.lua} | 0 .../PhysicsShapeCircle.lua} | 0 .../PhysicsShapeEdgeBox.lua} | 0 .../PhysicsShapeEdgeChain.lua} | 0 .../PhysicsShapeEdgePolygon.lua} | 0 .../PhysicsShapeEdgeSegment.lua} | 0 .../PhysicsShapePolygon.lua} | 0 .../PhysicsSprite3D.lua} | 0 .../PhysicsWorld.lua} | 0 .../library/{cc.Place.lua => cc/Place.lua} | 0 .../{cc.PointLight.lua => cc/PointLight.lua} | 0 .../{cc.PolygonInfo.lua => cc/PolygonInfo.lua} | 0 .../ProgressFromTo.lua} | 0 .../ProgressTimer.lua} | 0 .../{cc.ProgressTo.lua => cc/ProgressTo.lua} | 0 .../{cc.Properties.lua => cc/Properties.lua} | 0 .../ProtectedNode.lua} | 0 .../Cocos4.0/library/{cc.Ref.lua => cc/Ref.lua} | 0 .../{cc.RemoveSelf.lua => cc/RemoveSelf.lua} | 0 .../{cc.RenderState.lua => cc/RenderState.lua} | 0 .../RenderTexture.lua} | 0 .../{cc.Renderer.lua => cc/Renderer.lua} | 0 .../library/{cc.Repeat.lua => cc/Repeat.lua} | 0 .../RepeatForever.lua} | 0 .../{cc.ReuseGrid.lua => cc/ReuseGrid.lua} | 0 .../{cc.Ripple3D.lua => cc/Ripple3D.lua} | 0 .../{cc.RotateBy.lua => cc/RotateBy.lua} | 0 .../{cc.RotateTo.lua => cc/RotateTo.lua} | 0 .../library/{cc.ScaleBy.lua => cc/ScaleBy.lua} | 0 .../library/{cc.ScaleTo.lua => cc/ScaleTo.lua} | 0 .../library/{cc.Scene.lua => cc/Scene.lua} | 0 .../{cc.Scheduler.lua => cc/Scheduler.lua} | 0 .../{cc.Sequence.lua => cc/Sequence.lua} | 0 .../{cc.ShaderCache.lua => cc/ShaderCache.lua} | 0 .../library/{cc.Shaky3D.lua => cc/Shaky3D.lua} | 0 .../ShakyTiles3D.lua} | 0 .../ShatteredTiles3D.lua} | 0 .../library/{cc.Show.lua => cc/Show.lua} | 0 .../ShuffleTiles.lua} | 0 .../{cc.Skeleton3D.lua => cc/Skeleton3D.lua} | 0 .../library/{cc.SkewBy.lua => cc/SkewBy.lua} | 0 .../library/{cc.SkewTo.lua => cc/SkewTo.lua} | 0 .../library/{cc.Skybox.lua => cc/Skybox.lua} | 0 .../library/{cc.Spawn.lua => cc/Spawn.lua} | 0 .../library/{cc.Speed.lua => cc/Speed.lua} | 0 .../{cc.SplitCols.lua => cc/SplitCols.lua} | 0 .../{cc.SplitRows.lua => cc/SplitRows.lua} | 0 .../{cc.SpotLight.lua => cc/SpotLight.lua} | 0 .../library/{cc.Sprite.lua => cc/Sprite.lua} | 0 .../{cc.Sprite3D.lua => cc/Sprite3D.lua} | 0 .../Sprite3DCache.lua} | 0 .../Sprite3DMaterial.lua} | 0 .../SpriteBatchNode.lua} | 0 .../{cc.SpriteFrame.lua => cc/SpriteFrame.lua} | 0 .../SpriteFrameCache.lua} | 0 .../{cc.StopGrid.lua => cc/StopGrid.lua} | 0 .../{cc.TMXLayer.lua => cc/TMXLayer.lua} | 0 .../TMXLayerInfo.lua} | 0 .../{cc.TMXMapInfo.lua => cc/TMXMapInfo.lua} | 0 .../TMXObjectGroup.lua} | 0 .../{cc.TMXTiledMap.lua => cc/TMXTiledMap.lua} | 0 .../TMXTilesetInfo.lua} | 0 .../{cc.TableView.lua => cc/TableView.lua} | 0 .../TableViewCell.lua} | 0 .../TargetedAction.lua} | 0 .../{cc.Technique.lua => cc/Technique.lua} | 0 .../library/{cc.Terrain.lua => cc/Terrain.lua} | 0 .../{cc.Texture2D.lua => cc/Texture2D.lua} | 0 .../TextureCache.lua} | 0 .../{cc.TextureCube.lua => cc/TextureCube.lua} | 0 .../TileMapAtlas.lua} | 0 .../{cc.TiledGrid3D.lua => cc/TiledGrid3D.lua} | 0 .../TiledGrid3DAction.lua} | 0 .../library/{cc.Timer.lua => cc/Timer.lua} | 0 .../library/{cc.TintBy.lua => cc/TintBy.lua} | 0 .../library/{cc.TintTo.lua => cc/TintTo.lua} | 0 .../ToggleVisibility.lua} | 0 .../library/{cc.Touch.lua => cc/Touch.lua} | 0 .../TransitionCrossFade.lua} | 0 .../TransitionEaseScene.lua} | 0 .../TransitionFade.lua} | 0 .../TransitionFadeBL.lua} | 0 .../TransitionFadeDown.lua} | 0 .../TransitionFadeTR.lua} | 0 .../TransitionFadeUp.lua} | 0 .../TransitionFlipAngular.lua} | 0 .../TransitionFlipX.lua} | 0 .../TransitionFlipY.lua} | 0 .../TransitionJumpZoom.lua} | 0 .../TransitionMoveInB.lua} | 0 .../TransitionMoveInL.lua} | 0 .../TransitionMoveInR.lua} | 0 .../TransitionMoveInT.lua} | 0 .../TransitionPageTurn.lua} | 0 .../TransitionProgress.lua} | 0 .../TransitionProgressHorizontal.lua} | 0 .../TransitionProgressInOut.lua} | 0 .../TransitionProgressOutIn.lua} | 0 .../TransitionProgressRadialCCW.lua} | 0 .../TransitionProgressRadialCW.lua} | 0 .../TransitionProgressVertical.lua} | 0 .../TransitionRotoZoom.lua} | 0 .../TransitionScene.lua} | 0 .../TransitionSceneOriented.lua} | 0 .../TransitionShrinkGrow.lua} | 0 .../TransitionSlideInB.lua} | 0 .../TransitionSlideInL.lua} | 0 .../TransitionSlideInR.lua} | 0 .../TransitionSlideInT.lua} | 0 .../TransitionSplitCols.lua} | 0 .../TransitionSplitRows.lua} | 0 .../TransitionTurnOffTiles.lua} | 0 .../TransitionZoomFlipAngular.lua} | 0 .../TransitionZoomFlipX.lua} | 0 .../TransitionZoomFlipY.lua} | 0 .../TurnOffTiles.lua} | 0 .../library/{cc.Twirl.lua => cc/Twirl.lua} | 0 .../{cc.UserDefault.lua => cc/UserDefault.lua} | 0 .../library/{cc.Waves.lua => cc/Waves.lua} | 0 .../library/{cc.Waves3D.lua => cc/Waves3D.lua} | 0 .../WavesTiles3D.lua} | 0 .../{ccb.Program.lua => ccb/Program.lua} | 0 .../ProgramState.lua} | 0 .../Texture2DBackend.lua} | 0 .../TextureBackend.lua} | 0 .../TextureCubemapBackend.lua} | 0 .../VertexLayout.lua} | 0 .../ActionFadeFrame.lua} | 0 .../ActionFrame.lua} | 0 .../ActionManagerEx.lua} | 0 .../ActionMoveFrame.lua} | 0 .../ActionObject.lua} | 0 .../ActionRotationFrame.lua} | 0 .../ActionScaleFrame.lua} | 0 .../ActionTimeline.lua} | 0 .../ActionTimelineCache.lua} | 0 .../ActionTimelineData.lua} | 0 .../ActionTimelineNode.lua} | 0 .../ActionTintFrame.lua} | 0 .../{ccs.AlphaFrame.lua => ccs/AlphaFrame.lua} | 0 .../AnchorPointFrame.lua} | 0 .../AnimationData.lua} | 0 .../{ccs.Armature.lua => ccs/Armature.lua} | 0 .../ArmatureAnimation.lua} | 0 .../ArmatureData.lua} | 0 .../ArmatureDataManager.lua} | 0 .../ArmatureDisplayData.lua} | 0 .../{ccs.BaseData.lua => ccs/BaseData.lua} | 0 .../{ccs.BatchNode.lua => ccs/BatchNode.lua} | 0 .../BlendFuncFrame.lua} | 0 .../library/{ccs.Bone.lua => ccs/Bone.lua} | 0 .../{ccs.BoneData.lua => ccs/BoneData.lua} | 0 .../{ccs.BoneNode.lua => ccs/BoneNode.lua} | 0 .../{ccs.ColorFrame.lua => ccs/ColorFrame.lua} | 0 .../ComAttribute.lua} | 0 .../{ccs.ComAudio.lua => ccs/ComAudio.lua} | 0 .../ComController.lua} | 0 .../ComExtensionData.lua} | 0 .../{ccs.ComRender.lua => ccs/ComRender.lua} | 0 .../ContourData.lua} | 0 .../DisplayData.lua} | 0 .../DisplayManager.lua} | 0 .../{ccs.EventFrame.lua => ccs/EventFrame.lua} | 0 .../library/{ccs.Frame.lua => ccs/Frame.lua} | 0 .../{ccs.FrameData.lua => ccs/FrameData.lua} | 0 .../{ccs.GUIReader.lua => ccs/GUIReader.lua} | 0 .../InnerActionFrame.lua} | 0 .../MovementBoneData.lua} | 0 .../MovementData.lua} | 0 .../ParticleDisplayData.lua} | 0 .../PlayableFrame.lua} | 0 .../PositionFrame.lua} | 0 .../RotationFrame.lua} | 0 .../RotationSkewFrame.lua} | 0 .../{ccs.ScaleFrame.lua => ccs/ScaleFrame.lua} | 0 .../SceneReader.lua} | 0 .../SkeletonNode.lua} | 0 .../{ccs.SkewFrame.lua => ccs/SkewFrame.lua} | 0 .../library/{ccs.Skin.lua => ccs/Skin.lua} | 0 .../SpriteDisplayData.lua} | 0 .../TextureData.lua} | 0 .../TextureFrame.lua} | 0 .../{ccs.Timeline.lua => ccs/Timeline.lua} | 0 .../library/{ccs.Tween.lua => ccs/Tween.lua} | 0 .../VisibleFrame.lua} | 0 .../ZOrderFrame.lua} | 0 .../AbstractCheckButton.lua} | 0 .../{ccui.Button.lua => ccui/Button.lua} | 0 .../{ccui.CheckBox.lua => ccui/CheckBox.lua} | 0 .../{ccui.EditBox.lua => ccui/EditBox.lua} | 0 .../library/{ccui.HBox.lua => ccui/HBox.lua} | 0 .../{ccui.Helper.lua => ccui/Helper.lua} | 0 .../{ccui.ImageView.lua => ccui/ImageView.lua} | 0 .../{ccui.Layout.lua => ccui/Layout.lua} | 0 .../LayoutComponent.lua} | 0 .../LayoutParameter.lua} | 0 .../LinearLayoutParameter.lua} | 0 .../{ccui.ListView.lua => ccui/ListView.lua} | 0 .../LoadingBar.lua} | 0 .../{ccui.PageView.lua => ccui/PageView.lua} | 0 .../RadioButton.lua} | 0 .../RadioButtonGroup.lua} | 0 .../RelativeBox.lua} | 0 .../RelativeLayoutParameter.lua} | 0 .../RichElement.lua} | 0 .../RichElementCustomNode.lua} | 0 .../RichElementImage.lua} | 0 .../RichElementNewLine.lua} | 0 .../RichElementText.lua} | 0 .../{ccui.RichText.lua => ccui/RichText.lua} | 0 .../Scale9Sprite.lua} | 0 .../ScrollView.lua} | 0 .../{ccui.Slider.lua => ccui/Slider.lua} | 0 .../TabControl.lua} | 0 .../{ccui.TabHeader.lua => ccui/TabHeader.lua} | 0 .../library/{ccui.Text.lua => ccui/Text.lua} | 0 .../{ccui.TextAtlas.lua => ccui/TextAtlas.lua} | 0 .../TextBMFont.lua} | 0 .../{ccui.TextField.lua => ccui/TextField.lua} | 0 .../library/{ccui.VBox.lua => ccui/VBox.lua} | 0 .../VideoPlayer.lua} | 0 .../{ccui.WebView.lua => ccui/WebView.lua} | 0 .../{ccui.Widget.lua => ccui/Widget.lua} | 0 .../SkeletonAnimation.lua} | 0 .../SkeletonRenderer.lua} | 0 .../library/{cjson.safe.lua => cjson/safe.lua} | 0 .../{ngx.balancer.lua => ngx/balancer.lua} | 0 .../library/{ngx.base64.lua => ngx/base64.lua} | 0 .../library/{ngx.errlog.lua => ngx/errlog.lua} | 0 .../library/{ngx.ocsp.lua => ngx/ocsp.lua} | 0 .../library/{ngx.pipe.lua => ngx/pipe.lua} | 0 .../{ngx.process.lua => ngx/process.lua} | 0 .../library/{ngx.re.lua => ngx/re.lua} | 0 .../library/{ngx.req.lua => ngx/req.lua} | 0 .../library/{ngx.resp.lua => ngx/resp.lua} | 0 .../{ngx.semaphore.lua => ngx/semaphore.lua} | 0 .../library/{ngx.ssl.lua => ngx/ssl.lua} | 0 .../ssl/clienthello.lua} | 0 .../ssl/session.lua} | 0 .../{ngx.upstream.lua => ngx/upstream.lua} | 0 .../library/{resty.aes.lua => resty/aes.lua} | 0 .../library/{resty.core.lua => resty/core.lua} | 0 .../core/base.lua} | 0 .../core/base64.lua} | 0 .../{resty.core.ctx.lua => resty/core/ctx.lua} | 0 .../core/exit.lua} | 0 .../core/hash.lua} | 0 .../core/misc.lua} | 0 .../{resty.core.ndk.lua => resty/core/ndk.lua} | 0 .../core/phase.lua} | 0 .../core/regex.lua} | 0 .../core/request.lua} | 0 .../core/response.lua} | 0 .../core/shdict.lua} | 0 .../core/time.lua} | 0 .../{resty.core.uri.lua => resty/core/uri.lua} | 0 .../core/utils.lua} | 0 .../{resty.core.var.lua => resty/core/var.lua} | 0 .../core/worker.lua} | 0 .../dns/resolver.lua} | 0 .../limit/conn.lua} | 0 .../limit/count.lua} | 0 .../limit/req.lua} | 0 .../limit/traffic.lua} | 0 .../library/{resty.lock.lua => resty/lock.lua} | 0 .../{resty.lrucache.lua => resty/lrucache.lua} | 0 .../lrucache/pureffi.lua} | 0 .../library/{resty.md5.lua => resty/md5.lua} | 0 .../memcached.lua} | 0 .../{resty.mysql.lua => resty/mysql.lua} | 0 .../{resty.random.lua => resty/random.lua} | 0 .../{resty.redis.lua => resty/redis.lua} | 0 .../library/{resty.sha.lua => resty/sha.lua} | 0 .../library/{resty.sha1.lua => resty/sha1.lua} | 0 .../{resty.sha224.lua => resty/sha224.lua} | 0 .../{resty.sha256.lua => resty/sha256.lua} | 0 .../{resty.sha384.lua => resty/sha384.lua} | 0 .../{resty.sha512.lua => resty/sha512.lua} | 0 .../{resty.shell.lua => resty/shell.lua} | 0 .../{resty.signal.lua => resty/signal.lua} | 0 .../{resty.string.lua => resty/string.lua} | 0 .../{resty.upload.lua => resty/upload.lua} | 0 .../upstream/healthcheck.lua} | 0 .../websocket/client.lua} | 0 .../websocket/protocol.lua} | 0 .../websocket/server.lua} | 0 .../{string.buffer.lua => string/buffer.lua} | 0 .../{table.clone.lua => table/clone.lua} | 0 .../{table.isarray.lua => table/isarray.lua} | 0 .../{table.isempty.lua => table/isempty.lua} | 0 .../{table.nkeys.lua => table/nkeys.lua} | 0 .../{thread.exdata.lua => thread/exdata.lua} | 0 .../{thread.exdata2.lua => thread/exdata2.lua} | 0 script/fs-utility.lua | 2 ++ script/meta/bee/filesystem.lua | 9 +++++++++ tools/build-3rd-meta.lua | 1 + tools/normalize-3rd-path.lua | 17 +++++++++++++++++ 525 files changed, 30 insertions(+) rename meta/3rd/Cocos4.0/library/{cc.Action.lua => cc/Action.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ActionCamera.lua => cc/ActionCamera.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ActionEase.lua => cc/ActionEase.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ActionFloat.lua => cc/ActionFloat.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ActionInstant.lua => cc/ActionInstant.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ActionInterval.lua => cc/ActionInterval.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ActionManager.lua => cc/ActionManager.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ActionTween.lua => cc/ActionTween.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AmbientLight.lua => cc/AmbientLight.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Animate.lua => cc/Animate.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Animate3D.lua => cc/Animate3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Animation.lua => cc/Animation.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Animation3D.lua => cc/Animation3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AnimationCache.lua => cc/AnimationCache.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AnimationFrame.lua => cc/AnimationFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Application.lua => cc/Application.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AssetsManager.lua => cc/AssetsManager.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AssetsManagerEx.lua => cc/AssetsManagerEx.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AsyncTaskPool.lua => cc/AsyncTaskPool.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AtlasNode.lua => cc/AtlasNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AttachNode.lua => cc/AttachNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AudioEngine.lua => cc/AudioEngine.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AudioProfile.lua => cc/AudioProfile.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.AutoPolygon.lua => cc/AutoPolygon.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.BaseLight.lua => cc/BaseLight.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.BezierBy.lua => cc/BezierBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.BezierTo.lua => cc/BezierTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.BillBoard.lua => cc/BillBoard.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Blink.lua => cc/Blink.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Bundle3D.lua => cc/Bundle3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CSLoader.lua => cc/CSLoader.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CallFunc.lua => cc/CallFunc.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Camera.lua => cc/Camera.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CameraBackgroundBrush.lua => cc/CameraBackgroundBrush.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CameraBackgroundColorBrush.lua => cc/CameraBackgroundColorBrush.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CameraBackgroundDepthBrush.lua => cc/CameraBackgroundDepthBrush.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CameraBackgroundSkyBoxBrush.lua => cc/CameraBackgroundSkyBoxBrush.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CardinalSplineBy.lua => cc/CardinalSplineBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CardinalSplineTo.lua => cc/CardinalSplineTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CatmullRomBy.lua => cc/CatmullRomBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.CatmullRomTo.lua => cc/CatmullRomTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ClippingNode.lua => cc/ClippingNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ClippingRectangleNode.lua => cc/ClippingRectangleNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Component.lua => cc/Component.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ComponentLua.lua => cc/ComponentLua.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Console.lua => cc/Console.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Control.lua => cc/Control.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlButton.lua => cc/ControlButton.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlColourPicker.lua => cc/ControlColourPicker.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlHuePicker.lua => cc/ControlHuePicker.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlPotentiometer.lua => cc/ControlPotentiometer.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlSaturationBrightnessPicker.lua => cc/ControlSaturationBrightnessPicker.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlSlider.lua => cc/ControlSlider.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlStepper.lua => cc/ControlStepper.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ControlSwitch.lua => cc/ControlSwitch.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Controller.lua => cc/Controller.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.DelayTime.lua => cc/DelayTime.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Device.lua => cc/Device.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.DirectionLight.lua => cc/DirectionLight.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Director.lua => cc/Director.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.DrawNode.lua => cc/DrawNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBackIn.lua => cc/EaseBackIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBackInOut.lua => cc/EaseBackInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBackOut.lua => cc/EaseBackOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBezierAction.lua => cc/EaseBezierAction.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBounce.lua => cc/EaseBounce.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBounceIn.lua => cc/EaseBounceIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBounceInOut.lua => cc/EaseBounceInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseBounceOut.lua => cc/EaseBounceOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseCircleActionIn.lua => cc/EaseCircleActionIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseCircleActionInOut.lua => cc/EaseCircleActionInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseCircleActionOut.lua => cc/EaseCircleActionOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseCubicActionIn.lua => cc/EaseCubicActionIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseCubicActionInOut.lua => cc/EaseCubicActionInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseCubicActionOut.lua => cc/EaseCubicActionOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseElastic.lua => cc/EaseElastic.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseElasticIn.lua => cc/EaseElasticIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseElasticInOut.lua => cc/EaseElasticInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseElasticOut.lua => cc/EaseElasticOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseExponentialIn.lua => cc/EaseExponentialIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseExponentialInOut.lua => cc/EaseExponentialInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseExponentialOut.lua => cc/EaseExponentialOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseIn.lua => cc/EaseIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseInOut.lua => cc/EaseInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseOut.lua => cc/EaseOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuadraticActionIn.lua => cc/EaseQuadraticActionIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuadraticActionInOut.lua => cc/EaseQuadraticActionInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuadraticActionOut.lua => cc/EaseQuadraticActionOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuarticActionIn.lua => cc/EaseQuarticActionIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuarticActionInOut.lua => cc/EaseQuarticActionInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuarticActionOut.lua => cc/EaseQuarticActionOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuinticActionIn.lua => cc/EaseQuinticActionIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuinticActionInOut.lua => cc/EaseQuinticActionInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseQuinticActionOut.lua => cc/EaseQuinticActionOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseRateAction.lua => cc/EaseRateAction.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseSineIn.lua => cc/EaseSineIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseSineInOut.lua => cc/EaseSineInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EaseSineOut.lua => cc/EaseSineOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Event.lua => cc/Event.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventAcceleration.lua => cc/EventAcceleration.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventAssetsManagerEx.lua => cc/EventAssetsManagerEx.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventController.lua => cc/EventController.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventCustom.lua => cc/EventCustom.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventDispatcher.lua => cc/EventDispatcher.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventFocus.lua => cc/EventFocus.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventKeyboard.lua => cc/EventKeyboard.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListener.lua => cc/EventListener.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerAcceleration.lua => cc/EventListenerAcceleration.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerAssetsManagerEx.lua => cc/EventListenerAssetsManagerEx.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerController.lua => cc/EventListenerController.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerCustom.lua => cc/EventListenerCustom.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerFocus.lua => cc/EventListenerFocus.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerKeyboard.lua => cc/EventListenerKeyboard.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerMouse.lua => cc/EventListenerMouse.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerPhysicsContact.lua => cc/EventListenerPhysicsContact.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerPhysicsContactWithBodies.lua => cc/EventListenerPhysicsContactWithBodies.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerPhysicsContactWithGroup.lua => cc/EventListenerPhysicsContactWithGroup.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerPhysicsContactWithShapes.lua => cc/EventListenerPhysicsContactWithShapes.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerTouchAllAtOnce.lua => cc/EventListenerTouchAllAtOnce.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventListenerTouchOneByOne.lua => cc/EventListenerTouchOneByOne.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventMouse.lua => cc/EventMouse.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.EventTouch.lua => cc/EventTouch.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FadeIn.lua => cc/FadeIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FadeOut.lua => cc/FadeOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FadeOutBLTiles.lua => cc/FadeOutBLTiles.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FadeOutDownTiles.lua => cc/FadeOutDownTiles.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FadeOutTRTiles.lua => cc/FadeOutTRTiles.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FadeOutUpTiles.lua => cc/FadeOutUpTiles.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FadeTo.lua => cc/FadeTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FastTMXLayer.lua => cc/FastTMXLayer.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FastTMXTiledMap.lua => cc/FastTMXTiledMap.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FileUtils.lua => cc/FileUtils.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FiniteTimeAction.lua => cc/FiniteTimeAction.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FlipX.lua => cc/FlipX.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FlipX3D.lua => cc/FlipX3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FlipY.lua => cc/FlipY.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.FlipY3D.lua => cc/FlipY3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Follow.lua => cc/Follow.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.GLView.lua => cc/GLView.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.GLViewImpl.lua => cc/GLViewImpl.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Grid3D.lua => cc/Grid3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Grid3DAction.lua => cc/Grid3DAction.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.GridAction.lua => cc/GridAction.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.GridBase.lua => cc/GridBase.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Hide.lua => cc/Hide.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Image.lua => cc/Image.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.JumpBy.lua => cc/JumpBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.JumpTiles3D.lua => cc/JumpTiles3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.JumpTo.lua => cc/JumpTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Label.lua => cc/Label.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.LabelAtlas.lua => cc/LabelAtlas.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Layer.lua => cc/Layer.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.LayerColor.lua => cc/LayerColor.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.LayerGradient.lua => cc/LayerGradient.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.LayerMultiplex.lua => cc/LayerMultiplex.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.LayerRadialGradient.lua => cc/LayerRadialGradient.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Lens3D.lua => cc/Lens3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Liquid.lua => cc/Liquid.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Manifest.lua => cc/Manifest.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Material.lua => cc/Material.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Menu.lua => cc/Menu.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MenuItem.lua => cc/MenuItem.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MenuItemAtlasFont.lua => cc/MenuItemAtlasFont.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MenuItemFont.lua => cc/MenuItemFont.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MenuItemImage.lua => cc/MenuItemImage.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MenuItemLabel.lua => cc/MenuItemLabel.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MenuItemSprite.lua => cc/MenuItemSprite.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MenuItemToggle.lua => cc/MenuItemToggle.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Mesh.lua => cc/Mesh.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MotionStreak.lua => cc/MotionStreak.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MotionStreak3D.lua => cc/MotionStreak3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MoveBy.lua => cc/MoveBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.MoveTo.lua => cc/MoveTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.NavMesh.lua => cc/NavMesh.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.NavMeshAgent.lua => cc/NavMeshAgent.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.NavMeshObstacle.lua => cc/NavMeshObstacle.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Node.lua => cc/Node.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.NodeGrid.lua => cc/NodeGrid.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.OrbitCamera.lua => cc/OrbitCamera.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PUParticleSystem3D.lua => cc/PUParticleSystem3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PageTurn3D.lua => cc/PageTurn3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParallaxNode.lua => cc/ParallaxNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleBatchNode.lua => cc/ParticleBatchNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleData.lua => cc/ParticleData.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleExplosion.lua => cc/ParticleExplosion.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleFire.lua => cc/ParticleFire.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleFireworks.lua => cc/ParticleFireworks.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleFlower.lua => cc/ParticleFlower.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleGalaxy.lua => cc/ParticleGalaxy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleMeteor.lua => cc/ParticleMeteor.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleRain.lua => cc/ParticleRain.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleSmoke.lua => cc/ParticleSmoke.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleSnow.lua => cc/ParticleSnow.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleSpiral.lua => cc/ParticleSpiral.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleSun.lua => cc/ParticleSun.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleSystem.lua => cc/ParticleSystem.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleSystem3D.lua => cc/ParticleSystem3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ParticleSystemQuad.lua => cc/ParticleSystemQuad.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Pass.lua => cc/Pass.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3D6DofConstraint.lua => cc/Physics3D6DofConstraint.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DComponent.lua => cc/Physics3DComponent.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DConeTwistConstraint.lua => cc/Physics3DConeTwistConstraint.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DConstraint.lua => cc/Physics3DConstraint.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DHingeConstraint.lua => cc/Physics3DHingeConstraint.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DObject.lua => cc/Physics3DObject.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DPointToPointConstraint.lua => cc/Physics3DPointToPointConstraint.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DRigidBody.lua => cc/Physics3DRigidBody.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DShape.lua => cc/Physics3DShape.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DSliderConstraint.lua => cc/Physics3DSliderConstraint.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Physics3DWorld.lua => cc/Physics3DWorld.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsBody.lua => cc/PhysicsBody.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsContact.lua => cc/PhysicsContact.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsContactPostSolve.lua => cc/PhysicsContactPostSolve.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsContactPreSolve.lua => cc/PhysicsContactPreSolve.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJoint.lua => cc/PhysicsJoint.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointDistance.lua => cc/PhysicsJointDistance.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointFixed.lua => cc/PhysicsJointFixed.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointGear.lua => cc/PhysicsJointGear.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointGroove.lua => cc/PhysicsJointGroove.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointLimit.lua => cc/PhysicsJointLimit.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointMotor.lua => cc/PhysicsJointMotor.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointPin.lua => cc/PhysicsJointPin.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointRatchet.lua => cc/PhysicsJointRatchet.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointRotaryLimit.lua => cc/PhysicsJointRotaryLimit.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointRotarySpring.lua => cc/PhysicsJointRotarySpring.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsJointSpring.lua => cc/PhysicsJointSpring.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShape.lua => cc/PhysicsShape.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShapeBox.lua => cc/PhysicsShapeBox.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShapeCircle.lua => cc/PhysicsShapeCircle.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShapeEdgeBox.lua => cc/PhysicsShapeEdgeBox.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShapeEdgeChain.lua => cc/PhysicsShapeEdgeChain.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShapeEdgePolygon.lua => cc/PhysicsShapeEdgePolygon.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShapeEdgeSegment.lua => cc/PhysicsShapeEdgeSegment.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsShapePolygon.lua => cc/PhysicsShapePolygon.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsSprite3D.lua => cc/PhysicsSprite3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PhysicsWorld.lua => cc/PhysicsWorld.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Place.lua => cc/Place.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PointLight.lua => cc/PointLight.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.PolygonInfo.lua => cc/PolygonInfo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ProgressFromTo.lua => cc/ProgressFromTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ProgressTimer.lua => cc/ProgressTimer.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ProgressTo.lua => cc/ProgressTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Properties.lua => cc/Properties.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ProtectedNode.lua => cc/ProtectedNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Ref.lua => cc/Ref.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.RemoveSelf.lua => cc/RemoveSelf.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.RenderState.lua => cc/RenderState.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.RenderTexture.lua => cc/RenderTexture.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Renderer.lua => cc/Renderer.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Repeat.lua => cc/Repeat.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.RepeatForever.lua => cc/RepeatForever.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ReuseGrid.lua => cc/ReuseGrid.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Ripple3D.lua => cc/Ripple3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.RotateBy.lua => cc/RotateBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.RotateTo.lua => cc/RotateTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ScaleBy.lua => cc/ScaleBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ScaleTo.lua => cc/ScaleTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Scene.lua => cc/Scene.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Scheduler.lua => cc/Scheduler.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Sequence.lua => cc/Sequence.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ShaderCache.lua => cc/ShaderCache.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Shaky3D.lua => cc/Shaky3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ShakyTiles3D.lua => cc/ShakyTiles3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ShatteredTiles3D.lua => cc/ShatteredTiles3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Show.lua => cc/Show.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ShuffleTiles.lua => cc/ShuffleTiles.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Skeleton3D.lua => cc/Skeleton3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SkewBy.lua => cc/SkewBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SkewTo.lua => cc/SkewTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Skybox.lua => cc/Skybox.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Spawn.lua => cc/Spawn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Speed.lua => cc/Speed.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SplitCols.lua => cc/SplitCols.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SplitRows.lua => cc/SplitRows.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SpotLight.lua => cc/SpotLight.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Sprite.lua => cc/Sprite.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Sprite3D.lua => cc/Sprite3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Sprite3DCache.lua => cc/Sprite3DCache.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Sprite3DMaterial.lua => cc/Sprite3DMaterial.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SpriteBatchNode.lua => cc/SpriteBatchNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SpriteFrame.lua => cc/SpriteFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.SpriteFrameCache.lua => cc/SpriteFrameCache.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.StopGrid.lua => cc/StopGrid.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TMXLayer.lua => cc/TMXLayer.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TMXLayerInfo.lua => cc/TMXLayerInfo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TMXMapInfo.lua => cc/TMXMapInfo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TMXObjectGroup.lua => cc/TMXObjectGroup.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TMXTiledMap.lua => cc/TMXTiledMap.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TMXTilesetInfo.lua => cc/TMXTilesetInfo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TableView.lua => cc/TableView.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TableViewCell.lua => cc/TableViewCell.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TargetedAction.lua => cc/TargetedAction.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Technique.lua => cc/Technique.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Terrain.lua => cc/Terrain.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Texture2D.lua => cc/Texture2D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TextureCache.lua => cc/TextureCache.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TextureCube.lua => cc/TextureCube.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TileMapAtlas.lua => cc/TileMapAtlas.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TiledGrid3D.lua => cc/TiledGrid3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TiledGrid3DAction.lua => cc/TiledGrid3DAction.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Timer.lua => cc/Timer.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TintBy.lua => cc/TintBy.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TintTo.lua => cc/TintTo.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.ToggleVisibility.lua => cc/ToggleVisibility.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Touch.lua => cc/Touch.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionCrossFade.lua => cc/TransitionCrossFade.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionEaseScene.lua => cc/TransitionEaseScene.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFade.lua => cc/TransitionFade.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFadeBL.lua => cc/TransitionFadeBL.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFadeDown.lua => cc/TransitionFadeDown.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFadeTR.lua => cc/TransitionFadeTR.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFadeUp.lua => cc/TransitionFadeUp.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFlipAngular.lua => cc/TransitionFlipAngular.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFlipX.lua => cc/TransitionFlipX.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionFlipY.lua => cc/TransitionFlipY.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionJumpZoom.lua => cc/TransitionJumpZoom.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionMoveInB.lua => cc/TransitionMoveInB.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionMoveInL.lua => cc/TransitionMoveInL.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionMoveInR.lua => cc/TransitionMoveInR.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionMoveInT.lua => cc/TransitionMoveInT.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionPageTurn.lua => cc/TransitionPageTurn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionProgress.lua => cc/TransitionProgress.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionProgressHorizontal.lua => cc/TransitionProgressHorizontal.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionProgressInOut.lua => cc/TransitionProgressInOut.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionProgressOutIn.lua => cc/TransitionProgressOutIn.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionProgressRadialCCW.lua => cc/TransitionProgressRadialCCW.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionProgressRadialCW.lua => cc/TransitionProgressRadialCW.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionProgressVertical.lua => cc/TransitionProgressVertical.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionRotoZoom.lua => cc/TransitionRotoZoom.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionScene.lua => cc/TransitionScene.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionSceneOriented.lua => cc/TransitionSceneOriented.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionShrinkGrow.lua => cc/TransitionShrinkGrow.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionSlideInB.lua => cc/TransitionSlideInB.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionSlideInL.lua => cc/TransitionSlideInL.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionSlideInR.lua => cc/TransitionSlideInR.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionSlideInT.lua => cc/TransitionSlideInT.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionSplitCols.lua => cc/TransitionSplitCols.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionSplitRows.lua => cc/TransitionSplitRows.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionTurnOffTiles.lua => cc/TransitionTurnOffTiles.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionZoomFlipAngular.lua => cc/TransitionZoomFlipAngular.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionZoomFlipX.lua => cc/TransitionZoomFlipX.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TransitionZoomFlipY.lua => cc/TransitionZoomFlipY.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.TurnOffTiles.lua => cc/TurnOffTiles.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Twirl.lua => cc/Twirl.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.UserDefault.lua => cc/UserDefault.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Waves.lua => cc/Waves.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.Waves3D.lua => cc/Waves3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{cc.WavesTiles3D.lua => cc/WavesTiles3D.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccb.Program.lua => ccb/Program.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccb.ProgramState.lua => ccb/ProgramState.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccb.Texture2DBackend.lua => ccb/Texture2DBackend.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccb.TextureBackend.lua => ccb/TextureBackend.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccb.TextureCubemapBackend.lua => ccb/TextureCubemapBackend.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccb.VertexLayout.lua => ccb/VertexLayout.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionFadeFrame.lua => ccs/ActionFadeFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionFrame.lua => ccs/ActionFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionManagerEx.lua => ccs/ActionManagerEx.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionMoveFrame.lua => ccs/ActionMoveFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionObject.lua => ccs/ActionObject.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionRotationFrame.lua => ccs/ActionRotationFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionScaleFrame.lua => ccs/ActionScaleFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionTimeline.lua => ccs/ActionTimeline.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionTimelineCache.lua => ccs/ActionTimelineCache.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionTimelineData.lua => ccs/ActionTimelineData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionTimelineNode.lua => ccs/ActionTimelineNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ActionTintFrame.lua => ccs/ActionTintFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.AlphaFrame.lua => ccs/AlphaFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.AnchorPointFrame.lua => ccs/AnchorPointFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.AnimationData.lua => ccs/AnimationData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.Armature.lua => ccs/Armature.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ArmatureAnimation.lua => ccs/ArmatureAnimation.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ArmatureData.lua => ccs/ArmatureData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ArmatureDataManager.lua => ccs/ArmatureDataManager.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ArmatureDisplayData.lua => ccs/ArmatureDisplayData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.BaseData.lua => ccs/BaseData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.BatchNode.lua => ccs/BatchNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.BlendFuncFrame.lua => ccs/BlendFuncFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.Bone.lua => ccs/Bone.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.BoneData.lua => ccs/BoneData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.BoneNode.lua => ccs/BoneNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ColorFrame.lua => ccs/ColorFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ComAttribute.lua => ccs/ComAttribute.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ComAudio.lua => ccs/ComAudio.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ComController.lua => ccs/ComController.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ComExtensionData.lua => ccs/ComExtensionData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ComRender.lua => ccs/ComRender.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ContourData.lua => ccs/ContourData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.DisplayData.lua => ccs/DisplayData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.DisplayManager.lua => ccs/DisplayManager.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.EventFrame.lua => ccs/EventFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.Frame.lua => ccs/Frame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.FrameData.lua => ccs/FrameData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.GUIReader.lua => ccs/GUIReader.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.InnerActionFrame.lua => ccs/InnerActionFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.MovementBoneData.lua => ccs/MovementBoneData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.MovementData.lua => ccs/MovementData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ParticleDisplayData.lua => ccs/ParticleDisplayData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.PlayableFrame.lua => ccs/PlayableFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.PositionFrame.lua => ccs/PositionFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.RotationFrame.lua => ccs/RotationFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.RotationSkewFrame.lua => ccs/RotationSkewFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ScaleFrame.lua => ccs/ScaleFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.SceneReader.lua => ccs/SceneReader.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.SkeletonNode.lua => ccs/SkeletonNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.SkewFrame.lua => ccs/SkewFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.Skin.lua => ccs/Skin.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.SpriteDisplayData.lua => ccs/SpriteDisplayData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.TextureData.lua => ccs/TextureData.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.TextureFrame.lua => ccs/TextureFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.Timeline.lua => ccs/Timeline.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.Tween.lua => ccs/Tween.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.VisibleFrame.lua => ccs/VisibleFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccs.ZOrderFrame.lua => ccs/ZOrderFrame.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.AbstractCheckButton.lua => ccui/AbstractCheckButton.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.Button.lua => ccui/Button.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.CheckBox.lua => ccui/CheckBox.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.EditBox.lua => ccui/EditBox.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.HBox.lua => ccui/HBox.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.Helper.lua => ccui/Helper.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.ImageView.lua => ccui/ImageView.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.Layout.lua => ccui/Layout.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.LayoutComponent.lua => ccui/LayoutComponent.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.LayoutParameter.lua => ccui/LayoutParameter.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.LinearLayoutParameter.lua => ccui/LinearLayoutParameter.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.ListView.lua => ccui/ListView.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.LoadingBar.lua => ccui/LoadingBar.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.PageView.lua => ccui/PageView.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RadioButton.lua => ccui/RadioButton.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RadioButtonGroup.lua => ccui/RadioButtonGroup.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RelativeBox.lua => ccui/RelativeBox.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RelativeLayoutParameter.lua => ccui/RelativeLayoutParameter.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RichElement.lua => ccui/RichElement.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RichElementCustomNode.lua => ccui/RichElementCustomNode.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RichElementImage.lua => ccui/RichElementImage.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RichElementNewLine.lua => ccui/RichElementNewLine.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RichElementText.lua => ccui/RichElementText.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.RichText.lua => ccui/RichText.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.Scale9Sprite.lua => ccui/Scale9Sprite.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.ScrollView.lua => ccui/ScrollView.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.Slider.lua => ccui/Slider.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.TabControl.lua => ccui/TabControl.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.TabHeader.lua => ccui/TabHeader.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.Text.lua => ccui/Text.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.TextAtlas.lua => ccui/TextAtlas.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.TextBMFont.lua => ccui/TextBMFont.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.TextField.lua => ccui/TextField.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.VBox.lua => ccui/VBox.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.VideoPlayer.lua => ccui/VideoPlayer.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.WebView.lua => ccui/WebView.lua} (100%) rename meta/3rd/Cocos4.0/library/{ccui.Widget.lua => ccui/Widget.lua} (100%) rename meta/3rd/Cocos4.0/library/{sp.SkeletonAnimation.lua => sp/SkeletonAnimation.lua} (100%) rename meta/3rd/Cocos4.0/library/{sp.SkeletonRenderer.lua => sp/SkeletonRenderer.lua} (100%) rename meta/3rd/OpenResty/library/{cjson.safe.lua => cjson/safe.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.balancer.lua => ngx/balancer.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.base64.lua => ngx/base64.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.errlog.lua => ngx/errlog.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.ocsp.lua => ngx/ocsp.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.pipe.lua => ngx/pipe.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.process.lua => ngx/process.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.re.lua => ngx/re.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.req.lua => ngx/req.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.resp.lua => ngx/resp.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.semaphore.lua => ngx/semaphore.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.ssl.lua => ngx/ssl.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.ssl.clienthello.lua => ngx/ssl/clienthello.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.ssl.session.lua => ngx/ssl/session.lua} (100%) rename meta/3rd/OpenResty/library/{ngx.upstream.lua => ngx/upstream.lua} (100%) rename meta/3rd/OpenResty/library/{resty.aes.lua => resty/aes.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.lua => resty/core.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.base.lua => resty/core/base.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.base64.lua => resty/core/base64.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.ctx.lua => resty/core/ctx.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.exit.lua => resty/core/exit.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.hash.lua => resty/core/hash.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.misc.lua => resty/core/misc.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.ndk.lua => resty/core/ndk.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.phase.lua => resty/core/phase.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.regex.lua => resty/core/regex.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.request.lua => resty/core/request.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.response.lua => resty/core/response.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.shdict.lua => resty/core/shdict.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.time.lua => resty/core/time.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.uri.lua => resty/core/uri.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.utils.lua => resty/core/utils.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.var.lua => resty/core/var.lua} (100%) rename meta/3rd/OpenResty/library/{resty.core.worker.lua => resty/core/worker.lua} (100%) rename meta/3rd/OpenResty/library/{resty.dns.resolver.lua => resty/dns/resolver.lua} (100%) rename meta/3rd/OpenResty/library/{resty.limit.conn.lua => resty/limit/conn.lua} (100%) rename meta/3rd/OpenResty/library/{resty.limit.count.lua => resty/limit/count.lua} (100%) rename meta/3rd/OpenResty/library/{resty.limit.req.lua => resty/limit/req.lua} (100%) rename meta/3rd/OpenResty/library/{resty.limit.traffic.lua => resty/limit/traffic.lua} (100%) rename meta/3rd/OpenResty/library/{resty.lock.lua => resty/lock.lua} (100%) rename meta/3rd/OpenResty/library/{resty.lrucache.lua => resty/lrucache.lua} (100%) rename meta/3rd/OpenResty/library/{resty.lrucache.pureffi.lua => resty/lrucache/pureffi.lua} (100%) rename meta/3rd/OpenResty/library/{resty.md5.lua => resty/md5.lua} (100%) rename meta/3rd/OpenResty/library/{resty.memcached.lua => resty/memcached.lua} (100%) rename meta/3rd/OpenResty/library/{resty.mysql.lua => resty/mysql.lua} (100%) rename meta/3rd/OpenResty/library/{resty.random.lua => resty/random.lua} (100%) rename meta/3rd/OpenResty/library/{resty.redis.lua => resty/redis.lua} (100%) rename meta/3rd/OpenResty/library/{resty.sha.lua => resty/sha.lua} (100%) rename meta/3rd/OpenResty/library/{resty.sha1.lua => resty/sha1.lua} (100%) rename meta/3rd/OpenResty/library/{resty.sha224.lua => resty/sha224.lua} (100%) rename meta/3rd/OpenResty/library/{resty.sha256.lua => resty/sha256.lua} (100%) rename meta/3rd/OpenResty/library/{resty.sha384.lua => resty/sha384.lua} (100%) rename meta/3rd/OpenResty/library/{resty.sha512.lua => resty/sha512.lua} (100%) rename meta/3rd/OpenResty/library/{resty.shell.lua => resty/shell.lua} (100%) rename meta/3rd/OpenResty/library/{resty.signal.lua => resty/signal.lua} (100%) rename meta/3rd/OpenResty/library/{resty.string.lua => resty/string.lua} (100%) rename meta/3rd/OpenResty/library/{resty.upload.lua => resty/upload.lua} (100%) rename meta/3rd/OpenResty/library/{resty.upstream.healthcheck.lua => resty/upstream/healthcheck.lua} (100%) rename meta/3rd/OpenResty/library/{resty.websocket.client.lua => resty/websocket/client.lua} (100%) rename meta/3rd/OpenResty/library/{resty.websocket.protocol.lua => resty/websocket/protocol.lua} (100%) rename meta/3rd/OpenResty/library/{resty.websocket.server.lua => resty/websocket/server.lua} (100%) rename meta/3rd/OpenResty/library/{string.buffer.lua => string/buffer.lua} (100%) rename meta/3rd/OpenResty/library/{table.clone.lua => table/clone.lua} (100%) rename meta/3rd/OpenResty/library/{table.isarray.lua => table/isarray.lua} (100%) rename meta/3rd/OpenResty/library/{table.isempty.lua => table/isempty.lua} (100%) rename meta/3rd/OpenResty/library/{table.nkeys.lua => table/nkeys.lua} (100%) rename meta/3rd/OpenResty/library/{thread.exdata.lua => thread/exdata.lua} (100%) rename meta/3rd/OpenResty/library/{thread.exdata2.lua => thread/exdata2.lua} (100%) create mode 100644 tools/normalize-3rd-path.lua diff --git a/changelog.md b/changelog.md index 4f4ab7f6d..13153b60d 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ * `FIX` [#1425](https://github.com/sumneko/lua-language-server/issues/1425) * `FIX` [#1428](https://github.com/sumneko/lua-language-server/issues/1428) * `FIX` [#1430](https://github.com/sumneko/lua-language-server/issues/1430) +* `FIX` [#1431](https://github.com/sumneko/lua-language-server/issues/1431) ## 3.5.2 `2022-8-1` diff --git a/meta/3rd/Cocos4.0/library/cc.Action.lua b/meta/3rd/Cocos4.0/library/cc/Action.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Action.lua rename to meta/3rd/Cocos4.0/library/cc/Action.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ActionCamera.lua b/meta/3rd/Cocos4.0/library/cc/ActionCamera.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ActionCamera.lua rename to meta/3rd/Cocos4.0/library/cc/ActionCamera.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ActionEase.lua b/meta/3rd/Cocos4.0/library/cc/ActionEase.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ActionEase.lua rename to meta/3rd/Cocos4.0/library/cc/ActionEase.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ActionFloat.lua b/meta/3rd/Cocos4.0/library/cc/ActionFloat.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ActionFloat.lua rename to meta/3rd/Cocos4.0/library/cc/ActionFloat.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ActionInstant.lua b/meta/3rd/Cocos4.0/library/cc/ActionInstant.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ActionInstant.lua rename to meta/3rd/Cocos4.0/library/cc/ActionInstant.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ActionInterval.lua b/meta/3rd/Cocos4.0/library/cc/ActionInterval.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ActionInterval.lua rename to meta/3rd/Cocos4.0/library/cc/ActionInterval.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ActionManager.lua b/meta/3rd/Cocos4.0/library/cc/ActionManager.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ActionManager.lua rename to meta/3rd/Cocos4.0/library/cc/ActionManager.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ActionTween.lua b/meta/3rd/Cocos4.0/library/cc/ActionTween.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ActionTween.lua rename to meta/3rd/Cocos4.0/library/cc/ActionTween.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AmbientLight.lua b/meta/3rd/Cocos4.0/library/cc/AmbientLight.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AmbientLight.lua rename to meta/3rd/Cocos4.0/library/cc/AmbientLight.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Animate.lua b/meta/3rd/Cocos4.0/library/cc/Animate.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Animate.lua rename to meta/3rd/Cocos4.0/library/cc/Animate.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Animate3D.lua b/meta/3rd/Cocos4.0/library/cc/Animate3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Animate3D.lua rename to meta/3rd/Cocos4.0/library/cc/Animate3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Animation.lua b/meta/3rd/Cocos4.0/library/cc/Animation.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Animation.lua rename to meta/3rd/Cocos4.0/library/cc/Animation.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Animation3D.lua b/meta/3rd/Cocos4.0/library/cc/Animation3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Animation3D.lua rename to meta/3rd/Cocos4.0/library/cc/Animation3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AnimationCache.lua b/meta/3rd/Cocos4.0/library/cc/AnimationCache.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AnimationCache.lua rename to meta/3rd/Cocos4.0/library/cc/AnimationCache.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AnimationFrame.lua b/meta/3rd/Cocos4.0/library/cc/AnimationFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AnimationFrame.lua rename to meta/3rd/Cocos4.0/library/cc/AnimationFrame.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Application.lua b/meta/3rd/Cocos4.0/library/cc/Application.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Application.lua rename to meta/3rd/Cocos4.0/library/cc/Application.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AssetsManager.lua b/meta/3rd/Cocos4.0/library/cc/AssetsManager.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AssetsManager.lua rename to meta/3rd/Cocos4.0/library/cc/AssetsManager.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AssetsManagerEx.lua b/meta/3rd/Cocos4.0/library/cc/AssetsManagerEx.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AssetsManagerEx.lua rename to meta/3rd/Cocos4.0/library/cc/AssetsManagerEx.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AsyncTaskPool.lua b/meta/3rd/Cocos4.0/library/cc/AsyncTaskPool.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AsyncTaskPool.lua rename to meta/3rd/Cocos4.0/library/cc/AsyncTaskPool.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AtlasNode.lua b/meta/3rd/Cocos4.0/library/cc/AtlasNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AtlasNode.lua rename to meta/3rd/Cocos4.0/library/cc/AtlasNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AttachNode.lua b/meta/3rd/Cocos4.0/library/cc/AttachNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AttachNode.lua rename to meta/3rd/Cocos4.0/library/cc/AttachNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AudioEngine.lua b/meta/3rd/Cocos4.0/library/cc/AudioEngine.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AudioEngine.lua rename to meta/3rd/Cocos4.0/library/cc/AudioEngine.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AudioProfile.lua b/meta/3rd/Cocos4.0/library/cc/AudioProfile.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AudioProfile.lua rename to meta/3rd/Cocos4.0/library/cc/AudioProfile.lua diff --git a/meta/3rd/Cocos4.0/library/cc.AutoPolygon.lua b/meta/3rd/Cocos4.0/library/cc/AutoPolygon.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.AutoPolygon.lua rename to meta/3rd/Cocos4.0/library/cc/AutoPolygon.lua diff --git a/meta/3rd/Cocos4.0/library/cc.BaseLight.lua b/meta/3rd/Cocos4.0/library/cc/BaseLight.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.BaseLight.lua rename to meta/3rd/Cocos4.0/library/cc/BaseLight.lua diff --git a/meta/3rd/Cocos4.0/library/cc.BezierBy.lua b/meta/3rd/Cocos4.0/library/cc/BezierBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.BezierBy.lua rename to meta/3rd/Cocos4.0/library/cc/BezierBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.BezierTo.lua b/meta/3rd/Cocos4.0/library/cc/BezierTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.BezierTo.lua rename to meta/3rd/Cocos4.0/library/cc/BezierTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.BillBoard.lua b/meta/3rd/Cocos4.0/library/cc/BillBoard.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.BillBoard.lua rename to meta/3rd/Cocos4.0/library/cc/BillBoard.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Blink.lua b/meta/3rd/Cocos4.0/library/cc/Blink.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Blink.lua rename to meta/3rd/Cocos4.0/library/cc/Blink.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Bundle3D.lua b/meta/3rd/Cocos4.0/library/cc/Bundle3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Bundle3D.lua rename to meta/3rd/Cocos4.0/library/cc/Bundle3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CSLoader.lua b/meta/3rd/Cocos4.0/library/cc/CSLoader.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CSLoader.lua rename to meta/3rd/Cocos4.0/library/cc/CSLoader.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CallFunc.lua b/meta/3rd/Cocos4.0/library/cc/CallFunc.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CallFunc.lua rename to meta/3rd/Cocos4.0/library/cc/CallFunc.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Camera.lua b/meta/3rd/Cocos4.0/library/cc/Camera.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Camera.lua rename to meta/3rd/Cocos4.0/library/cc/Camera.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CameraBackgroundBrush.lua b/meta/3rd/Cocos4.0/library/cc/CameraBackgroundBrush.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CameraBackgroundBrush.lua rename to meta/3rd/Cocos4.0/library/cc/CameraBackgroundBrush.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CameraBackgroundColorBrush.lua b/meta/3rd/Cocos4.0/library/cc/CameraBackgroundColorBrush.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CameraBackgroundColorBrush.lua rename to meta/3rd/Cocos4.0/library/cc/CameraBackgroundColorBrush.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CameraBackgroundDepthBrush.lua b/meta/3rd/Cocos4.0/library/cc/CameraBackgroundDepthBrush.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CameraBackgroundDepthBrush.lua rename to meta/3rd/Cocos4.0/library/cc/CameraBackgroundDepthBrush.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CameraBackgroundSkyBoxBrush.lua b/meta/3rd/Cocos4.0/library/cc/CameraBackgroundSkyBoxBrush.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CameraBackgroundSkyBoxBrush.lua rename to meta/3rd/Cocos4.0/library/cc/CameraBackgroundSkyBoxBrush.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CardinalSplineBy.lua b/meta/3rd/Cocos4.0/library/cc/CardinalSplineBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CardinalSplineBy.lua rename to meta/3rd/Cocos4.0/library/cc/CardinalSplineBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CardinalSplineTo.lua b/meta/3rd/Cocos4.0/library/cc/CardinalSplineTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CardinalSplineTo.lua rename to meta/3rd/Cocos4.0/library/cc/CardinalSplineTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CatmullRomBy.lua b/meta/3rd/Cocos4.0/library/cc/CatmullRomBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CatmullRomBy.lua rename to meta/3rd/Cocos4.0/library/cc/CatmullRomBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.CatmullRomTo.lua b/meta/3rd/Cocos4.0/library/cc/CatmullRomTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.CatmullRomTo.lua rename to meta/3rd/Cocos4.0/library/cc/CatmullRomTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ClippingNode.lua b/meta/3rd/Cocos4.0/library/cc/ClippingNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ClippingNode.lua rename to meta/3rd/Cocos4.0/library/cc/ClippingNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ClippingRectangleNode.lua b/meta/3rd/Cocos4.0/library/cc/ClippingRectangleNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ClippingRectangleNode.lua rename to meta/3rd/Cocos4.0/library/cc/ClippingRectangleNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Component.lua b/meta/3rd/Cocos4.0/library/cc/Component.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Component.lua rename to meta/3rd/Cocos4.0/library/cc/Component.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ComponentLua.lua b/meta/3rd/Cocos4.0/library/cc/ComponentLua.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ComponentLua.lua rename to meta/3rd/Cocos4.0/library/cc/ComponentLua.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Console.lua b/meta/3rd/Cocos4.0/library/cc/Console.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Console.lua rename to meta/3rd/Cocos4.0/library/cc/Console.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Control.lua b/meta/3rd/Cocos4.0/library/cc/Control.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Control.lua rename to meta/3rd/Cocos4.0/library/cc/Control.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlButton.lua b/meta/3rd/Cocos4.0/library/cc/ControlButton.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlButton.lua rename to meta/3rd/Cocos4.0/library/cc/ControlButton.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlColourPicker.lua b/meta/3rd/Cocos4.0/library/cc/ControlColourPicker.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlColourPicker.lua rename to meta/3rd/Cocos4.0/library/cc/ControlColourPicker.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlHuePicker.lua b/meta/3rd/Cocos4.0/library/cc/ControlHuePicker.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlHuePicker.lua rename to meta/3rd/Cocos4.0/library/cc/ControlHuePicker.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlPotentiometer.lua b/meta/3rd/Cocos4.0/library/cc/ControlPotentiometer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlPotentiometer.lua rename to meta/3rd/Cocos4.0/library/cc/ControlPotentiometer.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlSaturationBrightnessPicker.lua b/meta/3rd/Cocos4.0/library/cc/ControlSaturationBrightnessPicker.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlSaturationBrightnessPicker.lua rename to meta/3rd/Cocos4.0/library/cc/ControlSaturationBrightnessPicker.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlSlider.lua b/meta/3rd/Cocos4.0/library/cc/ControlSlider.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlSlider.lua rename to meta/3rd/Cocos4.0/library/cc/ControlSlider.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlStepper.lua b/meta/3rd/Cocos4.0/library/cc/ControlStepper.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlStepper.lua rename to meta/3rd/Cocos4.0/library/cc/ControlStepper.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ControlSwitch.lua b/meta/3rd/Cocos4.0/library/cc/ControlSwitch.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ControlSwitch.lua rename to meta/3rd/Cocos4.0/library/cc/ControlSwitch.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Controller.lua b/meta/3rd/Cocos4.0/library/cc/Controller.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Controller.lua rename to meta/3rd/Cocos4.0/library/cc/Controller.lua diff --git a/meta/3rd/Cocos4.0/library/cc.DelayTime.lua b/meta/3rd/Cocos4.0/library/cc/DelayTime.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.DelayTime.lua rename to meta/3rd/Cocos4.0/library/cc/DelayTime.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Device.lua b/meta/3rd/Cocos4.0/library/cc/Device.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Device.lua rename to meta/3rd/Cocos4.0/library/cc/Device.lua diff --git a/meta/3rd/Cocos4.0/library/cc.DirectionLight.lua b/meta/3rd/Cocos4.0/library/cc/DirectionLight.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.DirectionLight.lua rename to meta/3rd/Cocos4.0/library/cc/DirectionLight.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Director.lua b/meta/3rd/Cocos4.0/library/cc/Director.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Director.lua rename to meta/3rd/Cocos4.0/library/cc/Director.lua diff --git a/meta/3rd/Cocos4.0/library/cc.DrawNode.lua b/meta/3rd/Cocos4.0/library/cc/DrawNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.DrawNode.lua rename to meta/3rd/Cocos4.0/library/cc/DrawNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBackIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseBackIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBackIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBackIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBackInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseBackInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBackInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBackInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBackOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseBackOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBackOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBackOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBezierAction.lua b/meta/3rd/Cocos4.0/library/cc/EaseBezierAction.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBezierAction.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBezierAction.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBounce.lua b/meta/3rd/Cocos4.0/library/cc/EaseBounce.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBounce.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBounce.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBounceIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseBounceIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBounceIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBounceIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBounceInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseBounceInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBounceInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBounceInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseBounceOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseBounceOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseBounceOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseBounceOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseCircleActionIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseCircleActionIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseCircleActionIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseCircleActionIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseCircleActionInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseCircleActionInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseCircleActionInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseCircleActionInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseCircleActionOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseCircleActionOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseCircleActionOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseCircleActionOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseCubicActionIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseCubicActionIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseCubicActionIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseCubicActionIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseCubicActionInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseCubicActionInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseCubicActionInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseCubicActionInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseCubicActionOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseCubicActionOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseCubicActionOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseCubicActionOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseElastic.lua b/meta/3rd/Cocos4.0/library/cc/EaseElastic.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseElastic.lua rename to meta/3rd/Cocos4.0/library/cc/EaseElastic.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseElasticIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseElasticIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseElasticIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseElasticIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseElasticInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseElasticInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseElasticInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseElasticInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseElasticOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseElasticOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseElasticOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseElasticOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseExponentialIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseExponentialIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseExponentialIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseExponentialIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseExponentialInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseExponentialInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseExponentialInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseExponentialInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseExponentialOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseExponentialOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseExponentialOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseExponentialOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuadraticActionIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuadraticActionIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuadraticActionIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuadraticActionIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuadraticActionInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuadraticActionInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuadraticActionInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuadraticActionInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuadraticActionOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuadraticActionOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuadraticActionOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuadraticActionOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuarticActionIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuarticActionIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuarticActionIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuarticActionIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuarticActionInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuarticActionInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuarticActionInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuarticActionInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuarticActionOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuarticActionOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuarticActionOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuarticActionOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuinticActionIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuinticActionIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuinticActionIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuinticActionIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuinticActionInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuinticActionInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuinticActionInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuinticActionInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseQuinticActionOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseQuinticActionOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseQuinticActionOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseQuinticActionOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseRateAction.lua b/meta/3rd/Cocos4.0/library/cc/EaseRateAction.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseRateAction.lua rename to meta/3rd/Cocos4.0/library/cc/EaseRateAction.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseSineIn.lua b/meta/3rd/Cocos4.0/library/cc/EaseSineIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseSineIn.lua rename to meta/3rd/Cocos4.0/library/cc/EaseSineIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseSineInOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseSineInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseSineInOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseSineInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EaseSineOut.lua b/meta/3rd/Cocos4.0/library/cc/EaseSineOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EaseSineOut.lua rename to meta/3rd/Cocos4.0/library/cc/EaseSineOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Event.lua b/meta/3rd/Cocos4.0/library/cc/Event.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Event.lua rename to meta/3rd/Cocos4.0/library/cc/Event.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventAcceleration.lua b/meta/3rd/Cocos4.0/library/cc/EventAcceleration.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventAcceleration.lua rename to meta/3rd/Cocos4.0/library/cc/EventAcceleration.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventAssetsManagerEx.lua b/meta/3rd/Cocos4.0/library/cc/EventAssetsManagerEx.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventAssetsManagerEx.lua rename to meta/3rd/Cocos4.0/library/cc/EventAssetsManagerEx.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventController.lua b/meta/3rd/Cocos4.0/library/cc/EventController.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventController.lua rename to meta/3rd/Cocos4.0/library/cc/EventController.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventCustom.lua b/meta/3rd/Cocos4.0/library/cc/EventCustom.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventCustom.lua rename to meta/3rd/Cocos4.0/library/cc/EventCustom.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventDispatcher.lua b/meta/3rd/Cocos4.0/library/cc/EventDispatcher.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventDispatcher.lua rename to meta/3rd/Cocos4.0/library/cc/EventDispatcher.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventFocus.lua b/meta/3rd/Cocos4.0/library/cc/EventFocus.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventFocus.lua rename to meta/3rd/Cocos4.0/library/cc/EventFocus.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventKeyboard.lua b/meta/3rd/Cocos4.0/library/cc/EventKeyboard.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventKeyboard.lua rename to meta/3rd/Cocos4.0/library/cc/EventKeyboard.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListener.lua b/meta/3rd/Cocos4.0/library/cc/EventListener.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListener.lua rename to meta/3rd/Cocos4.0/library/cc/EventListener.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerAcceleration.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerAcceleration.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerAcceleration.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerAcceleration.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerAssetsManagerEx.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerAssetsManagerEx.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerAssetsManagerEx.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerAssetsManagerEx.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerController.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerController.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerController.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerController.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerCustom.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerCustom.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerCustom.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerCustom.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerFocus.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerFocus.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerFocus.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerFocus.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerKeyboard.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerKeyboard.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerKeyboard.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerKeyboard.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerMouse.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerMouse.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerMouse.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerMouse.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContact.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContact.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContact.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContact.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContactWithBodies.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContactWithBodies.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContactWithBodies.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContactWithBodies.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContactWithGroup.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContactWithGroup.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContactWithGroup.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContactWithGroup.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContactWithShapes.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContactWithShapes.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerPhysicsContactWithShapes.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerPhysicsContactWithShapes.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerTouchAllAtOnce.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerTouchAllAtOnce.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerTouchAllAtOnce.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerTouchAllAtOnce.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventListenerTouchOneByOne.lua b/meta/3rd/Cocos4.0/library/cc/EventListenerTouchOneByOne.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventListenerTouchOneByOne.lua rename to meta/3rd/Cocos4.0/library/cc/EventListenerTouchOneByOne.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventMouse.lua b/meta/3rd/Cocos4.0/library/cc/EventMouse.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventMouse.lua rename to meta/3rd/Cocos4.0/library/cc/EventMouse.lua diff --git a/meta/3rd/Cocos4.0/library/cc.EventTouch.lua b/meta/3rd/Cocos4.0/library/cc/EventTouch.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.EventTouch.lua rename to meta/3rd/Cocos4.0/library/cc/EventTouch.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FadeIn.lua b/meta/3rd/Cocos4.0/library/cc/FadeIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FadeIn.lua rename to meta/3rd/Cocos4.0/library/cc/FadeIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FadeOut.lua b/meta/3rd/Cocos4.0/library/cc/FadeOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FadeOut.lua rename to meta/3rd/Cocos4.0/library/cc/FadeOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FadeOutBLTiles.lua b/meta/3rd/Cocos4.0/library/cc/FadeOutBLTiles.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FadeOutBLTiles.lua rename to meta/3rd/Cocos4.0/library/cc/FadeOutBLTiles.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FadeOutDownTiles.lua b/meta/3rd/Cocos4.0/library/cc/FadeOutDownTiles.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FadeOutDownTiles.lua rename to meta/3rd/Cocos4.0/library/cc/FadeOutDownTiles.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FadeOutTRTiles.lua b/meta/3rd/Cocos4.0/library/cc/FadeOutTRTiles.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FadeOutTRTiles.lua rename to meta/3rd/Cocos4.0/library/cc/FadeOutTRTiles.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FadeOutUpTiles.lua b/meta/3rd/Cocos4.0/library/cc/FadeOutUpTiles.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FadeOutUpTiles.lua rename to meta/3rd/Cocos4.0/library/cc/FadeOutUpTiles.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FadeTo.lua b/meta/3rd/Cocos4.0/library/cc/FadeTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FadeTo.lua rename to meta/3rd/Cocos4.0/library/cc/FadeTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FastTMXLayer.lua b/meta/3rd/Cocos4.0/library/cc/FastTMXLayer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FastTMXLayer.lua rename to meta/3rd/Cocos4.0/library/cc/FastTMXLayer.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FastTMXTiledMap.lua b/meta/3rd/Cocos4.0/library/cc/FastTMXTiledMap.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FastTMXTiledMap.lua rename to meta/3rd/Cocos4.0/library/cc/FastTMXTiledMap.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FileUtils.lua b/meta/3rd/Cocos4.0/library/cc/FileUtils.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FileUtils.lua rename to meta/3rd/Cocos4.0/library/cc/FileUtils.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FiniteTimeAction.lua b/meta/3rd/Cocos4.0/library/cc/FiniteTimeAction.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FiniteTimeAction.lua rename to meta/3rd/Cocos4.0/library/cc/FiniteTimeAction.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FlipX.lua b/meta/3rd/Cocos4.0/library/cc/FlipX.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FlipX.lua rename to meta/3rd/Cocos4.0/library/cc/FlipX.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FlipX3D.lua b/meta/3rd/Cocos4.0/library/cc/FlipX3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FlipX3D.lua rename to meta/3rd/Cocos4.0/library/cc/FlipX3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FlipY.lua b/meta/3rd/Cocos4.0/library/cc/FlipY.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FlipY.lua rename to meta/3rd/Cocos4.0/library/cc/FlipY.lua diff --git a/meta/3rd/Cocos4.0/library/cc.FlipY3D.lua b/meta/3rd/Cocos4.0/library/cc/FlipY3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.FlipY3D.lua rename to meta/3rd/Cocos4.0/library/cc/FlipY3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Follow.lua b/meta/3rd/Cocos4.0/library/cc/Follow.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Follow.lua rename to meta/3rd/Cocos4.0/library/cc/Follow.lua diff --git a/meta/3rd/Cocos4.0/library/cc.GLView.lua b/meta/3rd/Cocos4.0/library/cc/GLView.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.GLView.lua rename to meta/3rd/Cocos4.0/library/cc/GLView.lua diff --git a/meta/3rd/Cocos4.0/library/cc.GLViewImpl.lua b/meta/3rd/Cocos4.0/library/cc/GLViewImpl.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.GLViewImpl.lua rename to meta/3rd/Cocos4.0/library/cc/GLViewImpl.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Grid3D.lua b/meta/3rd/Cocos4.0/library/cc/Grid3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Grid3D.lua rename to meta/3rd/Cocos4.0/library/cc/Grid3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Grid3DAction.lua b/meta/3rd/Cocos4.0/library/cc/Grid3DAction.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Grid3DAction.lua rename to meta/3rd/Cocos4.0/library/cc/Grid3DAction.lua diff --git a/meta/3rd/Cocos4.0/library/cc.GridAction.lua b/meta/3rd/Cocos4.0/library/cc/GridAction.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.GridAction.lua rename to meta/3rd/Cocos4.0/library/cc/GridAction.lua diff --git a/meta/3rd/Cocos4.0/library/cc.GridBase.lua b/meta/3rd/Cocos4.0/library/cc/GridBase.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.GridBase.lua rename to meta/3rd/Cocos4.0/library/cc/GridBase.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Hide.lua b/meta/3rd/Cocos4.0/library/cc/Hide.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Hide.lua rename to meta/3rd/Cocos4.0/library/cc/Hide.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Image.lua b/meta/3rd/Cocos4.0/library/cc/Image.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Image.lua rename to meta/3rd/Cocos4.0/library/cc/Image.lua diff --git a/meta/3rd/Cocos4.0/library/cc.JumpBy.lua b/meta/3rd/Cocos4.0/library/cc/JumpBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.JumpBy.lua rename to meta/3rd/Cocos4.0/library/cc/JumpBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.JumpTiles3D.lua b/meta/3rd/Cocos4.0/library/cc/JumpTiles3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.JumpTiles3D.lua rename to meta/3rd/Cocos4.0/library/cc/JumpTiles3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.JumpTo.lua b/meta/3rd/Cocos4.0/library/cc/JumpTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.JumpTo.lua rename to meta/3rd/Cocos4.0/library/cc/JumpTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Label.lua b/meta/3rd/Cocos4.0/library/cc/Label.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Label.lua rename to meta/3rd/Cocos4.0/library/cc/Label.lua diff --git a/meta/3rd/Cocos4.0/library/cc.LabelAtlas.lua b/meta/3rd/Cocos4.0/library/cc/LabelAtlas.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.LabelAtlas.lua rename to meta/3rd/Cocos4.0/library/cc/LabelAtlas.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Layer.lua b/meta/3rd/Cocos4.0/library/cc/Layer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Layer.lua rename to meta/3rd/Cocos4.0/library/cc/Layer.lua diff --git a/meta/3rd/Cocos4.0/library/cc.LayerColor.lua b/meta/3rd/Cocos4.0/library/cc/LayerColor.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.LayerColor.lua rename to meta/3rd/Cocos4.0/library/cc/LayerColor.lua diff --git a/meta/3rd/Cocos4.0/library/cc.LayerGradient.lua b/meta/3rd/Cocos4.0/library/cc/LayerGradient.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.LayerGradient.lua rename to meta/3rd/Cocos4.0/library/cc/LayerGradient.lua diff --git a/meta/3rd/Cocos4.0/library/cc.LayerMultiplex.lua b/meta/3rd/Cocos4.0/library/cc/LayerMultiplex.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.LayerMultiplex.lua rename to meta/3rd/Cocos4.0/library/cc/LayerMultiplex.lua diff --git a/meta/3rd/Cocos4.0/library/cc.LayerRadialGradient.lua b/meta/3rd/Cocos4.0/library/cc/LayerRadialGradient.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.LayerRadialGradient.lua rename to meta/3rd/Cocos4.0/library/cc/LayerRadialGradient.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Lens3D.lua b/meta/3rd/Cocos4.0/library/cc/Lens3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Lens3D.lua rename to meta/3rd/Cocos4.0/library/cc/Lens3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Liquid.lua b/meta/3rd/Cocos4.0/library/cc/Liquid.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Liquid.lua rename to meta/3rd/Cocos4.0/library/cc/Liquid.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Manifest.lua b/meta/3rd/Cocos4.0/library/cc/Manifest.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Manifest.lua rename to meta/3rd/Cocos4.0/library/cc/Manifest.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Material.lua b/meta/3rd/Cocos4.0/library/cc/Material.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Material.lua rename to meta/3rd/Cocos4.0/library/cc/Material.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Menu.lua b/meta/3rd/Cocos4.0/library/cc/Menu.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Menu.lua rename to meta/3rd/Cocos4.0/library/cc/Menu.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MenuItem.lua b/meta/3rd/Cocos4.0/library/cc/MenuItem.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MenuItem.lua rename to meta/3rd/Cocos4.0/library/cc/MenuItem.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MenuItemAtlasFont.lua b/meta/3rd/Cocos4.0/library/cc/MenuItemAtlasFont.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MenuItemAtlasFont.lua rename to meta/3rd/Cocos4.0/library/cc/MenuItemAtlasFont.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MenuItemFont.lua b/meta/3rd/Cocos4.0/library/cc/MenuItemFont.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MenuItemFont.lua rename to meta/3rd/Cocos4.0/library/cc/MenuItemFont.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MenuItemImage.lua b/meta/3rd/Cocos4.0/library/cc/MenuItemImage.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MenuItemImage.lua rename to meta/3rd/Cocos4.0/library/cc/MenuItemImage.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MenuItemLabel.lua b/meta/3rd/Cocos4.0/library/cc/MenuItemLabel.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MenuItemLabel.lua rename to meta/3rd/Cocos4.0/library/cc/MenuItemLabel.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MenuItemSprite.lua b/meta/3rd/Cocos4.0/library/cc/MenuItemSprite.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MenuItemSprite.lua rename to meta/3rd/Cocos4.0/library/cc/MenuItemSprite.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MenuItemToggle.lua b/meta/3rd/Cocos4.0/library/cc/MenuItemToggle.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MenuItemToggle.lua rename to meta/3rd/Cocos4.0/library/cc/MenuItemToggle.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Mesh.lua b/meta/3rd/Cocos4.0/library/cc/Mesh.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Mesh.lua rename to meta/3rd/Cocos4.0/library/cc/Mesh.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MotionStreak.lua b/meta/3rd/Cocos4.0/library/cc/MotionStreak.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MotionStreak.lua rename to meta/3rd/Cocos4.0/library/cc/MotionStreak.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MotionStreak3D.lua b/meta/3rd/Cocos4.0/library/cc/MotionStreak3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MotionStreak3D.lua rename to meta/3rd/Cocos4.0/library/cc/MotionStreak3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MoveBy.lua b/meta/3rd/Cocos4.0/library/cc/MoveBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MoveBy.lua rename to meta/3rd/Cocos4.0/library/cc/MoveBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.MoveTo.lua b/meta/3rd/Cocos4.0/library/cc/MoveTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.MoveTo.lua rename to meta/3rd/Cocos4.0/library/cc/MoveTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.NavMesh.lua b/meta/3rd/Cocos4.0/library/cc/NavMesh.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.NavMesh.lua rename to meta/3rd/Cocos4.0/library/cc/NavMesh.lua diff --git a/meta/3rd/Cocos4.0/library/cc.NavMeshAgent.lua b/meta/3rd/Cocos4.0/library/cc/NavMeshAgent.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.NavMeshAgent.lua rename to meta/3rd/Cocos4.0/library/cc/NavMeshAgent.lua diff --git a/meta/3rd/Cocos4.0/library/cc.NavMeshObstacle.lua b/meta/3rd/Cocos4.0/library/cc/NavMeshObstacle.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.NavMeshObstacle.lua rename to meta/3rd/Cocos4.0/library/cc/NavMeshObstacle.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Node.lua b/meta/3rd/Cocos4.0/library/cc/Node.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Node.lua rename to meta/3rd/Cocos4.0/library/cc/Node.lua diff --git a/meta/3rd/Cocos4.0/library/cc.NodeGrid.lua b/meta/3rd/Cocos4.0/library/cc/NodeGrid.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.NodeGrid.lua rename to meta/3rd/Cocos4.0/library/cc/NodeGrid.lua diff --git a/meta/3rd/Cocos4.0/library/cc.OrbitCamera.lua b/meta/3rd/Cocos4.0/library/cc/OrbitCamera.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.OrbitCamera.lua rename to meta/3rd/Cocos4.0/library/cc/OrbitCamera.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PUParticleSystem3D.lua b/meta/3rd/Cocos4.0/library/cc/PUParticleSystem3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PUParticleSystem3D.lua rename to meta/3rd/Cocos4.0/library/cc/PUParticleSystem3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PageTurn3D.lua b/meta/3rd/Cocos4.0/library/cc/PageTurn3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PageTurn3D.lua rename to meta/3rd/Cocos4.0/library/cc/PageTurn3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParallaxNode.lua b/meta/3rd/Cocos4.0/library/cc/ParallaxNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParallaxNode.lua rename to meta/3rd/Cocos4.0/library/cc/ParallaxNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleBatchNode.lua b/meta/3rd/Cocos4.0/library/cc/ParticleBatchNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleBatchNode.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleBatchNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleData.lua b/meta/3rd/Cocos4.0/library/cc/ParticleData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleData.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleData.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleExplosion.lua b/meta/3rd/Cocos4.0/library/cc/ParticleExplosion.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleExplosion.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleExplosion.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleFire.lua b/meta/3rd/Cocos4.0/library/cc/ParticleFire.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleFire.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleFire.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleFireworks.lua b/meta/3rd/Cocos4.0/library/cc/ParticleFireworks.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleFireworks.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleFireworks.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleFlower.lua b/meta/3rd/Cocos4.0/library/cc/ParticleFlower.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleFlower.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleFlower.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleGalaxy.lua b/meta/3rd/Cocos4.0/library/cc/ParticleGalaxy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleGalaxy.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleGalaxy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleMeteor.lua b/meta/3rd/Cocos4.0/library/cc/ParticleMeteor.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleMeteor.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleMeteor.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleRain.lua b/meta/3rd/Cocos4.0/library/cc/ParticleRain.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleRain.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleRain.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleSmoke.lua b/meta/3rd/Cocos4.0/library/cc/ParticleSmoke.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleSmoke.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleSmoke.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleSnow.lua b/meta/3rd/Cocos4.0/library/cc/ParticleSnow.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleSnow.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleSnow.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleSpiral.lua b/meta/3rd/Cocos4.0/library/cc/ParticleSpiral.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleSpiral.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleSpiral.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleSun.lua b/meta/3rd/Cocos4.0/library/cc/ParticleSun.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleSun.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleSun.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleSystem.lua b/meta/3rd/Cocos4.0/library/cc/ParticleSystem.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleSystem.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleSystem.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleSystem3D.lua b/meta/3rd/Cocos4.0/library/cc/ParticleSystem3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleSystem3D.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleSystem3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ParticleSystemQuad.lua b/meta/3rd/Cocos4.0/library/cc/ParticleSystemQuad.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ParticleSystemQuad.lua rename to meta/3rd/Cocos4.0/library/cc/ParticleSystemQuad.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Pass.lua b/meta/3rd/Cocos4.0/library/cc/Pass.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Pass.lua rename to meta/3rd/Cocos4.0/library/cc/Pass.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3D6DofConstraint.lua b/meta/3rd/Cocos4.0/library/cc/Physics3D6DofConstraint.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3D6DofConstraint.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3D6DofConstraint.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DComponent.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DComponent.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DComponent.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DComponent.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DConeTwistConstraint.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DConeTwistConstraint.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DConeTwistConstraint.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DConeTwistConstraint.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DConstraint.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DConstraint.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DConstraint.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DConstraint.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DHingeConstraint.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DHingeConstraint.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DHingeConstraint.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DHingeConstraint.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DObject.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DObject.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DObject.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DObject.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DPointToPointConstraint.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DPointToPointConstraint.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DPointToPointConstraint.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DPointToPointConstraint.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DRigidBody.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DRigidBody.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DRigidBody.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DRigidBody.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DShape.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DShape.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DShape.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DShape.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DSliderConstraint.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DSliderConstraint.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DSliderConstraint.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DSliderConstraint.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Physics3DWorld.lua b/meta/3rd/Cocos4.0/library/cc/Physics3DWorld.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Physics3DWorld.lua rename to meta/3rd/Cocos4.0/library/cc/Physics3DWorld.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsBody.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsBody.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsBody.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsBody.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsContact.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsContact.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsContact.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsContact.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsContactPostSolve.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsContactPostSolve.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsContactPostSolve.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsContactPostSolve.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsContactPreSolve.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsContactPreSolve.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsContactPreSolve.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsContactPreSolve.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJoint.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJoint.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJoint.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJoint.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointDistance.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointDistance.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointDistance.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointDistance.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointFixed.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointFixed.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointFixed.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointFixed.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointGear.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointGear.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointGear.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointGear.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointGroove.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointGroove.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointGroove.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointGroove.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointLimit.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointLimit.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointLimit.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointLimit.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointMotor.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointMotor.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointMotor.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointMotor.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointPin.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointPin.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointPin.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointPin.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointRatchet.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointRatchet.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointRatchet.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointRatchet.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointRotaryLimit.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointRotaryLimit.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointRotaryLimit.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointRotaryLimit.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointRotarySpring.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointRotarySpring.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointRotarySpring.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointRotarySpring.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsJointSpring.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsJointSpring.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsJointSpring.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsJointSpring.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShape.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShape.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShape.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShape.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShapeBox.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShapeBox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShapeBox.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShapeBox.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShapeCircle.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShapeCircle.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShapeCircle.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShapeCircle.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgeBox.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgeBox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgeBox.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgeBox.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgeChain.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgeChain.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgeChain.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgeChain.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgePolygon.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgePolygon.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgePolygon.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgePolygon.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgeSegment.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgeSegment.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShapeEdgeSegment.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShapeEdgeSegment.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsShapePolygon.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsShapePolygon.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsShapePolygon.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsShapePolygon.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsSprite3D.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsSprite3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsSprite3D.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsSprite3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PhysicsWorld.lua b/meta/3rd/Cocos4.0/library/cc/PhysicsWorld.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PhysicsWorld.lua rename to meta/3rd/Cocos4.0/library/cc/PhysicsWorld.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Place.lua b/meta/3rd/Cocos4.0/library/cc/Place.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Place.lua rename to meta/3rd/Cocos4.0/library/cc/Place.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PointLight.lua b/meta/3rd/Cocos4.0/library/cc/PointLight.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PointLight.lua rename to meta/3rd/Cocos4.0/library/cc/PointLight.lua diff --git a/meta/3rd/Cocos4.0/library/cc.PolygonInfo.lua b/meta/3rd/Cocos4.0/library/cc/PolygonInfo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.PolygonInfo.lua rename to meta/3rd/Cocos4.0/library/cc/PolygonInfo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ProgressFromTo.lua b/meta/3rd/Cocos4.0/library/cc/ProgressFromTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ProgressFromTo.lua rename to meta/3rd/Cocos4.0/library/cc/ProgressFromTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ProgressTimer.lua b/meta/3rd/Cocos4.0/library/cc/ProgressTimer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ProgressTimer.lua rename to meta/3rd/Cocos4.0/library/cc/ProgressTimer.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ProgressTo.lua b/meta/3rd/Cocos4.0/library/cc/ProgressTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ProgressTo.lua rename to meta/3rd/Cocos4.0/library/cc/ProgressTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Properties.lua b/meta/3rd/Cocos4.0/library/cc/Properties.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Properties.lua rename to meta/3rd/Cocos4.0/library/cc/Properties.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ProtectedNode.lua b/meta/3rd/Cocos4.0/library/cc/ProtectedNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ProtectedNode.lua rename to meta/3rd/Cocos4.0/library/cc/ProtectedNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Ref.lua b/meta/3rd/Cocos4.0/library/cc/Ref.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Ref.lua rename to meta/3rd/Cocos4.0/library/cc/Ref.lua diff --git a/meta/3rd/Cocos4.0/library/cc.RemoveSelf.lua b/meta/3rd/Cocos4.0/library/cc/RemoveSelf.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.RemoveSelf.lua rename to meta/3rd/Cocos4.0/library/cc/RemoveSelf.lua diff --git a/meta/3rd/Cocos4.0/library/cc.RenderState.lua b/meta/3rd/Cocos4.0/library/cc/RenderState.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.RenderState.lua rename to meta/3rd/Cocos4.0/library/cc/RenderState.lua diff --git a/meta/3rd/Cocos4.0/library/cc.RenderTexture.lua b/meta/3rd/Cocos4.0/library/cc/RenderTexture.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.RenderTexture.lua rename to meta/3rd/Cocos4.0/library/cc/RenderTexture.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Renderer.lua b/meta/3rd/Cocos4.0/library/cc/Renderer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Renderer.lua rename to meta/3rd/Cocos4.0/library/cc/Renderer.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Repeat.lua b/meta/3rd/Cocos4.0/library/cc/Repeat.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Repeat.lua rename to meta/3rd/Cocos4.0/library/cc/Repeat.lua diff --git a/meta/3rd/Cocos4.0/library/cc.RepeatForever.lua b/meta/3rd/Cocos4.0/library/cc/RepeatForever.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.RepeatForever.lua rename to meta/3rd/Cocos4.0/library/cc/RepeatForever.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ReuseGrid.lua b/meta/3rd/Cocos4.0/library/cc/ReuseGrid.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ReuseGrid.lua rename to meta/3rd/Cocos4.0/library/cc/ReuseGrid.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Ripple3D.lua b/meta/3rd/Cocos4.0/library/cc/Ripple3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Ripple3D.lua rename to meta/3rd/Cocos4.0/library/cc/Ripple3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.RotateBy.lua b/meta/3rd/Cocos4.0/library/cc/RotateBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.RotateBy.lua rename to meta/3rd/Cocos4.0/library/cc/RotateBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.RotateTo.lua b/meta/3rd/Cocos4.0/library/cc/RotateTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.RotateTo.lua rename to meta/3rd/Cocos4.0/library/cc/RotateTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ScaleBy.lua b/meta/3rd/Cocos4.0/library/cc/ScaleBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ScaleBy.lua rename to meta/3rd/Cocos4.0/library/cc/ScaleBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ScaleTo.lua b/meta/3rd/Cocos4.0/library/cc/ScaleTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ScaleTo.lua rename to meta/3rd/Cocos4.0/library/cc/ScaleTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Scene.lua b/meta/3rd/Cocos4.0/library/cc/Scene.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Scene.lua rename to meta/3rd/Cocos4.0/library/cc/Scene.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Scheduler.lua b/meta/3rd/Cocos4.0/library/cc/Scheduler.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Scheduler.lua rename to meta/3rd/Cocos4.0/library/cc/Scheduler.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Sequence.lua b/meta/3rd/Cocos4.0/library/cc/Sequence.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Sequence.lua rename to meta/3rd/Cocos4.0/library/cc/Sequence.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ShaderCache.lua b/meta/3rd/Cocos4.0/library/cc/ShaderCache.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ShaderCache.lua rename to meta/3rd/Cocos4.0/library/cc/ShaderCache.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Shaky3D.lua b/meta/3rd/Cocos4.0/library/cc/Shaky3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Shaky3D.lua rename to meta/3rd/Cocos4.0/library/cc/Shaky3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ShakyTiles3D.lua b/meta/3rd/Cocos4.0/library/cc/ShakyTiles3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ShakyTiles3D.lua rename to meta/3rd/Cocos4.0/library/cc/ShakyTiles3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ShatteredTiles3D.lua b/meta/3rd/Cocos4.0/library/cc/ShatteredTiles3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ShatteredTiles3D.lua rename to meta/3rd/Cocos4.0/library/cc/ShatteredTiles3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Show.lua b/meta/3rd/Cocos4.0/library/cc/Show.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Show.lua rename to meta/3rd/Cocos4.0/library/cc/Show.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ShuffleTiles.lua b/meta/3rd/Cocos4.0/library/cc/ShuffleTiles.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ShuffleTiles.lua rename to meta/3rd/Cocos4.0/library/cc/ShuffleTiles.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Skeleton3D.lua b/meta/3rd/Cocos4.0/library/cc/Skeleton3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Skeleton3D.lua rename to meta/3rd/Cocos4.0/library/cc/Skeleton3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SkewBy.lua b/meta/3rd/Cocos4.0/library/cc/SkewBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SkewBy.lua rename to meta/3rd/Cocos4.0/library/cc/SkewBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SkewTo.lua b/meta/3rd/Cocos4.0/library/cc/SkewTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SkewTo.lua rename to meta/3rd/Cocos4.0/library/cc/SkewTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Skybox.lua b/meta/3rd/Cocos4.0/library/cc/Skybox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Skybox.lua rename to meta/3rd/Cocos4.0/library/cc/Skybox.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Spawn.lua b/meta/3rd/Cocos4.0/library/cc/Spawn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Spawn.lua rename to meta/3rd/Cocos4.0/library/cc/Spawn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Speed.lua b/meta/3rd/Cocos4.0/library/cc/Speed.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Speed.lua rename to meta/3rd/Cocos4.0/library/cc/Speed.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SplitCols.lua b/meta/3rd/Cocos4.0/library/cc/SplitCols.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SplitCols.lua rename to meta/3rd/Cocos4.0/library/cc/SplitCols.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SplitRows.lua b/meta/3rd/Cocos4.0/library/cc/SplitRows.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SplitRows.lua rename to meta/3rd/Cocos4.0/library/cc/SplitRows.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SpotLight.lua b/meta/3rd/Cocos4.0/library/cc/SpotLight.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SpotLight.lua rename to meta/3rd/Cocos4.0/library/cc/SpotLight.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Sprite.lua b/meta/3rd/Cocos4.0/library/cc/Sprite.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Sprite.lua rename to meta/3rd/Cocos4.0/library/cc/Sprite.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Sprite3D.lua b/meta/3rd/Cocos4.0/library/cc/Sprite3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Sprite3D.lua rename to meta/3rd/Cocos4.0/library/cc/Sprite3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Sprite3DCache.lua b/meta/3rd/Cocos4.0/library/cc/Sprite3DCache.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Sprite3DCache.lua rename to meta/3rd/Cocos4.0/library/cc/Sprite3DCache.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Sprite3DMaterial.lua b/meta/3rd/Cocos4.0/library/cc/Sprite3DMaterial.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Sprite3DMaterial.lua rename to meta/3rd/Cocos4.0/library/cc/Sprite3DMaterial.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SpriteBatchNode.lua b/meta/3rd/Cocos4.0/library/cc/SpriteBatchNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SpriteBatchNode.lua rename to meta/3rd/Cocos4.0/library/cc/SpriteBatchNode.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SpriteFrame.lua b/meta/3rd/Cocos4.0/library/cc/SpriteFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SpriteFrame.lua rename to meta/3rd/Cocos4.0/library/cc/SpriteFrame.lua diff --git a/meta/3rd/Cocos4.0/library/cc.SpriteFrameCache.lua b/meta/3rd/Cocos4.0/library/cc/SpriteFrameCache.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.SpriteFrameCache.lua rename to meta/3rd/Cocos4.0/library/cc/SpriteFrameCache.lua diff --git a/meta/3rd/Cocos4.0/library/cc.StopGrid.lua b/meta/3rd/Cocos4.0/library/cc/StopGrid.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.StopGrid.lua rename to meta/3rd/Cocos4.0/library/cc/StopGrid.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TMXLayer.lua b/meta/3rd/Cocos4.0/library/cc/TMXLayer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TMXLayer.lua rename to meta/3rd/Cocos4.0/library/cc/TMXLayer.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TMXLayerInfo.lua b/meta/3rd/Cocos4.0/library/cc/TMXLayerInfo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TMXLayerInfo.lua rename to meta/3rd/Cocos4.0/library/cc/TMXLayerInfo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TMXMapInfo.lua b/meta/3rd/Cocos4.0/library/cc/TMXMapInfo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TMXMapInfo.lua rename to meta/3rd/Cocos4.0/library/cc/TMXMapInfo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TMXObjectGroup.lua b/meta/3rd/Cocos4.0/library/cc/TMXObjectGroup.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TMXObjectGroup.lua rename to meta/3rd/Cocos4.0/library/cc/TMXObjectGroup.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TMXTiledMap.lua b/meta/3rd/Cocos4.0/library/cc/TMXTiledMap.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TMXTiledMap.lua rename to meta/3rd/Cocos4.0/library/cc/TMXTiledMap.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TMXTilesetInfo.lua b/meta/3rd/Cocos4.0/library/cc/TMXTilesetInfo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TMXTilesetInfo.lua rename to meta/3rd/Cocos4.0/library/cc/TMXTilesetInfo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TableView.lua b/meta/3rd/Cocos4.0/library/cc/TableView.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TableView.lua rename to meta/3rd/Cocos4.0/library/cc/TableView.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TableViewCell.lua b/meta/3rd/Cocos4.0/library/cc/TableViewCell.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TableViewCell.lua rename to meta/3rd/Cocos4.0/library/cc/TableViewCell.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TargetedAction.lua b/meta/3rd/Cocos4.0/library/cc/TargetedAction.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TargetedAction.lua rename to meta/3rd/Cocos4.0/library/cc/TargetedAction.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Technique.lua b/meta/3rd/Cocos4.0/library/cc/Technique.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Technique.lua rename to meta/3rd/Cocos4.0/library/cc/Technique.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Terrain.lua b/meta/3rd/Cocos4.0/library/cc/Terrain.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Terrain.lua rename to meta/3rd/Cocos4.0/library/cc/Terrain.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Texture2D.lua b/meta/3rd/Cocos4.0/library/cc/Texture2D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Texture2D.lua rename to meta/3rd/Cocos4.0/library/cc/Texture2D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TextureCache.lua b/meta/3rd/Cocos4.0/library/cc/TextureCache.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TextureCache.lua rename to meta/3rd/Cocos4.0/library/cc/TextureCache.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TextureCube.lua b/meta/3rd/Cocos4.0/library/cc/TextureCube.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TextureCube.lua rename to meta/3rd/Cocos4.0/library/cc/TextureCube.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TileMapAtlas.lua b/meta/3rd/Cocos4.0/library/cc/TileMapAtlas.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TileMapAtlas.lua rename to meta/3rd/Cocos4.0/library/cc/TileMapAtlas.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TiledGrid3D.lua b/meta/3rd/Cocos4.0/library/cc/TiledGrid3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TiledGrid3D.lua rename to meta/3rd/Cocos4.0/library/cc/TiledGrid3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TiledGrid3DAction.lua b/meta/3rd/Cocos4.0/library/cc/TiledGrid3DAction.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TiledGrid3DAction.lua rename to meta/3rd/Cocos4.0/library/cc/TiledGrid3DAction.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Timer.lua b/meta/3rd/Cocos4.0/library/cc/Timer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Timer.lua rename to meta/3rd/Cocos4.0/library/cc/Timer.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TintBy.lua b/meta/3rd/Cocos4.0/library/cc/TintBy.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TintBy.lua rename to meta/3rd/Cocos4.0/library/cc/TintBy.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TintTo.lua b/meta/3rd/Cocos4.0/library/cc/TintTo.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TintTo.lua rename to meta/3rd/Cocos4.0/library/cc/TintTo.lua diff --git a/meta/3rd/Cocos4.0/library/cc.ToggleVisibility.lua b/meta/3rd/Cocos4.0/library/cc/ToggleVisibility.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.ToggleVisibility.lua rename to meta/3rd/Cocos4.0/library/cc/ToggleVisibility.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Touch.lua b/meta/3rd/Cocos4.0/library/cc/Touch.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Touch.lua rename to meta/3rd/Cocos4.0/library/cc/Touch.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionCrossFade.lua b/meta/3rd/Cocos4.0/library/cc/TransitionCrossFade.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionCrossFade.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionCrossFade.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionEaseScene.lua b/meta/3rd/Cocos4.0/library/cc/TransitionEaseScene.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionEaseScene.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionEaseScene.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFade.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFade.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFade.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFade.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFadeBL.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFadeBL.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFadeBL.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFadeBL.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFadeDown.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFadeDown.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFadeDown.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFadeDown.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFadeTR.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFadeTR.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFadeTR.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFadeTR.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFadeUp.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFadeUp.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFadeUp.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFadeUp.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFlipAngular.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFlipAngular.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFlipAngular.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFlipAngular.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFlipX.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFlipX.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFlipX.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFlipX.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionFlipY.lua b/meta/3rd/Cocos4.0/library/cc/TransitionFlipY.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionFlipY.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionFlipY.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionJumpZoom.lua b/meta/3rd/Cocos4.0/library/cc/TransitionJumpZoom.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionJumpZoom.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionJumpZoom.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionMoveInB.lua b/meta/3rd/Cocos4.0/library/cc/TransitionMoveInB.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionMoveInB.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionMoveInB.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionMoveInL.lua b/meta/3rd/Cocos4.0/library/cc/TransitionMoveInL.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionMoveInL.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionMoveInL.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionMoveInR.lua b/meta/3rd/Cocos4.0/library/cc/TransitionMoveInR.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionMoveInR.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionMoveInR.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionMoveInT.lua b/meta/3rd/Cocos4.0/library/cc/TransitionMoveInT.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionMoveInT.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionMoveInT.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionPageTurn.lua b/meta/3rd/Cocos4.0/library/cc/TransitionPageTurn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionPageTurn.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionPageTurn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionProgress.lua b/meta/3rd/Cocos4.0/library/cc/TransitionProgress.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionProgress.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionProgress.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionProgressHorizontal.lua b/meta/3rd/Cocos4.0/library/cc/TransitionProgressHorizontal.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionProgressHorizontal.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionProgressHorizontal.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionProgressInOut.lua b/meta/3rd/Cocos4.0/library/cc/TransitionProgressInOut.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionProgressInOut.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionProgressInOut.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionProgressOutIn.lua b/meta/3rd/Cocos4.0/library/cc/TransitionProgressOutIn.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionProgressOutIn.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionProgressOutIn.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionProgressRadialCCW.lua b/meta/3rd/Cocos4.0/library/cc/TransitionProgressRadialCCW.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionProgressRadialCCW.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionProgressRadialCCW.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionProgressRadialCW.lua b/meta/3rd/Cocos4.0/library/cc/TransitionProgressRadialCW.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionProgressRadialCW.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionProgressRadialCW.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionProgressVertical.lua b/meta/3rd/Cocos4.0/library/cc/TransitionProgressVertical.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionProgressVertical.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionProgressVertical.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionRotoZoom.lua b/meta/3rd/Cocos4.0/library/cc/TransitionRotoZoom.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionRotoZoom.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionRotoZoom.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionScene.lua b/meta/3rd/Cocos4.0/library/cc/TransitionScene.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionScene.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionScene.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionSceneOriented.lua b/meta/3rd/Cocos4.0/library/cc/TransitionSceneOriented.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionSceneOriented.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionSceneOriented.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionShrinkGrow.lua b/meta/3rd/Cocos4.0/library/cc/TransitionShrinkGrow.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionShrinkGrow.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionShrinkGrow.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionSlideInB.lua b/meta/3rd/Cocos4.0/library/cc/TransitionSlideInB.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionSlideInB.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionSlideInB.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionSlideInL.lua b/meta/3rd/Cocos4.0/library/cc/TransitionSlideInL.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionSlideInL.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionSlideInL.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionSlideInR.lua b/meta/3rd/Cocos4.0/library/cc/TransitionSlideInR.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionSlideInR.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionSlideInR.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionSlideInT.lua b/meta/3rd/Cocos4.0/library/cc/TransitionSlideInT.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionSlideInT.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionSlideInT.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionSplitCols.lua b/meta/3rd/Cocos4.0/library/cc/TransitionSplitCols.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionSplitCols.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionSplitCols.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionSplitRows.lua b/meta/3rd/Cocos4.0/library/cc/TransitionSplitRows.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionSplitRows.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionSplitRows.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionTurnOffTiles.lua b/meta/3rd/Cocos4.0/library/cc/TransitionTurnOffTiles.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionTurnOffTiles.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionTurnOffTiles.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionZoomFlipAngular.lua b/meta/3rd/Cocos4.0/library/cc/TransitionZoomFlipAngular.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionZoomFlipAngular.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionZoomFlipAngular.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionZoomFlipX.lua b/meta/3rd/Cocos4.0/library/cc/TransitionZoomFlipX.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionZoomFlipX.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionZoomFlipX.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TransitionZoomFlipY.lua b/meta/3rd/Cocos4.0/library/cc/TransitionZoomFlipY.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TransitionZoomFlipY.lua rename to meta/3rd/Cocos4.0/library/cc/TransitionZoomFlipY.lua diff --git a/meta/3rd/Cocos4.0/library/cc.TurnOffTiles.lua b/meta/3rd/Cocos4.0/library/cc/TurnOffTiles.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.TurnOffTiles.lua rename to meta/3rd/Cocos4.0/library/cc/TurnOffTiles.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Twirl.lua b/meta/3rd/Cocos4.0/library/cc/Twirl.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Twirl.lua rename to meta/3rd/Cocos4.0/library/cc/Twirl.lua diff --git a/meta/3rd/Cocos4.0/library/cc.UserDefault.lua b/meta/3rd/Cocos4.0/library/cc/UserDefault.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.UserDefault.lua rename to meta/3rd/Cocos4.0/library/cc/UserDefault.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Waves.lua b/meta/3rd/Cocos4.0/library/cc/Waves.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Waves.lua rename to meta/3rd/Cocos4.0/library/cc/Waves.lua diff --git a/meta/3rd/Cocos4.0/library/cc.Waves3D.lua b/meta/3rd/Cocos4.0/library/cc/Waves3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.Waves3D.lua rename to meta/3rd/Cocos4.0/library/cc/Waves3D.lua diff --git a/meta/3rd/Cocos4.0/library/cc.WavesTiles3D.lua b/meta/3rd/Cocos4.0/library/cc/WavesTiles3D.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/cc.WavesTiles3D.lua rename to meta/3rd/Cocos4.0/library/cc/WavesTiles3D.lua diff --git a/meta/3rd/Cocos4.0/library/ccb.Program.lua b/meta/3rd/Cocos4.0/library/ccb/Program.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccb.Program.lua rename to meta/3rd/Cocos4.0/library/ccb/Program.lua diff --git a/meta/3rd/Cocos4.0/library/ccb.ProgramState.lua b/meta/3rd/Cocos4.0/library/ccb/ProgramState.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccb.ProgramState.lua rename to meta/3rd/Cocos4.0/library/ccb/ProgramState.lua diff --git a/meta/3rd/Cocos4.0/library/ccb.Texture2DBackend.lua b/meta/3rd/Cocos4.0/library/ccb/Texture2DBackend.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccb.Texture2DBackend.lua rename to meta/3rd/Cocos4.0/library/ccb/Texture2DBackend.lua diff --git a/meta/3rd/Cocos4.0/library/ccb.TextureBackend.lua b/meta/3rd/Cocos4.0/library/ccb/TextureBackend.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccb.TextureBackend.lua rename to meta/3rd/Cocos4.0/library/ccb/TextureBackend.lua diff --git a/meta/3rd/Cocos4.0/library/ccb.TextureCubemapBackend.lua b/meta/3rd/Cocos4.0/library/ccb/TextureCubemapBackend.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccb.TextureCubemapBackend.lua rename to meta/3rd/Cocos4.0/library/ccb/TextureCubemapBackend.lua diff --git a/meta/3rd/Cocos4.0/library/ccb.VertexLayout.lua b/meta/3rd/Cocos4.0/library/ccb/VertexLayout.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccb.VertexLayout.lua rename to meta/3rd/Cocos4.0/library/ccb/VertexLayout.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionFadeFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ActionFadeFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionFadeFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionFadeFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ActionFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionManagerEx.lua b/meta/3rd/Cocos4.0/library/ccs/ActionManagerEx.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionManagerEx.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionManagerEx.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionMoveFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ActionMoveFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionMoveFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionMoveFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionObject.lua b/meta/3rd/Cocos4.0/library/ccs/ActionObject.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionObject.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionObject.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionRotationFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ActionRotationFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionRotationFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionRotationFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionScaleFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ActionScaleFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionScaleFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionScaleFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionTimeline.lua b/meta/3rd/Cocos4.0/library/ccs/ActionTimeline.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionTimeline.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionTimeline.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionTimelineCache.lua b/meta/3rd/Cocos4.0/library/ccs/ActionTimelineCache.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionTimelineCache.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionTimelineCache.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionTimelineData.lua b/meta/3rd/Cocos4.0/library/ccs/ActionTimelineData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionTimelineData.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionTimelineData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionTimelineNode.lua b/meta/3rd/Cocos4.0/library/ccs/ActionTimelineNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionTimelineNode.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionTimelineNode.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ActionTintFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ActionTintFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ActionTintFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ActionTintFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.AlphaFrame.lua b/meta/3rd/Cocos4.0/library/ccs/AlphaFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.AlphaFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/AlphaFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.AnchorPointFrame.lua b/meta/3rd/Cocos4.0/library/ccs/AnchorPointFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.AnchorPointFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/AnchorPointFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.AnimationData.lua b/meta/3rd/Cocos4.0/library/ccs/AnimationData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.AnimationData.lua rename to meta/3rd/Cocos4.0/library/ccs/AnimationData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.Armature.lua b/meta/3rd/Cocos4.0/library/ccs/Armature.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.Armature.lua rename to meta/3rd/Cocos4.0/library/ccs/Armature.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ArmatureAnimation.lua b/meta/3rd/Cocos4.0/library/ccs/ArmatureAnimation.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ArmatureAnimation.lua rename to meta/3rd/Cocos4.0/library/ccs/ArmatureAnimation.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ArmatureData.lua b/meta/3rd/Cocos4.0/library/ccs/ArmatureData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ArmatureData.lua rename to meta/3rd/Cocos4.0/library/ccs/ArmatureData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ArmatureDataManager.lua b/meta/3rd/Cocos4.0/library/ccs/ArmatureDataManager.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ArmatureDataManager.lua rename to meta/3rd/Cocos4.0/library/ccs/ArmatureDataManager.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ArmatureDisplayData.lua b/meta/3rd/Cocos4.0/library/ccs/ArmatureDisplayData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ArmatureDisplayData.lua rename to meta/3rd/Cocos4.0/library/ccs/ArmatureDisplayData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.BaseData.lua b/meta/3rd/Cocos4.0/library/ccs/BaseData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.BaseData.lua rename to meta/3rd/Cocos4.0/library/ccs/BaseData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.BatchNode.lua b/meta/3rd/Cocos4.0/library/ccs/BatchNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.BatchNode.lua rename to meta/3rd/Cocos4.0/library/ccs/BatchNode.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.BlendFuncFrame.lua b/meta/3rd/Cocos4.0/library/ccs/BlendFuncFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.BlendFuncFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/BlendFuncFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.Bone.lua b/meta/3rd/Cocos4.0/library/ccs/Bone.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.Bone.lua rename to meta/3rd/Cocos4.0/library/ccs/Bone.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.BoneData.lua b/meta/3rd/Cocos4.0/library/ccs/BoneData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.BoneData.lua rename to meta/3rd/Cocos4.0/library/ccs/BoneData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.BoneNode.lua b/meta/3rd/Cocos4.0/library/ccs/BoneNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.BoneNode.lua rename to meta/3rd/Cocos4.0/library/ccs/BoneNode.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ColorFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ColorFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ColorFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ColorFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ComAttribute.lua b/meta/3rd/Cocos4.0/library/ccs/ComAttribute.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ComAttribute.lua rename to meta/3rd/Cocos4.0/library/ccs/ComAttribute.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ComAudio.lua b/meta/3rd/Cocos4.0/library/ccs/ComAudio.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ComAudio.lua rename to meta/3rd/Cocos4.0/library/ccs/ComAudio.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ComController.lua b/meta/3rd/Cocos4.0/library/ccs/ComController.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ComController.lua rename to meta/3rd/Cocos4.0/library/ccs/ComController.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ComExtensionData.lua b/meta/3rd/Cocos4.0/library/ccs/ComExtensionData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ComExtensionData.lua rename to meta/3rd/Cocos4.0/library/ccs/ComExtensionData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ComRender.lua b/meta/3rd/Cocos4.0/library/ccs/ComRender.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ComRender.lua rename to meta/3rd/Cocos4.0/library/ccs/ComRender.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ContourData.lua b/meta/3rd/Cocos4.0/library/ccs/ContourData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ContourData.lua rename to meta/3rd/Cocos4.0/library/ccs/ContourData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.DisplayData.lua b/meta/3rd/Cocos4.0/library/ccs/DisplayData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.DisplayData.lua rename to meta/3rd/Cocos4.0/library/ccs/DisplayData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.DisplayManager.lua b/meta/3rd/Cocos4.0/library/ccs/DisplayManager.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.DisplayManager.lua rename to meta/3rd/Cocos4.0/library/ccs/DisplayManager.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.EventFrame.lua b/meta/3rd/Cocos4.0/library/ccs/EventFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.EventFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/EventFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.Frame.lua b/meta/3rd/Cocos4.0/library/ccs/Frame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.Frame.lua rename to meta/3rd/Cocos4.0/library/ccs/Frame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.FrameData.lua b/meta/3rd/Cocos4.0/library/ccs/FrameData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.FrameData.lua rename to meta/3rd/Cocos4.0/library/ccs/FrameData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.GUIReader.lua b/meta/3rd/Cocos4.0/library/ccs/GUIReader.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.GUIReader.lua rename to meta/3rd/Cocos4.0/library/ccs/GUIReader.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.InnerActionFrame.lua b/meta/3rd/Cocos4.0/library/ccs/InnerActionFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.InnerActionFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/InnerActionFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.MovementBoneData.lua b/meta/3rd/Cocos4.0/library/ccs/MovementBoneData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.MovementBoneData.lua rename to meta/3rd/Cocos4.0/library/ccs/MovementBoneData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.MovementData.lua b/meta/3rd/Cocos4.0/library/ccs/MovementData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.MovementData.lua rename to meta/3rd/Cocos4.0/library/ccs/MovementData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ParticleDisplayData.lua b/meta/3rd/Cocos4.0/library/ccs/ParticleDisplayData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ParticleDisplayData.lua rename to meta/3rd/Cocos4.0/library/ccs/ParticleDisplayData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.PlayableFrame.lua b/meta/3rd/Cocos4.0/library/ccs/PlayableFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.PlayableFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/PlayableFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.PositionFrame.lua b/meta/3rd/Cocos4.0/library/ccs/PositionFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.PositionFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/PositionFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.RotationFrame.lua b/meta/3rd/Cocos4.0/library/ccs/RotationFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.RotationFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/RotationFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.RotationSkewFrame.lua b/meta/3rd/Cocos4.0/library/ccs/RotationSkewFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.RotationSkewFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/RotationSkewFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ScaleFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ScaleFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ScaleFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ScaleFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.SceneReader.lua b/meta/3rd/Cocos4.0/library/ccs/SceneReader.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.SceneReader.lua rename to meta/3rd/Cocos4.0/library/ccs/SceneReader.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.SkeletonNode.lua b/meta/3rd/Cocos4.0/library/ccs/SkeletonNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.SkeletonNode.lua rename to meta/3rd/Cocos4.0/library/ccs/SkeletonNode.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.SkewFrame.lua b/meta/3rd/Cocos4.0/library/ccs/SkewFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.SkewFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/SkewFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.Skin.lua b/meta/3rd/Cocos4.0/library/ccs/Skin.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.Skin.lua rename to meta/3rd/Cocos4.0/library/ccs/Skin.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.SpriteDisplayData.lua b/meta/3rd/Cocos4.0/library/ccs/SpriteDisplayData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.SpriteDisplayData.lua rename to meta/3rd/Cocos4.0/library/ccs/SpriteDisplayData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.TextureData.lua b/meta/3rd/Cocos4.0/library/ccs/TextureData.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.TextureData.lua rename to meta/3rd/Cocos4.0/library/ccs/TextureData.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.TextureFrame.lua b/meta/3rd/Cocos4.0/library/ccs/TextureFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.TextureFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/TextureFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.Timeline.lua b/meta/3rd/Cocos4.0/library/ccs/Timeline.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.Timeline.lua rename to meta/3rd/Cocos4.0/library/ccs/Timeline.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.Tween.lua b/meta/3rd/Cocos4.0/library/ccs/Tween.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.Tween.lua rename to meta/3rd/Cocos4.0/library/ccs/Tween.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.VisibleFrame.lua b/meta/3rd/Cocos4.0/library/ccs/VisibleFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.VisibleFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/VisibleFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccs.ZOrderFrame.lua b/meta/3rd/Cocos4.0/library/ccs/ZOrderFrame.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccs.ZOrderFrame.lua rename to meta/3rd/Cocos4.0/library/ccs/ZOrderFrame.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.AbstractCheckButton.lua b/meta/3rd/Cocos4.0/library/ccui/AbstractCheckButton.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.AbstractCheckButton.lua rename to meta/3rd/Cocos4.0/library/ccui/AbstractCheckButton.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.Button.lua b/meta/3rd/Cocos4.0/library/ccui/Button.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.Button.lua rename to meta/3rd/Cocos4.0/library/ccui/Button.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.CheckBox.lua b/meta/3rd/Cocos4.0/library/ccui/CheckBox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.CheckBox.lua rename to meta/3rd/Cocos4.0/library/ccui/CheckBox.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.EditBox.lua b/meta/3rd/Cocos4.0/library/ccui/EditBox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.EditBox.lua rename to meta/3rd/Cocos4.0/library/ccui/EditBox.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.HBox.lua b/meta/3rd/Cocos4.0/library/ccui/HBox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.HBox.lua rename to meta/3rd/Cocos4.0/library/ccui/HBox.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.Helper.lua b/meta/3rd/Cocos4.0/library/ccui/Helper.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.Helper.lua rename to meta/3rd/Cocos4.0/library/ccui/Helper.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.ImageView.lua b/meta/3rd/Cocos4.0/library/ccui/ImageView.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.ImageView.lua rename to meta/3rd/Cocos4.0/library/ccui/ImageView.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.Layout.lua b/meta/3rd/Cocos4.0/library/ccui/Layout.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.Layout.lua rename to meta/3rd/Cocos4.0/library/ccui/Layout.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.LayoutComponent.lua b/meta/3rd/Cocos4.0/library/ccui/LayoutComponent.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.LayoutComponent.lua rename to meta/3rd/Cocos4.0/library/ccui/LayoutComponent.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.LayoutParameter.lua b/meta/3rd/Cocos4.0/library/ccui/LayoutParameter.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.LayoutParameter.lua rename to meta/3rd/Cocos4.0/library/ccui/LayoutParameter.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.LinearLayoutParameter.lua b/meta/3rd/Cocos4.0/library/ccui/LinearLayoutParameter.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.LinearLayoutParameter.lua rename to meta/3rd/Cocos4.0/library/ccui/LinearLayoutParameter.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.ListView.lua b/meta/3rd/Cocos4.0/library/ccui/ListView.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.ListView.lua rename to meta/3rd/Cocos4.0/library/ccui/ListView.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.LoadingBar.lua b/meta/3rd/Cocos4.0/library/ccui/LoadingBar.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.LoadingBar.lua rename to meta/3rd/Cocos4.0/library/ccui/LoadingBar.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.PageView.lua b/meta/3rd/Cocos4.0/library/ccui/PageView.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.PageView.lua rename to meta/3rd/Cocos4.0/library/ccui/PageView.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RadioButton.lua b/meta/3rd/Cocos4.0/library/ccui/RadioButton.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RadioButton.lua rename to meta/3rd/Cocos4.0/library/ccui/RadioButton.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RadioButtonGroup.lua b/meta/3rd/Cocos4.0/library/ccui/RadioButtonGroup.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RadioButtonGroup.lua rename to meta/3rd/Cocos4.0/library/ccui/RadioButtonGroup.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RelativeBox.lua b/meta/3rd/Cocos4.0/library/ccui/RelativeBox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RelativeBox.lua rename to meta/3rd/Cocos4.0/library/ccui/RelativeBox.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RelativeLayoutParameter.lua b/meta/3rd/Cocos4.0/library/ccui/RelativeLayoutParameter.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RelativeLayoutParameter.lua rename to meta/3rd/Cocos4.0/library/ccui/RelativeLayoutParameter.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RichElement.lua b/meta/3rd/Cocos4.0/library/ccui/RichElement.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RichElement.lua rename to meta/3rd/Cocos4.0/library/ccui/RichElement.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RichElementCustomNode.lua b/meta/3rd/Cocos4.0/library/ccui/RichElementCustomNode.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RichElementCustomNode.lua rename to meta/3rd/Cocos4.0/library/ccui/RichElementCustomNode.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RichElementImage.lua b/meta/3rd/Cocos4.0/library/ccui/RichElementImage.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RichElementImage.lua rename to meta/3rd/Cocos4.0/library/ccui/RichElementImage.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RichElementNewLine.lua b/meta/3rd/Cocos4.0/library/ccui/RichElementNewLine.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RichElementNewLine.lua rename to meta/3rd/Cocos4.0/library/ccui/RichElementNewLine.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RichElementText.lua b/meta/3rd/Cocos4.0/library/ccui/RichElementText.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RichElementText.lua rename to meta/3rd/Cocos4.0/library/ccui/RichElementText.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.RichText.lua b/meta/3rd/Cocos4.0/library/ccui/RichText.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.RichText.lua rename to meta/3rd/Cocos4.0/library/ccui/RichText.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.Scale9Sprite.lua b/meta/3rd/Cocos4.0/library/ccui/Scale9Sprite.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.Scale9Sprite.lua rename to meta/3rd/Cocos4.0/library/ccui/Scale9Sprite.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.ScrollView.lua b/meta/3rd/Cocos4.0/library/ccui/ScrollView.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.ScrollView.lua rename to meta/3rd/Cocos4.0/library/ccui/ScrollView.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.Slider.lua b/meta/3rd/Cocos4.0/library/ccui/Slider.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.Slider.lua rename to meta/3rd/Cocos4.0/library/ccui/Slider.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.TabControl.lua b/meta/3rd/Cocos4.0/library/ccui/TabControl.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.TabControl.lua rename to meta/3rd/Cocos4.0/library/ccui/TabControl.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.TabHeader.lua b/meta/3rd/Cocos4.0/library/ccui/TabHeader.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.TabHeader.lua rename to meta/3rd/Cocos4.0/library/ccui/TabHeader.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.Text.lua b/meta/3rd/Cocos4.0/library/ccui/Text.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.Text.lua rename to meta/3rd/Cocos4.0/library/ccui/Text.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.TextAtlas.lua b/meta/3rd/Cocos4.0/library/ccui/TextAtlas.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.TextAtlas.lua rename to meta/3rd/Cocos4.0/library/ccui/TextAtlas.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.TextBMFont.lua b/meta/3rd/Cocos4.0/library/ccui/TextBMFont.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.TextBMFont.lua rename to meta/3rd/Cocos4.0/library/ccui/TextBMFont.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.TextField.lua b/meta/3rd/Cocos4.0/library/ccui/TextField.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.TextField.lua rename to meta/3rd/Cocos4.0/library/ccui/TextField.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.VBox.lua b/meta/3rd/Cocos4.0/library/ccui/VBox.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.VBox.lua rename to meta/3rd/Cocos4.0/library/ccui/VBox.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.VideoPlayer.lua b/meta/3rd/Cocos4.0/library/ccui/VideoPlayer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.VideoPlayer.lua rename to meta/3rd/Cocos4.0/library/ccui/VideoPlayer.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.WebView.lua b/meta/3rd/Cocos4.0/library/ccui/WebView.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.WebView.lua rename to meta/3rd/Cocos4.0/library/ccui/WebView.lua diff --git a/meta/3rd/Cocos4.0/library/ccui.Widget.lua b/meta/3rd/Cocos4.0/library/ccui/Widget.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/ccui.Widget.lua rename to meta/3rd/Cocos4.0/library/ccui/Widget.lua diff --git a/meta/3rd/Cocos4.0/library/sp.SkeletonAnimation.lua b/meta/3rd/Cocos4.0/library/sp/SkeletonAnimation.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/sp.SkeletonAnimation.lua rename to meta/3rd/Cocos4.0/library/sp/SkeletonAnimation.lua diff --git a/meta/3rd/Cocos4.0/library/sp.SkeletonRenderer.lua b/meta/3rd/Cocos4.0/library/sp/SkeletonRenderer.lua similarity index 100% rename from meta/3rd/Cocos4.0/library/sp.SkeletonRenderer.lua rename to meta/3rd/Cocos4.0/library/sp/SkeletonRenderer.lua diff --git a/meta/3rd/OpenResty/library/cjson.safe.lua b/meta/3rd/OpenResty/library/cjson/safe.lua similarity index 100% rename from meta/3rd/OpenResty/library/cjson.safe.lua rename to meta/3rd/OpenResty/library/cjson/safe.lua diff --git a/meta/3rd/OpenResty/library/ngx.balancer.lua b/meta/3rd/OpenResty/library/ngx/balancer.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.balancer.lua rename to meta/3rd/OpenResty/library/ngx/balancer.lua diff --git a/meta/3rd/OpenResty/library/ngx.base64.lua b/meta/3rd/OpenResty/library/ngx/base64.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.base64.lua rename to meta/3rd/OpenResty/library/ngx/base64.lua diff --git a/meta/3rd/OpenResty/library/ngx.errlog.lua b/meta/3rd/OpenResty/library/ngx/errlog.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.errlog.lua rename to meta/3rd/OpenResty/library/ngx/errlog.lua diff --git a/meta/3rd/OpenResty/library/ngx.ocsp.lua b/meta/3rd/OpenResty/library/ngx/ocsp.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.ocsp.lua rename to meta/3rd/OpenResty/library/ngx/ocsp.lua diff --git a/meta/3rd/OpenResty/library/ngx.pipe.lua b/meta/3rd/OpenResty/library/ngx/pipe.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.pipe.lua rename to meta/3rd/OpenResty/library/ngx/pipe.lua diff --git a/meta/3rd/OpenResty/library/ngx.process.lua b/meta/3rd/OpenResty/library/ngx/process.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.process.lua rename to meta/3rd/OpenResty/library/ngx/process.lua diff --git a/meta/3rd/OpenResty/library/ngx.re.lua b/meta/3rd/OpenResty/library/ngx/re.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.re.lua rename to meta/3rd/OpenResty/library/ngx/re.lua diff --git a/meta/3rd/OpenResty/library/ngx.req.lua b/meta/3rd/OpenResty/library/ngx/req.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.req.lua rename to meta/3rd/OpenResty/library/ngx/req.lua diff --git a/meta/3rd/OpenResty/library/ngx.resp.lua b/meta/3rd/OpenResty/library/ngx/resp.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.resp.lua rename to meta/3rd/OpenResty/library/ngx/resp.lua diff --git a/meta/3rd/OpenResty/library/ngx.semaphore.lua b/meta/3rd/OpenResty/library/ngx/semaphore.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.semaphore.lua rename to meta/3rd/OpenResty/library/ngx/semaphore.lua diff --git a/meta/3rd/OpenResty/library/ngx.ssl.lua b/meta/3rd/OpenResty/library/ngx/ssl.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.ssl.lua rename to meta/3rd/OpenResty/library/ngx/ssl.lua diff --git a/meta/3rd/OpenResty/library/ngx.ssl.clienthello.lua b/meta/3rd/OpenResty/library/ngx/ssl/clienthello.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.ssl.clienthello.lua rename to meta/3rd/OpenResty/library/ngx/ssl/clienthello.lua diff --git a/meta/3rd/OpenResty/library/ngx.ssl.session.lua b/meta/3rd/OpenResty/library/ngx/ssl/session.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.ssl.session.lua rename to meta/3rd/OpenResty/library/ngx/ssl/session.lua diff --git a/meta/3rd/OpenResty/library/ngx.upstream.lua b/meta/3rd/OpenResty/library/ngx/upstream.lua similarity index 100% rename from meta/3rd/OpenResty/library/ngx.upstream.lua rename to meta/3rd/OpenResty/library/ngx/upstream.lua diff --git a/meta/3rd/OpenResty/library/resty.aes.lua b/meta/3rd/OpenResty/library/resty/aes.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.aes.lua rename to meta/3rd/OpenResty/library/resty/aes.lua diff --git a/meta/3rd/OpenResty/library/resty.core.lua b/meta/3rd/OpenResty/library/resty/core.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.lua rename to meta/3rd/OpenResty/library/resty/core.lua diff --git a/meta/3rd/OpenResty/library/resty.core.base.lua b/meta/3rd/OpenResty/library/resty/core/base.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.base.lua rename to meta/3rd/OpenResty/library/resty/core/base.lua diff --git a/meta/3rd/OpenResty/library/resty.core.base64.lua b/meta/3rd/OpenResty/library/resty/core/base64.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.base64.lua rename to meta/3rd/OpenResty/library/resty/core/base64.lua diff --git a/meta/3rd/OpenResty/library/resty.core.ctx.lua b/meta/3rd/OpenResty/library/resty/core/ctx.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.ctx.lua rename to meta/3rd/OpenResty/library/resty/core/ctx.lua diff --git a/meta/3rd/OpenResty/library/resty.core.exit.lua b/meta/3rd/OpenResty/library/resty/core/exit.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.exit.lua rename to meta/3rd/OpenResty/library/resty/core/exit.lua diff --git a/meta/3rd/OpenResty/library/resty.core.hash.lua b/meta/3rd/OpenResty/library/resty/core/hash.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.hash.lua rename to meta/3rd/OpenResty/library/resty/core/hash.lua diff --git a/meta/3rd/OpenResty/library/resty.core.misc.lua b/meta/3rd/OpenResty/library/resty/core/misc.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.misc.lua rename to meta/3rd/OpenResty/library/resty/core/misc.lua diff --git a/meta/3rd/OpenResty/library/resty.core.ndk.lua b/meta/3rd/OpenResty/library/resty/core/ndk.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.ndk.lua rename to meta/3rd/OpenResty/library/resty/core/ndk.lua diff --git a/meta/3rd/OpenResty/library/resty.core.phase.lua b/meta/3rd/OpenResty/library/resty/core/phase.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.phase.lua rename to meta/3rd/OpenResty/library/resty/core/phase.lua diff --git a/meta/3rd/OpenResty/library/resty.core.regex.lua b/meta/3rd/OpenResty/library/resty/core/regex.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.regex.lua rename to meta/3rd/OpenResty/library/resty/core/regex.lua diff --git a/meta/3rd/OpenResty/library/resty.core.request.lua b/meta/3rd/OpenResty/library/resty/core/request.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.request.lua rename to meta/3rd/OpenResty/library/resty/core/request.lua diff --git a/meta/3rd/OpenResty/library/resty.core.response.lua b/meta/3rd/OpenResty/library/resty/core/response.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.response.lua rename to meta/3rd/OpenResty/library/resty/core/response.lua diff --git a/meta/3rd/OpenResty/library/resty.core.shdict.lua b/meta/3rd/OpenResty/library/resty/core/shdict.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.shdict.lua rename to meta/3rd/OpenResty/library/resty/core/shdict.lua diff --git a/meta/3rd/OpenResty/library/resty.core.time.lua b/meta/3rd/OpenResty/library/resty/core/time.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.time.lua rename to meta/3rd/OpenResty/library/resty/core/time.lua diff --git a/meta/3rd/OpenResty/library/resty.core.uri.lua b/meta/3rd/OpenResty/library/resty/core/uri.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.uri.lua rename to meta/3rd/OpenResty/library/resty/core/uri.lua diff --git a/meta/3rd/OpenResty/library/resty.core.utils.lua b/meta/3rd/OpenResty/library/resty/core/utils.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.utils.lua rename to meta/3rd/OpenResty/library/resty/core/utils.lua diff --git a/meta/3rd/OpenResty/library/resty.core.var.lua b/meta/3rd/OpenResty/library/resty/core/var.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.var.lua rename to meta/3rd/OpenResty/library/resty/core/var.lua diff --git a/meta/3rd/OpenResty/library/resty.core.worker.lua b/meta/3rd/OpenResty/library/resty/core/worker.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.core.worker.lua rename to meta/3rd/OpenResty/library/resty/core/worker.lua diff --git a/meta/3rd/OpenResty/library/resty.dns.resolver.lua b/meta/3rd/OpenResty/library/resty/dns/resolver.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.dns.resolver.lua rename to meta/3rd/OpenResty/library/resty/dns/resolver.lua diff --git a/meta/3rd/OpenResty/library/resty.limit.conn.lua b/meta/3rd/OpenResty/library/resty/limit/conn.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.limit.conn.lua rename to meta/3rd/OpenResty/library/resty/limit/conn.lua diff --git a/meta/3rd/OpenResty/library/resty.limit.count.lua b/meta/3rd/OpenResty/library/resty/limit/count.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.limit.count.lua rename to meta/3rd/OpenResty/library/resty/limit/count.lua diff --git a/meta/3rd/OpenResty/library/resty.limit.req.lua b/meta/3rd/OpenResty/library/resty/limit/req.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.limit.req.lua rename to meta/3rd/OpenResty/library/resty/limit/req.lua diff --git a/meta/3rd/OpenResty/library/resty.limit.traffic.lua b/meta/3rd/OpenResty/library/resty/limit/traffic.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.limit.traffic.lua rename to meta/3rd/OpenResty/library/resty/limit/traffic.lua diff --git a/meta/3rd/OpenResty/library/resty.lock.lua b/meta/3rd/OpenResty/library/resty/lock.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.lock.lua rename to meta/3rd/OpenResty/library/resty/lock.lua diff --git a/meta/3rd/OpenResty/library/resty.lrucache.lua b/meta/3rd/OpenResty/library/resty/lrucache.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.lrucache.lua rename to meta/3rd/OpenResty/library/resty/lrucache.lua diff --git a/meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua b/meta/3rd/OpenResty/library/resty/lrucache/pureffi.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua rename to meta/3rd/OpenResty/library/resty/lrucache/pureffi.lua diff --git a/meta/3rd/OpenResty/library/resty.md5.lua b/meta/3rd/OpenResty/library/resty/md5.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.md5.lua rename to meta/3rd/OpenResty/library/resty/md5.lua diff --git a/meta/3rd/OpenResty/library/resty.memcached.lua b/meta/3rd/OpenResty/library/resty/memcached.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.memcached.lua rename to meta/3rd/OpenResty/library/resty/memcached.lua diff --git a/meta/3rd/OpenResty/library/resty.mysql.lua b/meta/3rd/OpenResty/library/resty/mysql.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.mysql.lua rename to meta/3rd/OpenResty/library/resty/mysql.lua diff --git a/meta/3rd/OpenResty/library/resty.random.lua b/meta/3rd/OpenResty/library/resty/random.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.random.lua rename to meta/3rd/OpenResty/library/resty/random.lua diff --git a/meta/3rd/OpenResty/library/resty.redis.lua b/meta/3rd/OpenResty/library/resty/redis.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.redis.lua rename to meta/3rd/OpenResty/library/resty/redis.lua diff --git a/meta/3rd/OpenResty/library/resty.sha.lua b/meta/3rd/OpenResty/library/resty/sha.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.sha.lua rename to meta/3rd/OpenResty/library/resty/sha.lua diff --git a/meta/3rd/OpenResty/library/resty.sha1.lua b/meta/3rd/OpenResty/library/resty/sha1.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.sha1.lua rename to meta/3rd/OpenResty/library/resty/sha1.lua diff --git a/meta/3rd/OpenResty/library/resty.sha224.lua b/meta/3rd/OpenResty/library/resty/sha224.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.sha224.lua rename to meta/3rd/OpenResty/library/resty/sha224.lua diff --git a/meta/3rd/OpenResty/library/resty.sha256.lua b/meta/3rd/OpenResty/library/resty/sha256.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.sha256.lua rename to meta/3rd/OpenResty/library/resty/sha256.lua diff --git a/meta/3rd/OpenResty/library/resty.sha384.lua b/meta/3rd/OpenResty/library/resty/sha384.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.sha384.lua rename to meta/3rd/OpenResty/library/resty/sha384.lua diff --git a/meta/3rd/OpenResty/library/resty.sha512.lua b/meta/3rd/OpenResty/library/resty/sha512.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.sha512.lua rename to meta/3rd/OpenResty/library/resty/sha512.lua diff --git a/meta/3rd/OpenResty/library/resty.shell.lua b/meta/3rd/OpenResty/library/resty/shell.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.shell.lua rename to meta/3rd/OpenResty/library/resty/shell.lua diff --git a/meta/3rd/OpenResty/library/resty.signal.lua b/meta/3rd/OpenResty/library/resty/signal.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.signal.lua rename to meta/3rd/OpenResty/library/resty/signal.lua diff --git a/meta/3rd/OpenResty/library/resty.string.lua b/meta/3rd/OpenResty/library/resty/string.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.string.lua rename to meta/3rd/OpenResty/library/resty/string.lua diff --git a/meta/3rd/OpenResty/library/resty.upload.lua b/meta/3rd/OpenResty/library/resty/upload.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.upload.lua rename to meta/3rd/OpenResty/library/resty/upload.lua diff --git a/meta/3rd/OpenResty/library/resty.upstream.healthcheck.lua b/meta/3rd/OpenResty/library/resty/upstream/healthcheck.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.upstream.healthcheck.lua rename to meta/3rd/OpenResty/library/resty/upstream/healthcheck.lua diff --git a/meta/3rd/OpenResty/library/resty.websocket.client.lua b/meta/3rd/OpenResty/library/resty/websocket/client.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.websocket.client.lua rename to meta/3rd/OpenResty/library/resty/websocket/client.lua diff --git a/meta/3rd/OpenResty/library/resty.websocket.protocol.lua b/meta/3rd/OpenResty/library/resty/websocket/protocol.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.websocket.protocol.lua rename to meta/3rd/OpenResty/library/resty/websocket/protocol.lua diff --git a/meta/3rd/OpenResty/library/resty.websocket.server.lua b/meta/3rd/OpenResty/library/resty/websocket/server.lua similarity index 100% rename from meta/3rd/OpenResty/library/resty.websocket.server.lua rename to meta/3rd/OpenResty/library/resty/websocket/server.lua diff --git a/meta/3rd/OpenResty/library/string.buffer.lua b/meta/3rd/OpenResty/library/string/buffer.lua similarity index 100% rename from meta/3rd/OpenResty/library/string.buffer.lua rename to meta/3rd/OpenResty/library/string/buffer.lua diff --git a/meta/3rd/OpenResty/library/table.clone.lua b/meta/3rd/OpenResty/library/table/clone.lua similarity index 100% rename from meta/3rd/OpenResty/library/table.clone.lua rename to meta/3rd/OpenResty/library/table/clone.lua diff --git a/meta/3rd/OpenResty/library/table.isarray.lua b/meta/3rd/OpenResty/library/table/isarray.lua similarity index 100% rename from meta/3rd/OpenResty/library/table.isarray.lua rename to meta/3rd/OpenResty/library/table/isarray.lua diff --git a/meta/3rd/OpenResty/library/table.isempty.lua b/meta/3rd/OpenResty/library/table/isempty.lua similarity index 100% rename from meta/3rd/OpenResty/library/table.isempty.lua rename to meta/3rd/OpenResty/library/table/isempty.lua diff --git a/meta/3rd/OpenResty/library/table.nkeys.lua b/meta/3rd/OpenResty/library/table/nkeys.lua similarity index 100% rename from meta/3rd/OpenResty/library/table.nkeys.lua rename to meta/3rd/OpenResty/library/table/nkeys.lua diff --git a/meta/3rd/OpenResty/library/thread.exdata.lua b/meta/3rd/OpenResty/library/thread/exdata.lua similarity index 100% rename from meta/3rd/OpenResty/library/thread.exdata.lua rename to meta/3rd/OpenResty/library/thread/exdata.lua diff --git a/meta/3rd/OpenResty/library/thread.exdata2.lua b/meta/3rd/OpenResty/library/thread/exdata2.lua similarity index 100% rename from meta/3rd/OpenResty/library/thread.exdata2.lua rename to meta/3rd/OpenResty/library/thread/exdata2.lua diff --git a/script/fs-utility.lua b/script/fs-utility.lua index b789177c8..46e411711 100644 --- a/script/fs-utility.lua +++ b/script/fs-utility.lua @@ -620,6 +620,8 @@ function m.fileSync(source, target, option) return option end +---@param dir fs.path +---@param callback fun(fullPath: fs.path) function m.scanDirectory(dir, callback) for fullpath in fs.pairs(dir) do local status = fs.symlink_status(fullpath):type() diff --git a/script/meta/bee/filesystem.lua b/script/meta/bee/filesystem.lua index f6cdff793..cba5ff0e7 100644 --- a/script/meta/bee/filesystem.lua +++ b/script/meta/bee/filesystem.lua @@ -18,6 +18,10 @@ end function fsPath:filename() end +---@return fs.path +function fsPath:stem() +end + ---@class fs.status local fsStatus = {} @@ -88,4 +92,9 @@ end function fs.copy_file(source, target, options) end +---@param oldPath fs.path +---@param newPath fs.path +function fs.rename(oldPath, newPath) +end + return fs diff --git a/tools/build-3rd-meta.lua b/tools/build-3rd-meta.lua index ab6b683e4..38f693901 100644 --- a/tools/build-3rd-meta.lua +++ b/tools/build-3rd-meta.lua @@ -2,3 +2,4 @@ package.path = package.path .. ';script/?.lua;tools/?.lua' dofile 'tools/love-api.lua' dofile 'tools/lovr-api.lua' +dofile 'tools/normalize-3rd-path.lua' diff --git a/tools/normalize-3rd-path.lua b/tools/normalize-3rd-path.lua new file mode 100644 index 000000000..9a9194cf9 --- /dev/null +++ b/tools/normalize-3rd-path.lua @@ -0,0 +1,17 @@ +local fs = require 'bee.filesystem' +local fsu = require 'fs-utility' + +local thirdPath = fs.path 'meta/3rd' + +for dir in fs.pairs(thirdPath) do + local libraryPath = dir / 'library' + if fs.is_directory(libraryPath) then + fsu.scanDirectory(libraryPath, function (fullPath) + if fullPath:stem():string():find '%.' then + local newPath = fullPath:parent_path() / (fullPath:stem():string():gsub('%.', '/') .. '.lua') + fs.create_directories(newPath:parent_path()) + fs.rename(fullPath, newPath) + end + end) + end +end From 502b846eaa21ff518e8d07ab9af832916a326827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 02:26:47 +0800 Subject: [PATCH 018/965] add doc --- script/meta/bee/filesystem.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/meta/bee/filesystem.lua b/script/meta/bee/filesystem.lua index cba5ff0e7..717e62b26 100644 --- a/script/meta/bee/filesystem.lua +++ b/script/meta/bee/filesystem.lua @@ -22,6 +22,10 @@ end function fsPath:stem() end +---@return fs.path +function fsPath:extension() +end + ---@class fs.status local fsStatus = {} From 192656e11474177782202203d68a7db46df4a342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 03:02:43 +0800 Subject: [PATCH 019/965] cleanup --- script/parser/luadoc.lua | 64 +++++++++++++++++++++------------------- test/hover/init.lua | 10 +++++++ 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 51161565d..ea6d76549 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1629,6 +1629,14 @@ local function bindGeneric(binded) end end +local function bindDocWithSource(doc, source) + if not source.bindDocs then + source.bindDocs = {} + end + source.bindDocs[#source.bindDocs+1] = doc + doc.bindSource = source +end + local function bindDoc(source, binded) local isParam = source.type == 'self' or source.type == 'local' @@ -1651,6 +1659,8 @@ local function bindDoc(source, binded) or isParam then goto CONTINUE end + bindDocWithSource(doc, source) + ok = true elseif doc.type == 'doc.type' then if source.type == 'function' or isParam @@ -1658,6 +1668,8 @@ local function bindDoc(source, binded) goto CONTINUE end source._bindedDocType = true + bindDocWithSource(doc, source) + ok = true elseif doc.type == 'doc.overload' then if not source.bindDocs then source.bindDocs = {} @@ -1666,61 +1678,53 @@ local function bindDoc(source, binded) if source.type ~= 'function' then doc.bindSource = source end + bindDocWithSource(doc, source) + ok = true elseif doc.type == 'doc.param' then - local suc if isParam and doc.param[1] == source[1] then - suc = true + bindDocWithSource(doc, source) + ok = true elseif source.type == '...' and doc.param[1] == '...' then - suc = true + bindDocWithSource(doc, source) + ok = true elseif source.type == 'self' and doc.param[1] == 'self' then - suc = true - end - if source.type == 'function' then + bindDocWithSource(doc, source) + ok = true + elseif source.type == 'function' then if not source.bindDocs then source.bindDocs = {} end source.bindDocs[#source.bindDocs+1] = doc end - - if not suc then - goto CONTINUE - end elseif doc.type == 'doc.vararg' then - if source.type ~= '...' then - goto CONTINUE + if source.type == '...' then + bindDocWithSource(doc, source) + ok = true end elseif doc.type == 'doc.return' or doc.type == 'doc.generic' or doc.type == 'doc.async' or doc.type == 'doc.nodiscard' then - if source.type ~= 'function' then - goto CONTINUE + if source.type == 'function' then + bindDocWithSource(doc, source) + ok = true end elseif doc.type == 'doc.enum' then if source.type == 'table' then - goto OK + bindDocWithSource(doc, source) + ok = true end if source.value and source.value.type == 'table' then - if not source.value.bindDocs then - source.value.bindDocs = {} - end - source.value.bindDocs[#source.value.bindDocs+1] = doc - doc.bindSource = source.value + bindDocWithSource(doc, source.value) + goto CONTINUE end - goto CONTINUE - elseif doc.type ~= 'doc.comment' then - goto CONTINUE - end - ::OK:: - if not source.bindDocs then - source.bindDocs = {} + elseif doc.type == 'doc.comment' then + bindDocWithSource(doc, source) + ok = true end - source.bindDocs[#source.bindDocs+1] = doc - doc.bindSource = source - ok = true ::CONTINUE:: end return ok diff --git a/test/hover/init.lua b/test/hover/init.lua index e720ffc20..6a4b53995 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -2136,3 +2136,13 @@ function test2() 2. integer 3. integer ]] + +do return end +TEST [[ +---@param x number +---@return boolean +local function ( + x +) +end +]] From c273b04b9a6fe9601036d4401fb020238a1acc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 03:41:36 +0800 Subject: [PATCH 020/965] fix --- script/vm/compiler.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index c973ab8e3..7fc4f57b0 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -373,9 +373,10 @@ function vm.getClassFields(suri, object, key, ref, pushResult) local fieldKey = guide.getKeyName(field) if fieldKey and not searchedFields[fieldKey] then if not searchedFields[fieldKey] - and guide.isSet(field) - and guide.isLiteral(field.value) then - hasFounded[fieldKey] = true + and guide.isSet(field) then + if guide.isLiteral(field.value) then + hasFounded[fieldKey] = true + end pushResult(field, true) end end From c62b62ee0c0fb980d96089d546388efd70fc6ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 03:45:38 +0800 Subject: [PATCH 021/965] fix #1446 --- changelog.md | 1 + script/parser/luadoc.lua | 10 +++++++++- test/hover/init.lua | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 13153b60d..147946f4a 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ * `FIX` [#1428](https://github.com/sumneko/lua-language-server/issues/1428) * `FIX` [#1430](https://github.com/sumneko/lua-language-server/issues/1430) * `FIX` [#1431](https://github.com/sumneko/lua-language-server/issues/1431) +* `FIX` [#1446](https://github.com/sumneko/lua-language-server/issues/1446) ## 3.5.2 `2022-8-1` diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index ea6d76549..4393e23d4 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1697,7 +1697,15 @@ local function bindDoc(source, binded) if not source.bindDocs then source.bindDocs = {} end - source.bindDocs[#source.bindDocs+1] = doc + source.bindDocs[#source.bindDocs + 1] = doc + if source.args then + for _, arg in ipairs(source.args) do + if arg[1] == doc.param[1] then + bindDocWithSource(doc, arg) + break + end + end + end end elseif doc.type == 'doc.vararg' then if source.type == '...' then diff --git a/test/hover/init.lua b/test/hover/init.lua index 6a4b53995..6d58f0517 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -2137,7 +2137,6 @@ function test2() 3. integer ]] -do return end TEST [[ ---@param x number ---@return boolean From 30ee7c0e30eb5dcc2ec82514343b107d1b201200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 03:50:55 +0800 Subject: [PATCH 022/965] fix #1451 --- changelog.md | 1 + script/core/completion/completion.lua | 2 +- script/vm/global.lua | 5 +++++ test/completion/common.lua | 31 +++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 147946f4a..5dea68059 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,7 @@ * `FIX` [#1430](https://github.com/sumneko/lua-language-server/issues/1430) * `FIX` [#1431](https://github.com/sumneko/lua-language-server/issues/1431) * `FIX` [#1446](https://github.com/sumneko/lua-language-server/issues/1446) +* `FIX` [#1451](https://github.com/sumneko/lua-language-server/issues/1451) ## 3.5.2 `2022-8-1` diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 8f28e450a..149e073bb 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -1135,7 +1135,7 @@ local function insertDocEnum(state, pos, doc, enums) local parent = tbl.parent local parentName if parent._globalNode then - parentName = parent._globalNode:getName() + parentName = parent._globalNode:getCodeName() else local locals = guide.getVisibleLocals(state.ast, pos) for _, loc in pairs(locals) do diff --git a/script/vm/global.lua b/script/vm/global.lua index 22235681c..3a045b227 100644 --- a/script/vm/global.lua +++ b/script/vm/global.lua @@ -103,6 +103,11 @@ function mt:getName() return self.name end +---@return string +function mt:getCodeName() + return (self.name:gsub(vm.ID_SPLITE, '.')) +end + ---@return string function mt:asKeyName() return self.cate .. '|' .. self.name diff --git a/test/completion/common.lua b/test/completion/common.lua index f1100e366..1d7d414c5 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -3698,6 +3698,37 @@ f() }, } +TEST [[ +---@enum A +ppp.fff = { + x = 1, + y = 'ss', +} + +---@param x A +local function f(x) end + +f() +]] +{ + { + label = 'ppp.fff.x', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = 'ppp.fff.y', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = '1', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = '"ss"', + kind = define.CompletionItemKind.EnumMember, + }, +} + TEST [[ -- From 680ffb800e7fa8f16241407cfb83de0ff38aa0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 03:53:35 +0800 Subject: [PATCH 023/965] fix #1461 --- changelog.md | 1 + meta/template/coroutine.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 5dea68059..7b1dcf6d7 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,7 @@ * `FIX` [#1431](https://github.com/sumneko/lua-language-server/issues/1431) * `FIX` [#1446](https://github.com/sumneko/lua-language-server/issues/1446) * `FIX` [#1451](https://github.com/sumneko/lua-language-server/issues/1451) +* `FIX` [#1461](https://github.com/sumneko/lua-language-server/issues/1461) ## 3.5.2 `2022-8-1` diff --git a/meta/template/coroutine.lua b/meta/template/coroutine.lua index 0b07bf5cb..f93928318 100644 --- a/meta/template/coroutine.lua +++ b/meta/template/coroutine.lua @@ -56,7 +56,7 @@ function coroutine.status(co) end ---#DES 'coroutine.wrap' ---@param f async fun() ----@return fun() +---@return fun(...):... ---@nodiscard function coroutine.wrap(f) end From 6c82c0f9f83d364fd8965e1c13a3b57aa67f5520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 04:26:14 +0800 Subject: [PATCH 024/965] fix #1463 --- changelog.md | 1 + script/vm/type.lua | 19 +++++++++++++++++++ test/diagnostics/type-check.lua | 9 +++++++++ test/type_inference/init.lua | 10 ++++++++++ 4 files changed, 39 insertions(+) diff --git a/changelog.md b/changelog.md index 7b1dcf6d7..05683c05d 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,7 @@ * `FIX` [#1446](https://github.com/sumneko/lua-language-server/issues/1446) * `FIX` [#1451](https://github.com/sumneko/lua-language-server/issues/1451) * `FIX` [#1461](https://github.com/sumneko/lua-language-server/issues/1461) +* `FIX` [#1463](https://github.com/sumneko/lua-language-server/issues/1463) ## 3.5.2 `2022-8-1` diff --git a/script/vm/type.lua b/script/vm/type.lua index d112be2c9..be3eff987 100644 --- a/script/vm/type.lua +++ b/script/vm/type.lua @@ -252,6 +252,17 @@ function vm.isSubType(uri, child, parent, mark) return false end +---@param node string|vm.node|vm.object +function vm.isUnknown(node) + if type(node) == 'string' then + return node == 'unknown' + end + if node.type == 'vm.node' then + return not node:hasKnownType() + end + return false +end + ---@param uri uri ---@param tnode vm.node ---@param knode vm.node|string @@ -280,6 +291,9 @@ function vm.getTableValue(uri, tnode, knode, inversion) result:merge(vm.compileNode(tn.node)) end if tn.type == 'table' then + if vm.isUnknown(knode) then + goto CONTINUE + end for _, field in ipairs(tn) do if field.type == 'tableindex' and field.value then @@ -315,6 +329,7 @@ function vm.getTableValue(uri, tnode, knode, inversion) end end end + ::CONTINUE:: end if result:isEmpty() then return nil @@ -350,6 +365,9 @@ function vm.getTableKey(uri, tnode, vnode, reverse) result:merge(vm.declareGlobal('type', 'integer')) end if tn.type == 'table' then + if vm.isUnknown(tnode) then + goto CONTINUE + end for _, field in ipairs(tn) do if field.type == 'tableindex' then if field.index then @@ -364,6 +382,7 @@ function vm.getTableKey(uri, tnode, vnode, reverse) end end end + ::CONTINUE:: end if result:isEmpty() then return nil diff --git a/test/diagnostics/type-check.lua b/test/diagnostics/type-check.lua index 3aeca5d5a..383527c2f 100644 --- a/test/diagnostics/type-check.lua +++ b/test/diagnostics/type-check.lua @@ -775,6 +775,15 @@ f(1) f() ]] +TEST [[ +local t = { + x = 1, +} + +local x +t[x] = true +]] + config.remove(nil, 'Lua.diagnostics.disable', 'unused-local') config.remove(nil, 'Lua.diagnostics.disable', 'unused-function') config.remove(nil, 'Lua.diagnostics.disable', 'undefined-global') diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 8c18bfb50..03b3a8aeb 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3773,3 +3773,13 @@ t.x = t.x print(t.) ]] + +TEST 'unknown' [[ +local t = { + x = 1, +} + +local x + +local = t[x] +]] From dacf711d57cddbf106937abd64f544a9298f3349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 13 Aug 2022 04:34:49 +0800 Subject: [PATCH 025/965] 3.5.3 --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 05683c05d..f02640b05 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 3.5.3 +`2022-8-13` * `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409) * `FIX` [#1422](https://github.com/sumneko/lua-language-server/issues/1422) * `FIX` [#1425](https://github.com/sumneko/lua-language-server/issues/1425) From 5e099fc732c6fc65496e57fb2ebacd03317d8e70 Mon Sep 17 00:00:00 2001 From: fesily Date: Sat, 13 Aug 2022 14:06:33 +0800 Subject: [PATCH 026/965] fix init buildin meta error --- script/fs-utility.lua | 1 + script/library.lua | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/script/fs-utility.lua b/script/fs-utility.lua index 46e411711..b57c15bbb 100644 --- a/script/fs-utility.lua +++ b/script/fs-utility.lua @@ -254,6 +254,7 @@ function dfs:saveFile(path, text) return false, '无法打开:' .. path end dir[filename] = text + return true end ---@param path string|fs.path diff --git a/script/library.lua b/script/library.lua index 57aac066f..208b10edb 100644 --- a/script/library.lua +++ b/script/library.lua @@ -243,14 +243,25 @@ local function initBuiltIn(uri) if status == 'disable' then goto CONTINUE end - libName = libName .. '.lua' + ---@type fs.path - local libPath = templateDir / libName + local libPath = templateDir / (libName .. '.lua') local metaDoc = compileSingleMetaDoc(uri, fsu.loadFile(libPath), metaLang, status) if metaDoc then metaDoc = encoder.encode(encoding, metaDoc, 'auto') - out:saveFile(libName, metaDoc) - local outputPath = metaPath / libName + + local outputLibName = libName:gsub('%.', '/') .. '.lua' + if outputLibName ~= libName then + out:createDirectories(fs.path(outputLibName):parent_path()) + end + + local ok, err = out:saveFile(outputLibName, metaDoc) + if not ok then + log.debug("Save Meta File:", err) + goto CONTINUE + end + + local outputPath = metaPath / outputLibName m.metaPaths[outputPath:string()] = true log.debug('Meta path:', outputPath:string()) end From e0d3fc827071e6cce8e92b2a8c8fe5b706d1e987 Mon Sep 17 00:00:00 2001 From: fesily Date: Sat, 13 Aug 2022 14:25:05 +0800 Subject: [PATCH 027/965] move string.buffer to buildin --- .../string/buffer.lua => template/string.buffer.lua} | 10 ++++++---- script/proto/define.lua | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) rename meta/{3rd/OpenResty/library/string/buffer.lua => template/string.buffer.lua} (99%) diff --git a/meta/3rd/OpenResty/library/string/buffer.lua b/meta/template/string.buffer.lua similarity index 99% rename from meta/3rd/OpenResty/library/string/buffer.lua rename to meta/template/string.buffer.lua index 70ecc6d8e..ee57a1ad7 100644 --- a/meta/3rd/OpenResty/library/string/buffer.lua +++ b/meta/template/string.buffer.lua @@ -1,6 +1,7 @@ +---#if not JIT then DISABLE() end ---@meta - +---@version JIT --- The string buffer library allows high-performance manipulation of string-like data. --- --- Unlike Lua strings, which are constants, string buffers are mutable sequences of 8-bit (binary-transparent) characters. Data can be stored, formatted and encoded into a string buffer and later converted, extracted or decoded. @@ -10,7 +11,7 @@ --- The string buffer libary also includes a high-performance serializer for Lua objects. --- --- ----## Streaming Serialization +--- ## Streaming Serialization --- --- In some contexts, it's desirable to do piecewise serialization of large datasets, also known as streaming. --- @@ -88,7 +89,7 @@ --- 0x1fe0.. → 0xff n.I --- ``` --- ----## Error handling +--- ## Error handling --- --- Many of the buffer methods can throw an error. Out-of-memory or usage errors are best caught with an outer wrapper for larger parts of code. There's not much one can do after that, anyway. --- @@ -101,7 +102,7 @@ --- end --- ``` --- ----## FFI caveats +--- ## FFI caveats --- --- The string buffer library has been designed to work well together with the FFI library. But due to the low-level nature of the FFI library, some care needs to be taken: --- @@ -126,6 +127,7 @@ local buffer = {} --- --- The maximum size of a single buffer is the same as the maximum size of a Lua string, which is slightly below two gigabytes. For huge data sizes, neither strings nor buffers are the right data structure — use the FFI library to directly map memory or files up to the virtual memory limit of your OS. --- +---@version JIT ---@class string.buffer : table local buf = {} diff --git a/script/proto/define.lua b/script/proto/define.lua index ecdaf3065..75843455b 100644 --- a/script/proto/define.lua +++ b/script/proto/define.lua @@ -182,6 +182,7 @@ m.BuiltIn = { ['table.new'] = 'default', ['table.clear'] = 'default', ['utf8'] = 'default', + ['string.buffer']='default', } m.InlayHintKind = { From 870cc7105a7f0ac070c8fe883126506aaf00b266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 15 Aug 2022 20:01:52 +0800 Subject: [PATCH 028/965] fix runtime error --- script/vm/compiler.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 7fc4f57b0..1efe8abbd 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -373,7 +373,8 @@ function vm.getClassFields(suri, object, key, ref, pushResult) local fieldKey = guide.getKeyName(field) if fieldKey and not searchedFields[fieldKey] then if not searchedFields[fieldKey] - and guide.isSet(field) then + and guide.isSet(field) + and field.value then if guide.isLiteral(field.value) then hasFounded[fieldKey] = true end From 8dd1a935c4b1f56d813ce494e8ebf6a87af6435a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 15 Aug 2022 20:02:02 +0800 Subject: [PATCH 029/965] update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index e89f5c460..780f38954 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit e89f5c4608c411d602a0dcdf24159809e715859b +Subproject commit 780f38954b0a0c95cf09b273df3683b6a34eef9b From b5a3cdd62312a42b7694a64a69caf1b7e0479dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 15 Aug 2022 20:34:38 +0800 Subject: [PATCH 030/965] update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/lovr-api | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 780f38954..2265c0a5c 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 780f38954b0a0c95cf09b273df3683b6a34eef9b +Subproject commit 2265c0a5c472298c34e05c1f15745bf20f1cc950 diff --git a/3rd/lovr-api b/3rd/lovr-api index deccaa8f5..987aa3d73 160000 --- a/3rd/lovr-api +++ b/3rd/lovr-api @@ -1 +1 @@ -Subproject commit deccaa8f594a25c1bfb1ae8d24466db70da099d7 +Subproject commit 987aa3d73ea477f74bc8ed3e396414c7e96e75fb From d24177c7de9fdd8809274ce3f64045e5030e1286 Mon Sep 17 00:00:00 2001 From: Yuqi Huang Date: Tue, 16 Aug 2022 11:03:05 +0800 Subject: [PATCH 031/965] fix inappropriate definition of utf8.offset The third parameter of utf8.offset is optional according to Lua Reference Manual. --- meta/template/utf8.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/template/utf8.lua b/meta/template/utf8.lua index 1797a5e84..cccee99af 100644 --- a/meta/template/utf8.lua +++ b/meta/template/utf8.lua @@ -70,7 +70,7 @@ function utf8.len(s, i, j, lax) end ---#DES 'utf8.offset' ---@param s string ---@param n integer ----@param i integer +---@param i? integer ---@return integer p ---@nodiscard function utf8.offset(s, n, i) end From 7b54f3c2e1a855d5345fcc226f1138c202a80106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 01:04:19 +0800 Subject: [PATCH 032/965] experiment --- script/files.lua | 30 +++-- script/global.d.lua | 3 + script/lazytable.lua | 233 +++++++++++++++++++++++++++++++++++++ script/service/service.lua | 3 + 4 files changed, 261 insertions(+), 8 deletions(-) create mode 100644 script/lazytable.lua diff --git a/script/files.lua b/script/files.lua index 91bbe5706..f1c887703 100644 --- a/script/files.lua +++ b/script/files.lua @@ -13,6 +13,7 @@ local smerger = require 'string-merger' local progress = require "progress" local encoder = require 'encoder' local scope = require 'workspace.scope' +local lazy = require 'lazytable' ---@class file ---@field uri uri @@ -517,21 +518,34 @@ function m.compileState(uri, text) state.uri = uri state.lua = text state.ast.uri = uri + local clock = os.clock() parser.luadoc(state) local passed = os.clock() - clock if passed > 0.1 then log.warn(('Parse LuaDoc of [%s] takes [%.3f] sec, size [%.3f] kb.'):format(uri, passed, #text / 1000)) end - m.astCount = m.astCount + 1 - local removed - setmetatable(state, {__gc = function () - if removed then - return + + if LAZY and not m.fileMap[uri].trusted then + local clock = os.clock() + state.pushError = nil + state = lazy.build(state) + local passed = os.clock() - clock + if passed > 0.1 then + log.warn(('Convert lazy-table for [%s] takes [%.3f] sec, size [%.3f] kb.'):format(uri, passed, #text / 1000)) end - removed = true - m.astCount = m.astCount - 1 - end}) + else + m.astCount = m.astCount + 1 + local removed + setmetatable(state, {__gc = function () + if removed then + return + end + removed = true + m.astCount = m.astCount - 1 + end}) + end + return state else log.error('Compile failed:', uri, err) diff --git a/script/global.d.lua b/script/global.d.lua index 56f3019f8..f794ff323 100644 --- a/script/global.d.lua +++ b/script/global.d.lua @@ -49,3 +49,6 @@ CHECKLEVEL = 'Warning' ---@type 'trace' | 'debug' | 'info' | 'warn' | 'error' LOGLEVEL = 'warn' + +---@type boolean +LAZY = false diff --git a/script/lazytable.lua b/script/lazytable.lua new file mode 100644 index 000000000..49e1cc0f2 --- /dev/null +++ b/script/lazytable.lua @@ -0,0 +1,233 @@ +---@class lazytable.builder +---@field codeMap table +---@field unpackMark table +---@field keyMap table +---@field keyDual table +local mt = {} +mt.__index = mt +mt.tableID = 1 +mt.keyID = 1 + +---@param k string|integer +---@return string +function mt:formatKey(k) + if not self.keyDual[k] then + local id = self.keyID + self.keyID = self.keyID + 1 + self.keyDual[k] = id + self.keyMap[id] = k + end + return string.format('[%d]', self.keyDual[k]) +end + +---@param v string|number|boolean +function mt:formatValue(v) + if type(v) == 'string' then + return ('%q'):format(v) + end + if type(v) == 'number' then + if math.type(v) == 'integer' then + local n10 = ('%d'):format(v) + local n16 = ('0x%X'):format(v) + if #n10 <= #n16 then + return n10 + else + return n16 + end + else + local n10 = ('%.16f'):format(v):gsub('0+$', '') + local n16 = ('%q'):format(v) + if #n10 <= #n16 then + return n10 + else + return n16 + end + end + end + return ('%q'):format(v) +end + +---@param t table +---@return integer +function mt:dump(t) + if self.unpackMark[t] then + return self.unpackMark[t] + end + local id = self.tableID + self.tableID = self.tableID + 1 + self.unpackMark[t] = id + + local codeBuf = {} + + local hasTable + codeBuf[#codeBuf + 1] = 'return{{' + local hasFields + for k, v in pairs(t) do + if type(v) == 'table' then + hasTable = true + else + if hasFields then + codeBuf[#codeBuf + 1] = ',' + else + hasFields = true + end + codeBuf[#codeBuf+1] = string.format('%s=%s' + , self:formatKey(k) + , self:formatValue(v) + ) + end + end + codeBuf[#codeBuf+1] = '},' + + codeBuf[#codeBuf+1] = string.format('%d', self:formatValue(#t)) + + if hasTable then + codeBuf[#codeBuf + 1] = ',{' + hasFields = false + for k, v in pairs(t) do + if type(v) == 'table' then + if hasFields then + codeBuf[#codeBuf + 1] = ',' + else + hasFields = true + end + codeBuf[#codeBuf + 1] = string.format('%s=%s' + , self:formatKey(k) + , self:dump(v) + ) + end + end + codeBuf[#codeBuf+1] = '}' + end + + codeBuf[#codeBuf+1] = '}' + + self.codeMap[id] = table.concat(codeBuf) + + return id +end + +---@param entryID integer +---@return table +function mt:entry(entryID) + local codeMap = self.codeMap + local keyMap = self.keyMap + local keyDual = self.keyDual + local load = load + local setmt = setmetatable + local dump = string.dump + local rawset = rawset + ---@type table + local idMap = {} + ---@type table + local instMap = {} + local refMap = {} + ---@type table + local infoMap = setmt({}, { + __mode = 'v', + __index = function (map, t) + local id = idMap[t] + local code = codeMap[id] + local f = load(code) + ---@cast f -? + codeMap[id] = dump(f, true) + ---@type table[] + local info = f() + map[t] = info + return info + end + }) + + local lazyload = { + __index = function(t, k) + local info = infoMap[t] + local fields = info[1] + + local keyID = keyDual[k] + + local v = fields[keyID] + if v ~= nil then + return v + end + + local refs = info[3] + if not refs then + return nil + end + + local ref = refs[keyID] + if not ref then + return nil + end + + return instMap[ref] + end, + __newindex = function(t, k, v) + rawset(t, k, v) + refMap[t] = true + end, + __len = function (t) + local info = infoMap[t] + return info[2] + end, + __pairs = function (t) + local info = infoMap[t] + local fields = info[1] + local refs = info[3] + local keys = {} + for k in pairs(fields) do + keys[#keys+1] = keyMap[k] + end + if refs then + for k in pairs(refs) do + keys[#keys+1] = keyMap[k] + end + end + local i = 0 + return function() + i = i + 1 + local k = keys[i] + return k, t[k] + end + end + } + + setmetatable(idMap, { __mode = 'k' }) + + setmetatable(instMap, { + __mode = 'v', + __index = function (map, id) + local inst = {} + idMap[inst] = id + map[id] = inst + + return setmt(inst, lazyload) + end, + }) + + local entry = instMap[entryID] + + return entry +end + +---@class lazytable +local m = {} + +---@param t table +---@return table +function m.build(t) + local builder = setmetatable({ + codeMap = {}, + unpackMark = {}, + keyMap = {}, + keyDual = {}, + }, mt) + + local id = builder:dump(t) + + local entry = builder:entry(id) + + return entry +end + +return m diff --git a/script/service/service.lua b/script/service/service.lua index 07612d7bf..1283d19ae 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -182,6 +182,9 @@ function m.eventLoop() end end pub.step(true) + collectgarbage() + collectgarbage() + m.reportStatus() end while true do From e2987aaff16365b5ef6201b5d9139ea1543eeba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 01:09:31 +0800 Subject: [PATCH 033/965] fix --- script/service/service.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/script/service/service.lua b/script/service/service.lua index 1283d19ae..c8a01a473 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -160,6 +160,8 @@ function m.eventLoop() local function idle() if m.workingClock then m.workingClock = nil + collectgarbage() + collectgarbage() m.reportStatus() end end @@ -182,9 +184,6 @@ function m.eventLoop() end end pub.step(true) - collectgarbage() - collectgarbage() - m.reportStatus() end while true do From 059442e0c9f667ab73dc3eb5a9bebaa5fc6fe0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 03:55:36 +0800 Subject: [PATCH 034/965] cleanup local cache --- .vscode/launch.json | 2 +- .vscode/settings.json | 1 + script/brave/work.lua | 20 ++++-- script/files.lua | 23 ++++++- script/lazy-cacher.lua | 61 +++++++++++++++++++ script/lazytable.lua | 115 ++++++++++++++++++++++++++--------- script/provider/provider.lua | 7 +-- script/pub/report.lua | 2 +- script/service/service.lua | 18 ++++++ 9 files changed, 206 insertions(+), 43 deletions(-) create mode 100644 script/lazy-cacher.lua diff --git a/.vscode/launch.json b/.vscode/launch.json index f43ee53c8..6c32749aa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -25,7 +25,7 @@ "type": "lua", "request": "attach", "stopOnEntry": false, - "address": "127.0.0.1:11427", + "address": "127.0.0.1:11428", "outputCapture": [ ], "sourceFormat": "string", diff --git a/.vscode/settings.json b/.vscode/settings.json index 846e9d8cc..1170a63ab 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,6 @@ "--develop=true", "--dbgport=11413", "--loglevel=trace", + "--lazy", ] } diff --git a/script/brave/work.lua b/script/brave/work.lua index 49c90f831..90ed6f6fb 100644 --- a/script/brave/work.lua +++ b/script/brave/work.lua @@ -1,9 +1,4 @@ local brave = require 'brave.brave' -local parser = require 'parser' -local fs = require 'bee.filesystem' -local furi = require 'file-uri' -local util = require 'utility' -local thread = require 'bee.thread' brave.on('loadProto', function () local jsonrpc = require 'jsonrpc' @@ -19,6 +14,7 @@ brave.on('loadProto', function () end) brave.on('timer', function (time) + local thread = require 'bee.thread' while true do thread.sleep(time) brave.push('wakeup') @@ -26,5 +22,19 @@ brave.on('timer', function (time) end) brave.on('loadFile', function (path) + local util = require 'utility' return util.loadFile(path) end) + +brave.on('removeCaches', function(path) + local fs = require 'bee.filesystem' + local fsu = require 'fs-utility' + for dir in fs.pairs(fs.path(path)) do + local lockFile = dir / '.lock' + local f = io.open(lockFile:string(), 'wb') + if f then + f:close() + fsu.fileRemove(dir) + end + end +end) diff --git a/script/files.lua b/script/files.lua index f1c887703..7a13e06a7 100644 --- a/script/files.lua +++ b/script/files.lua @@ -14,6 +14,8 @@ local progress = require "progress" local encoder = require 'encoder' local scope = require 'workspace.scope' local lazy = require 'lazytable' +local cacher = require 'lazy-cacher' +local sp = require 'bee.subprocess' ---@class file ---@field uri uri @@ -28,6 +30,7 @@ local lazy = require 'lazytable' ---@field state? parser.state ---@field _diffInfo? table[] ---@field cache table +---@field id integer ---@class files local m = {} @@ -50,6 +53,8 @@ end m.reset() +local fileID = util.counter() + local uriMap = {} -- 获取文件的真实uri,但不穿透软链接 ---@param uri uri @@ -202,6 +207,7 @@ function m.setText(uri, text, isTrust, callback) if not m.fileMap[uri] then m.fileMap[uri] = { uri = uri, + id = fileID(), } m.fileCount = m.fileCount + 1 create = true @@ -526,10 +532,21 @@ function m.compileState(uri, text) log.warn(('Parse LuaDoc of [%s] takes [%.3f] sec, size [%.3f] kb.'):format(uri, passed, #text / 1000)) end - if LAZY and not m.fileMap[uri].trusted then + local file = m.fileMap[uri] + if LAZY and not file.trusted then local clock = os.clock() - state.pushError = nil - state = lazy.build(state) + local myCacheDir = string.format('%s/cache/%d' + , LOGPATH + , sp.get_id() + ) + local cachePath = string.format('%s/%d' + , myCacheDir + , file.id + ) + local cache = cacher(cachePath, log.error) + if cache then + state = lazy.build(state, cache.writter, cache.reader):entry() + end local passed = os.clock() - clock if passed > 0.1 then log.warn(('Convert lazy-table for [%s] takes [%.3f] sec, size [%.3f] kb.'):format(uri, passed, #text / 1000)) diff --git a/script/lazy-cacher.lua b/script/lazy-cacher.lua new file mode 100644 index 000000000..e9f19210d --- /dev/null +++ b/script/lazy-cacher.lua @@ -0,0 +1,61 @@ +local fs = require 'bee.filesystem' + +---@param path string +---@param errorHandle? fun(string) +---@return table? +return function (path, errorHandle) + fs.create_directories(fs.path(path):parent_path()) + local f, err = io.open(path, 'a+b') + if not f then + if errorHandle then + errorHandle(err) + end + return nil + end + local size, err = f:seek('end') + if not size then + if errorHandle then + errorHandle(err) + end + return nil + end + local map = {} + return { + writter = function(id, code) + local offset, err = f:seek('end') + if not offset then + if errorHandle then + errorHandle(err) + end + return false + end + local suc, err = f:write(code) + if not suc then + if errorHandle then + errorHandle(err) + end + return false + end + map[id * 2] = offset + map[id * 2 + 1] = #code + return true + end, + reader = function(id) + local offset = map[id * 2] + local len = map[id * 2 + 1] + local _, err = f:seek('set', offset) + if err then + if errorHandle then + errorHandle(err) + end + return nil + end + local code = f:read(len) + return code + end, + dispose = function () + f:close() + os.remove(path) + end, + } +end diff --git a/script/lazytable.lua b/script/lazytable.lua index 49e1cc0f2..9c9e23afa 100644 --- a/script/lazytable.lua +++ b/script/lazytable.lua @@ -1,13 +1,17 @@ ---@class lazytable.builder ----@field codeMap table ----@field unpackMark table ----@field keyMap table ----@field keyDual table +---@field source table +---@field codeMap table +---@field dumpMark table +---@field keyMap table +---@field keyDual table +---@field excludes table local mt = {} mt.__index = mt mt.tableID = 1 mt.keyID = 1 +local DUMMY = function () end + ---@param k string|integer ---@return string function mt:formatKey(k) @@ -47,15 +51,19 @@ function mt:formatValue(v) return ('%q'):format(v) end ----@param t table +---@param t table|function|userdata|thread ---@return integer function mt:dump(t) - if self.unpackMark[t] then - return self.unpackMark[t] + if self.dumpMark[t] then + return self.dumpMark[t] end local id = self.tableID self.tableID = self.tableID + 1 - self.unpackMark[t] = id + self.dumpMark[t] = id + if self.excludes[t] or type(t) ~= 'table' then + self.excludes[t] = true + return id + end local codeBuf = {} @@ -63,9 +71,8 @@ function mt:dump(t) codeBuf[#codeBuf + 1] = 'return{{' local hasFields for k, v in pairs(t) do - if type(v) == 'table' then - hasTable = true - else + local tp = type(v) + if tp == 'string' or tp == 'number' or tp == 'boolean' then if hasFields then codeBuf[#codeBuf + 1] = ',' else @@ -75,6 +82,8 @@ function mt:dump(t) , self:formatKey(k) , self:formatValue(v) ) + else + hasTable = true end end codeBuf[#codeBuf+1] = '},' @@ -85,7 +94,8 @@ function mt:dump(t) codeBuf[#codeBuf + 1] = ',{' hasFields = false for k, v in pairs(t) do - if type(v) == 'table' then + local tp = type(v) + if tp == 'table' or tp == 'function' or tp == 'thread' or tp == 'userdata' then if hasFields then codeBuf[#codeBuf + 1] = ',' else @@ -107,9 +117,32 @@ function mt:dump(t) return id end ----@param entryID integer +---@param writter fun(id: integer, code: string): boolean +---@param reader fun(id: integer): string? +function mt:bind(writter, reader) + setmetatable(self.codeMap, { + __newindex = function (t, id, code) + local suc = writter(id, code) + if not suc then + rawset(t, id, code) + end + end, + __index = function (_, id) + return reader(id) + end + }) +end + +---@param t table +function mt:exclude(t) + self.excludes[t] = true + return self +end + ---@return table -function mt:entry(entryID) +function mt:entry() + local entryID = self:dump(self.source) + local codeMap = self.codeMap local keyMap = self.keyMap local keyDual = self.keyDual @@ -117,6 +150,7 @@ function mt:entry(entryID) local setmt = setmetatable local dump = string.dump local rawset = rawset + local sbyte = string.byte ---@type table local idMap = {} ---@type table @@ -128,19 +162,28 @@ function mt:entry(entryID) __index = function (map, t) local id = idMap[t] local code = codeMap[id] - local f = load(code) - ---@cast f -? - codeMap[id] = dump(f, true) - ---@type table[] + if not code then + return nil + end + local f = load(code) + if not f then + return nil + end + if sbyte(code, 1, 1) ~= 27 then + codeMap[id] = dump(f, true) + end local info = f() - map[t] = info + map[t] = info return info end }) local lazyload = { __index = function(t, k) - local info = infoMap[t] + local info = infoMap[t] + if not info then + return nil + end local fields = info[1] local keyID = keyDual[k] @@ -168,10 +211,16 @@ function mt:entry(entryID) end, __len = function (t) local info = infoMap[t] + if not info then + return 0 + end return info[2] end, __pairs = function (t) - local info = infoMap[t] + local info = infoMap[t] + if not info then + return DUMMY + end local fields = info[1] local refs = info[3] local keys = {} @@ -205,6 +254,12 @@ function mt:entry(entryID) end, }) + for t in pairs(self.excludes) do + local id = self.dumpMark[t] + refMap[t] = true + instMap[id] = t + end + local entry = instMap[entryID] return entry @@ -214,20 +269,24 @@ end local m = {} ---@param t table ----@return table -function m.build(t) +---@param writter? fun(id: integer, code: string): boolean +---@param reader? fun(id: integer): string? +---@return lazytable.builder +function m.build(t, writter, reader) local builder = setmetatable({ + source = t, codeMap = {}, - unpackMark = {}, + dumpMark = {}, keyMap = {}, keyDual = {}, + excludes = {}, }, mt) - local id = builder:dump(t) - - local entry = builder:entry(id) + if writter and reader then + builder:bind(writter, reader) + end - return entry + return builder end return m diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 018db0c31..2ac9fd559 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -6,7 +6,6 @@ local proto = require 'proto.proto' local define = require 'proto.define' local workspace = require 'workspace' local config = require 'config' -local library = require 'library' local client = require 'client' local pub = require 'pub' local lang = require 'language' @@ -19,10 +18,8 @@ local json = require 'json' local scope = require 'workspace.scope' local furi = require 'file-uri' local inspect = require 'inspect' -local markdown = require 'provider.markdown' local guide = require 'parser.guide' local fs = require 'bee.filesystem' -local jumpSource = require 'core.jump-source' ---@async local function updateConfig(uri) @@ -105,7 +102,7 @@ filewatch.event(function (ev, path) ---@async end) m.register 'initialize' { - function (params) + function(params) client.init(params) if params.rootUri then @@ -159,7 +156,7 @@ m.register 'initialized'{ m.register 'exit' { function () log.info('Server exited.') - os.exit(true) + os.exit(0, true) end } diff --git a/script/pub/report.lua b/script/pub/report.lua index bce5309b4..5169023c7 100644 --- a/script/pub/report.lua +++ b/script/pub/report.lua @@ -23,7 +23,7 @@ end) pub.on('protoerror', function (err) log.warn('Load proto error:', err) - os.exit(true) + os.exit(0, true) end) pub.on('wakeup', function () end) diff --git a/script/service/service.lua b/script/service/service.lua index c8a01a473..06558ae55 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -245,6 +245,23 @@ function m.testVersion() end end +function m.lockCache() + local fs = require 'bee.filesystem' + local sp = require 'bee.subprocess' + local cacheDir = string.format('%s/cache', LOGPATH) + local myCacheDir = string.format('%s/%d' + , cacheDir + , sp.get_id() + ) + fs.create_directories(fs.path(myCacheDir)) + local err + m.lockFile, err = io.open(myCacheDir .. '/.lock', 'wb') + if err then + log.error(err) + end + pub.task('removeCaches', cacheDir) +end + function m.start() util.enableCloseFunction() await.setErrorHandle(log.error) @@ -252,6 +269,7 @@ function m.start() proto.listen() m.report() m.testVersion() + m.lockCache() require 'provider' From 4d5e77a7cde682f45163162292f283e5ed378db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 04:33:15 +0800 Subject: [PATCH 035/965] fix --- script/library.lua | 2 +- script/provider/provider.lua | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/script/library.lua b/script/library.lua index 208b10edb..b4333dca4 100644 --- a/script/library.lua +++ b/script/library.lua @@ -243,7 +243,7 @@ local function initBuiltIn(uri) if status == 'disable' then goto CONTINUE end - + ---@type fs.path local libPath = templateDir / (libName .. '.lua') local metaDoc = compileSingleMetaDoc(uri, fsu.loadFile(libPath), metaLang, status) diff --git a/script/provider/provider.lua b/script/provider/provider.lua index 2ac9fd559..2f1451b07 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -19,7 +19,9 @@ local scope = require 'workspace.scope' local furi = require 'file-uri' local inspect = require 'inspect' local guide = require 'parser.guide' -local fs = require 'bee.filesystem' +local fs = require 'bee.filesystem' + +require 'library' ---@async local function updateConfig(uri) From 56d37a64423660f854f8d64f05831d632442ea4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 05:21:19 +0800 Subject: [PATCH 036/965] not working, go to sleep --- script/lazytable.lua | 246 +++++++++++++++++++++++++++++-------------- 1 file changed, 165 insertions(+), 81 deletions(-) diff --git a/script/lazytable.lua b/script/lazytable.lua index 9c9e23afa..344c56d03 100644 --- a/script/lazytable.lua +++ b/script/lazytable.lua @@ -2,30 +2,75 @@ ---@field source table ---@field codeMap table ---@field dumpMark table ----@field keyMap table ----@field keyDual table ---@field excludes table +---@field refMap table +---@field instMap table local mt = {} mt.__index = mt mt.tableID = 1 mt.keyID = 1 -local DUMMY = function () end +local DUMMY = function() end + +local RESERVED = { + ['and'] = true, + ['break'] = true, + ['do'] = true, + ['else'] = true, + ['elseif'] = true, + ['end'] = true, + ['false'] = true, + ['for'] = true, + ['function'] = true, + ['if'] = true, + ['in'] = true, + ['local'] = true, + ['nil'] = true, + ['not'] = true, + ['or'] = true, + ['repeat'] = true, + ['return'] = true, + ['then'] = true, + ['true'] = true, + ['until'] = true, + ['while'] = true, + ['goto'] = true +} ---@param k string|integer ---@return string -function mt:formatKey(k) - if not self.keyDual[k] then - local id = self.keyID - self.keyID = self.keyID + 1 - self.keyDual[k] = id - self.keyMap[id] = k +local function formatKey(k) + if type(k) == 'string' then + if not RESERVED[k] and k:match '^[%a_][%w_]*$' then + return k + else + return ('[%q]'):format(k) + end end - return string.format('[%d]', self.keyDual[k]) + if type(k) == 'number' then + if math.type(k) == 'integer' then + local n10 = ('%d'):format(k) + local n16 = ('0x%X'):format(k) + if #n10 <= #n16 then + return '[' .. n10 .. ']' + else + return '[' .. n16 .. ']' + end + else + local n10 = ('%.16f'):format(k):gsub('0+$', '') + local n16 = ('%q'):format(k) + if #n10 <= #n16 then + return '[' .. n10 .. ']' + else + return '[' .. n16 .. ']' + end + end + end + error('invalid key type: ' .. type(k)) end ---@param v string|number|boolean -function mt:formatValue(v) +local function formatValue(v) if type(v) == 'string' then return ('%q'):format(v) end @@ -51,69 +96,82 @@ function mt:formatValue(v) return ('%q'):format(v) end ----@param t table|function|userdata|thread ----@return integer -function mt:dump(t) - if self.dumpMark[t] then - return self.dumpMark[t] - end - local id = self.tableID - self.tableID = self.tableID + 1 - self.dumpMark[t] = id - if self.excludes[t] or type(t) ~= 'table' then - self.excludes[t] = true - return id - end - +---@param info {[1]: table, [2]: integer, [3]: table?} +---@return string +local function dump(info) local codeBuf = {} - local hasTable codeBuf[#codeBuf + 1] = 'return{{' local hasFields - for k, v in pairs(t) do - local tp = type(v) - if tp == 'string' or tp == 'number' or tp == 'boolean' then + for k, v in pairs(info[1]) do + if hasFields then + codeBuf[#codeBuf + 1] = ',' + else + hasFields = true + end + codeBuf[#codeBuf+1] = string.format('%s=%s' + , formatKey(k) + , formatValue(v) + ) + end + codeBuf[#codeBuf+1] = '}' + + codeBuf[#codeBuf+1] = string.format(',%d', formatValue(info[2])) + + if info[3] then + codeBuf[#codeBuf+1] = ',{' + hasFields = false + for k, v in pairs(info[3]) do if hasFields then - codeBuf[#codeBuf + 1] = ',' + codeBuf[#codeBuf+1] = ',' else hasFields = true end codeBuf[#codeBuf+1] = string.format('%s=%s' - , self:formatKey(k) - , self:formatValue(v) + , formatKey(k) + , formatValue(v) ) - else - hasTable = true end + codeBuf[#codeBuf+1] = '}' end - codeBuf[#codeBuf+1] = '},' - codeBuf[#codeBuf+1] = string.format('%d', self:formatValue(#t)) + codeBuf[#codeBuf + 1] = '}' - if hasTable then - codeBuf[#codeBuf + 1] = ',{' - hasFields = false - for k, v in pairs(t) do - local tp = type(v) - if tp == 'table' or tp == 'function' or tp == 'thread' or tp == 'userdata' then - if hasFields then - codeBuf[#codeBuf + 1] = ',' - else - hasFields = true - end - codeBuf[#codeBuf + 1] = string.format('%s=%s' - , self:formatKey(k) - , self:dump(v) - ) + return table.concat(codeBuf) +end + +---@param obj table|function|userdata|thread +---@return integer +function mt:getObjectID(obj) + if self.dumpMark[obj] then + return self.dumpMark[obj] + end + local id = self.tableID + self.tableID = self.tableID + 1 + self.dumpMark[obj] = id + if self.excludes[obj] or type(obj) ~= 'table' then + self.refMap[obj] = id + self.instMap[id] = obj + return id + end + + local fields = {} + local objs + for k, v in pairs(obj) do + local tp = type(v) + if tp == 'string' or tp == 'number' or tp == 'boolean' then + fields[k] = v + else + if not objs then + objs = {} end + objs[k] = self:getObjectID(v) end - codeBuf[#codeBuf+1] = '}' end - codeBuf[#codeBuf+1] = '}' - - self.codeMap[id] = table.concat(codeBuf) + local code = dump({fields, #obj, objs}) + self.codeMap[id] = code return id end @@ -141,21 +199,19 @@ end ---@return table function mt:entry() - local entryID = self:dump(self.source) + local entryID = self:getObjectID(self.source) local codeMap = self.codeMap - local keyMap = self.keyMap - local keyDual = self.keyDual + local refMap = self.refMap + local instMap = self.instMap local load = load local setmt = setmetatable - local dump = string.dump - local rawset = rawset + local sdump = string.dump + local type = type local sbyte = string.byte + local tableID = self.tableID ---@type table local idMap = {} - ---@type table - local instMap = {} - local refMap = {} ---@type table local infoMap = setmt({}, { __mode = 'v', @@ -170,7 +226,7 @@ function mt:entry() return nil end if sbyte(code, 1, 1) ~= 27 then - codeMap[id] = dump(f, true) + codeMap[id] = sdump(f, true) end local info = f() map[t] = info @@ -179,6 +235,7 @@ function mt:entry() }) local lazyload = { + ref = refMap, __index = function(t, k) local info = infoMap[t] if not info then @@ -186,7 +243,7 @@ function mt:entry() end local fields = info[1] - local keyID = keyDual[k] + local keyID = k local v = fields[keyID] if v ~= nil then @@ -206,8 +263,39 @@ function mt:entry() return instMap[ref] end, __newindex = function(t, k, v) - rawset(t, k, v) - refMap[t] = true + local info = infoMap[t] + if not info then + return + end + local fields = info[1] + local objs = info[3] + fields[k] = nil + if objs then + objs[k] = nil + end + if v ~= nil then + local tp = type(v) + if tp == 'string' or tp == 'number' or tp == 'boolean' then + fields[k] = v + else + if not objs then + objs = {} + end + local id = refMap[v] + if not id then + id = tableID + refMap[v] = id -- 新赋值的对象一定会被引用住 + instMap[id] = v + tableID = tableID + 1 + end + objs[k] = id + end + end + info = { fields, info[2], objs } + local id = idMap[t] + local code = dump(info) + codeMap[id] = code + infoMap[id] = nil end, __len = function (t) local info = infoMap[t] @@ -222,14 +310,14 @@ function mt:entry() return DUMMY end local fields = info[1] - local refs = info[3] + local objs = info[3] local keys = {} for k in pairs(fields) do - keys[#keys+1] = keyMap[k] + keys[#keys+1] = k end - if refs then - for k in pairs(refs) do - keys[#keys+1] = keyMap[k] + if objs then + for k in pairs(objs) do + keys[#keys+1] = k end end local i = 0 @@ -238,7 +326,7 @@ function mt:entry() local k = keys[i] return k, t[k] end - end + end, } setmetatable(idMap, { __mode = 'k' }) @@ -254,13 +342,9 @@ function mt:entry() end, }) - for t in pairs(self.excludes) do - local id = self.dumpMark[t] - refMap[t] = true - instMap[id] = t - end + local entry = instMap[entryID] --[[@as table]] - local entry = instMap[entryID] + self.source = nil return entry end @@ -276,9 +360,9 @@ function m.build(t, writter, reader) local builder = setmetatable({ source = t, codeMap = {}, + refMap = {}, + instMap = {}, dumpMark = {}, - keyMap = {}, - keyDual = {}, excludes = {}, }, mt) From 65b0f5c0f90ee63ef3562be9a41be8fc5eaae4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 15:58:56 +0800 Subject: [PATCH 037/965] set aside --- .vscode/settings.json | 2 +- script/lazy-cacher.lua | 21 +++++++++++++++------ script/lazytable.lua | 5 +++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 1170a63ab..e7be186ef 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,6 @@ "--develop=true", "--dbgport=11413", "--loglevel=trace", - "--lazy", + //"--lazy", ] } diff --git a/script/lazy-cacher.lua b/script/lazy-cacher.lua index e9f19210d..e39cceff2 100644 --- a/script/lazy-cacher.lua +++ b/script/lazy-cacher.lua @@ -1,4 +1,4 @@ -local fs = require 'bee.filesystem' +local fs = require 'bee.filesystem' ---@param path string ---@param errorHandle? fun(string) @@ -29,6 +29,13 @@ return function (path, errorHandle) end return false end + if not code then + map[id] = nil + return true + end + if #code > 1000000 then + return false + end local suc, err = f:write(code) if not suc then if errorHandle then @@ -36,13 +43,15 @@ return function (path, errorHandle) end return false end - map[id * 2] = offset - map[id * 2 + 1] = #code + map[id] = offset * 1000000 + #code return true end, reader = function(id) - local offset = map[id * 2] - local len = map[id * 2 + 1] + if not map[id] then + return nil + end + local offset = map[id] // 1000000 + local len = map[id] % 1000000 local _, err = f:seek('set', offset) if err then if errorHandle then @@ -55,7 +64,7 @@ return function (path, errorHandle) end, dispose = function () f:close() - os.remove(path) + fs.remove(fs.path(path)) end, } end diff --git a/script/lazytable.lua b/script/lazytable.lua index 344c56d03..9ac9c468f 100644 --- a/script/lazytable.lua +++ b/script/lazytable.lua @@ -155,6 +155,11 @@ function mt:getObjectID(obj) return id end + if not next(obj) then + self.codeMap[id] = nil + return id + end + local fields = {} local objs for k, v in pairs(obj) do From 828bb2a45c3cdcf241f121baff13db9f2ec94848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 16:57:34 +0800 Subject: [PATCH 038/965] dont gc --- script/service/service.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/script/service/service.lua b/script/service/service.lua index 06558ae55..8ded841ef 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -160,8 +160,6 @@ function m.eventLoop() local function idle() if m.workingClock then m.workingClock = nil - collectgarbage() - collectgarbage() m.reportStatus() end end From aa9333820f557ae96ca3c05c71db6d7ba51ccf95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 19:18:56 +0800 Subject: [PATCH 039/965] fix #1476 --- changelog.md | 3 +++ meta/template/basic.lua | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index f02640b05..e65546b7d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 3.5.4 +* `FIX` [#1476](https://github.com/sumneko/lua-language-server/issues/1476) + ## 3.5.3 `2022-8-13` * `FIX` [#1409](https://github.com/sumneko/lua-language-server/issues/1409) diff --git a/meta/template/basic.lua b/meta/template/basic.lua index 552aa9dba..ee277b75c 100644 --- a/meta/template/basic.lua +++ b/meta/template/basic.lua @@ -9,7 +9,8 @@ arg = {} ---@param v? T ---@param message? any ---@return T -function assert(v, message) end +---@return ... +function assert(v, message, ...) end ---@alias gcoptions ---|>'"collect"' # ---#DESTAIL 'cgopt.collect' From e5ebce3d90da8cb59eee373fa119ad6eb8472546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 19:48:07 +0800 Subject: [PATCH 040/965] fix runtime error --- script/core/diagnostics/param-type-mismatch.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/core/diagnostics/param-type-mismatch.lua b/script/core/diagnostics/param-type-mismatch.lua index 6f34f5790..cadff93a6 100644 --- a/script/core/diagnostics/param-type-mismatch.lua +++ b/script/core/diagnostics/param-type-mismatch.lua @@ -46,6 +46,9 @@ return function (uri, callback) goto CONTINUE end local refNode = vm.compileNode(arg) + if not refNode then + goto CONTINUE + end local defNode = getDefNode(funcNode, i) if not defNode then goto CONTINUE From c3d602a11de758f14e46a2b49539e5fe9c76dd8c Mon Sep 17 00:00:00 2001 From: CppCXY <812125110@qq.com> Date: Wed, 17 Aug 2022 20:04:37 +0800 Subject: [PATCH 041/965] =?UTF-8?q?=E6=8F=90=E4=BA=A4typeformat=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rd/EmmyLuaCodeStyle | 2 +- make/code_format.lua | 1 + script/config/template.lua | 3 +++ script/core/type-formatting.lua | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 2265c0a5c..3ab6c9ff8 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 2265c0a5c472298c34e05c1f15745bf20f1cc950 +Subproject commit 3ab6c9ff8b91e07c3135afaa6620bd528aa7628a diff --git a/make/code_format.lua b/make/code_format.lua index 6cf5cfd7d..387221b37 100644 --- a/make/code_format.lua +++ b/make/code_format.lua @@ -21,6 +21,7 @@ lm:source_set 'code_format' { "Util/src/Utf8.cpp", --CodeService "CodeService/src/*.cpp", + "CodeService/src/TypeFormat/*.cpp", "CodeService/src/Spell/*.cpp", "Util/src/SymSpell/*.cpp", "CodeService/src/FormatElement/*.cpp", diff --git a/script/config/template.lua b/script/config/template.lua index 60f3dbca0..a08b9e53c 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -181,6 +181,7 @@ end, function (self, ...) self.subs = { ... } end) +---@format disable-next local template = { ['Lua.runtime.version'] = Type.String >> 'Lua 5.4' << { 'Lua 5.1', @@ -371,6 +372,8 @@ local template = { ['Lua.format.enable'] = Type.Boolean >> true, ['Lua.format.defaultConfig'] = Type.Hash(Type.String, Type.String) >> {}, + ['Lua.typeFormat.config'] = Type.Hash(Type.String, Type.String) + >> {}, ['Lua.spell.dict'] = Type.Array(Type.String), ['Lua.telemetry.enable'] = Type.Or(Type.Boolean >> false, Type.Nil) >> nil, ['Lua.misc.parameters'] = Type.Array(Type.String), diff --git a/script/core/type-formatting.lua b/script/core/type-formatting.lua index c6316d805..908926045 100644 --- a/script/core/type-formatting.lua +++ b/script/core/type-formatting.lua @@ -2,6 +2,7 @@ local files = require 'files' local lookBackward = require 'core.look-backward' local guide = require "parser.guide" local codeFormat = require "code_format" +local config = require "config" local function insertIndentation(uri, position, edits) local text = files.getText(uri) @@ -98,7 +99,8 @@ local function typeFormat(results, uri, position, ch, options) end local converter = require("proto.converter") local pos = converter.packPosition(uri, position) - local success, result = codeFormat.type_format(uri, text, pos.line, pos.character, options) + local typeFormatOptions = config.get(uri, 'Lua.typeFormat.config') + local success, result = codeFormat.type_format(uri, text, pos.line, pos.character, options, typeFormatOptions) if success then local range = result.range results[#results+1] = { From e279acb08829e31cdaae87f93c1c187d87907e57 Mon Sep 17 00:00:00 2001 From: CppCXY <812125110@qq.com> Date: Wed, 17 Aug 2022 20:18:47 +0800 Subject: [PATCH 042/965] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/config/template.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/config/template.lua b/script/config/template.lua index a08b9e53c..14c341e1a 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -373,7 +373,10 @@ local template = { ['Lua.format.defaultConfig'] = Type.Hash(Type.String, Type.String) >> {}, ['Lua.typeFormat.config'] = Type.Hash(Type.String, Type.String) - >> {}, + >> { + format_line = "true", + auto_complete_end = "true" + }, ['Lua.spell.dict'] = Type.Array(Type.String), ['Lua.telemetry.enable'] = Type.Or(Type.Boolean >> false, Type.Nil) >> nil, ['Lua.misc.parameters'] = Type.Array(Type.String), From 02ff292d6a556527ef2cb07bba4521e055f05a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 17 Aug 2022 21:43:10 +0800 Subject: [PATCH 043/965] pass tests --- test/completion/common.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/completion/common.lua b/test/completion/common.lua index 1d7d414c5..02e57b80c 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -82,7 +82,7 @@ ass ]] { { - label = 'assert(v, message)', + label = 'assert(v, message, ...)', kind = define.CompletionItemKind.Function, }, } @@ -93,7 +93,7 @@ ass ]] { { - label = 'assert(v, message)', + label = 'assert(v, message, ...)', kind = define.CompletionItemKind.Function, }, } @@ -104,11 +104,11 @@ ass ]] { { - label = 'assert(v, message)', + label = 'assert(v, message, ...)', kind = define.CompletionItemKind.Function, }, { - label = 'assert(v, message)', + label = 'assert(v, message, ...)', kind = define.CompletionItemKind.Snippet, }, } @@ -130,11 +130,11 @@ _G.ass ]] { { - label = 'assert(v, message)', + label = 'assert(v, message, ...)', kind = define.CompletionItemKind.Function, }, { - label = 'assert(v, message)', + label = 'assert(v, message, ...)', kind = define.CompletionItemKind.Snippet, }, } From b487d37819a5942d6807d2e9c338dd45557a6739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 19 Aug 2022 16:16:22 +0800 Subject: [PATCH 044/965] fix `diagnostics.workspaceDelay` --- changelog.md | 1 + script/lazytable.lua | 3 ++- script/provider/diagnostic.lua | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index e65546b7d..f342fa69b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 3.5.4 +* `FIX` `diagnostics.workspaceDelay` can not prevent first workspace diagnostic * `FIX` [#1476](https://github.com/sumneko/lua-language-server/issues/1476) ## 3.5.3 diff --git a/script/lazytable.lua b/script/lazytable.lua index 9ac9c468f..229a7a0df 100644 --- a/script/lazytable.lua +++ b/script/lazytable.lua @@ -286,7 +286,7 @@ function mt:entry() if not objs then objs = {} end - local id = refMap[v] + local id = refMap[v] or idMap[v] if not id then id = tableID refMap[v] = id -- 新赋值的对象一定会被引用住 @@ -350,6 +350,7 @@ function mt:entry() local entry = instMap[entryID] --[[@as table]] self.source = nil + self.dumpMark = nil return entry end diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 46ea600f2..222876985 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -511,6 +511,9 @@ function m.diagnosticsScope(uri, force) m.clearAll() return end + if not force and config.get(uri, 'Lua.diagnostics.workspaceDelay') < 0 then + return + end local scp = scope.getScope(uri) local id = 'diagnosticsScope:' .. scp:getName() await.close(id) From 4af8144d6641ed03d42ea61d2dcdb402f2f6afbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 20 Aug 2022 03:08:43 +0800 Subject: [PATCH 045/965] update lazy --- script/files.lua | 32 ++++--- script/lazy-cacher.lua | 212 +++++++++++++++++++++++++++++------------ script/lazytable.lua | 15 ++- 3 files changed, 178 insertions(+), 81 deletions(-) diff --git a/script/files.lua b/script/files.lua index 7a13e06a7..c759f0389 100644 --- a/script/files.lua +++ b/script/files.lua @@ -33,6 +33,7 @@ local sp = require 'bee.subprocess' ---@field id integer ---@class files +---@field lazyCache? lazy-cacher local m = {} m.watchList = {} @@ -477,6 +478,17 @@ function m.eachDll() return pairs(map) end +function m.getLazyCache() + if not m.lazyCache then + local cachePath = string.format('%s/cache/%d' + , LOGPATH + , sp.get_id() + ) + m.lazyCache = cacher(cachePath, log.error) + end + return m.lazyCache +end + function m.compileState(uri, text) local ws = require 'workspace' local client = require 'client' @@ -534,20 +546,12 @@ function m.compileState(uri, text) local file = m.fileMap[uri] if LAZY and not file.trusted then - local clock = os.clock() - local myCacheDir = string.format('%s/cache/%d' - , LOGPATH - , sp.get_id() - ) - local cachePath = string.format('%s/%d' - , myCacheDir - , file.id - ) - local cache = cacher(cachePath, log.error) - if cache then - state = lazy.build(state, cache.writter, cache.reader):entry() - end - local passed = os.clock() - clock + state.pushError = nil + local cache = m.getLazyCache() + local id = ('%d'):format(file.id) + clock = os.clock() + state = lazy.build(state, cache:writterAndReader(id)):entry() + passed = os.clock() - clock if passed > 0.1 then log.warn(('Convert lazy-table for [%s] takes [%.3f] sec, size [%.3f] kb.'):format(uri, passed, #text / 1000)) end diff --git a/script/lazy-cacher.lua b/script/lazy-cacher.lua index e39cceff2..963516f15 100644 --- a/script/lazy-cacher.lua +++ b/script/lazy-cacher.lua @@ -1,70 +1,164 @@ -local fs = require 'bee.filesystem' +local fs = require 'bee.filesystem' +local linkedTable = require 'linked-table' ----@param path string ----@param errorHandle? fun(string) ----@return table? -return function (path, errorHandle) - fs.create_directories(fs.path(path):parent_path()) - local f, err = io.open(path, 'a+b') - if not f then - if errorHandle then - errorHandle(err) - end - return nil +---@class lazy-cacher +---@field _opening linked-table +---@field _openingMap table +---@field _dir string +local mt = {} +mt.__index = mt +mt.type = 'lazy-cacher' + +mt.maxOpendFiles = 50 +mt.maxFileSize = 100 * 1024 * 1024 -- 100MB +mt.openingFiles = {} + +mt.errorHandler = function (err) end + +---@param fileID string +function mt:_closeFile(fileID) + self._opening:pop(fileID) + self._openingMap[fileID]:close() + self._openingMap[fileID] = nil +end + +---@param fileID string +---@return file*? +---@return string? errorMessage +function mt:_getFile(fileID) + if self._openingMap[fileID] then + self._opening:pop(fileID) + self._opening:pushTail(fileID) + return self._openingMap[fileID] end - local size, err = f:seek('end') - if not size then - if errorHandle then - errorHandle(err) - end - return nil + local fullPath = self._dir .. '/' .. fileID + local file, err = io.open(fullPath, 'a+b') + if not file then + return nil, err + end + self._opening:pushTail(fileID) + self._openingMap[fileID] = file + if self._opening:getSize() > self.maxOpendFiles then + local oldest = self._opening:getHead() + self:_closeFile(oldest) end + return file +end + +---@param fileID string +---@return fun(id: integer, code: string): boolean +---@return fun(id: integer): string? +function mt:writterAndReader(fileID) + local maxFileSize = self.maxFileSize local map = {} - return { - writter = function(id, code) - local offset, err = f:seek('end') - if not offset then - if errorHandle then - errorHandle(err) - end - return false - end - if not code then - map[id] = nil - return true - end - if #code > 1000000 then - return false - end - local suc, err = f:write(code) + ---@param file file* + local function resize(file) + local codes = {} + for id, data in pairs(map) do + local offset = data // 1000000 + local len = data % 1000000 + local suc, err = file:seek('set', offset) if not suc then - if errorHandle then - errorHandle(err) - end - return false + self.errorHandler(err) + return end + local code = file:read(len) + codes[id] = code + end + + self:_closeFile(fileID) + local fullPath = self._dir .. '/' .. fileID + local file, err = io.open(fullPath, 'wb') + if not file then + self.errorHandler(err) + return + end + + local offset = 0 + for id, code in pairs(codes) do + file:write(code) map[id] = offset * 1000000 + #code + offset = offset + #code + end + file:close() + end + ---@param id integer + ---@param code string + ---@return boolean + local function writter(id, code) + if not code then + map[id] = nil return true - end, - reader = function(id) - if not map[id] then - return nil + end + if #code > 1000000 then + return false + end + local file, err = self:_getFile(fileID) + if not file then + self.errorHandler(err) + return false + end + local offset, err = file:seek('end') + if not offset then + self.errorHandler(err) + return false + end + if offset > maxFileSize then + resize(file) + file, err = self:_getFile(fileID) + if not file then + self.errorHandler(err) + return false end - local offset = map[id] // 1000000 - local len = map[id] % 1000000 - local _, err = f:seek('set', offset) - if err then - if errorHandle then - errorHandle(err) - end - return nil + offset, err = file:seek('end') + if not offset then + self.errorHandler(err) + return false end - local code = f:read(len) - return code - end, - dispose = function () - f:close() - fs.remove(fs.path(path)) - end, - } + maxFileSize = math.max(maxFileSize, (offset + #code) * 2) + end + local suc, err = file:write(code) + if not suc then + self.errorHandler(err) + return false + end + map[id] = offset * 1000000 + #code + return true + end + ---@param id integer + ---@return string? + local function reader(id) + if not map[id] then + return nil + end + local file, err = self:_getFile(fileID) + if not file then + self.errorHandler(err) + return nil + end + local offset = map[id] // 1000000 + local len = map[id] % 1000000 + local suc, err = file:seek('set', offset) + if not suc then + self.errorHandler(err) + return nil + end + local code = file:read(len) + return code + end + return writter, reader +end + +---@param dir string +---@param errorHandle? fun(string) +---@return lazy-cacher? +return function (dir, errorHandle) + fs.create_directories(fs.path(dir)) + local self = setmetatable({ + _dir = dir, + _opening = linkedTable(), + _openingMap = {}, + errorHandler = errorHandle, + }, mt) + return self end diff --git a/script/lazytable.lua b/script/lazytable.lua index 229a7a0df..862924772 100644 --- a/script/lazytable.lua +++ b/script/lazytable.lua @@ -268,12 +268,10 @@ function mt:entry() return instMap[ref] end, __newindex = function(t, k, v) - local info = infoMap[t] - if not info then - return - end - local fields = info[1] - local objs = info[3] + local info = infoMap[t] + local fields = info and info[1] or {} + local len = info and info[2] or 0 + local objs = info and info[3] fields[k] = nil if objs then objs[k] = nil @@ -296,11 +294,12 @@ function mt:entry() objs[k] = id end end - info = { fields, info[2], objs } + info = { fields, len, objs } local id = idMap[t] local code = dump(info) - codeMap[id] = code infoMap[id] = nil + codeMap[id] = nil + codeMap[id] = code end, __len = function (t) local info = infoMap[t] From e130a5fe9572194dccf881479311c750151fdf55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 20 Aug 2022 03:42:43 +0800 Subject: [PATCH 046/965] cleanup loading --- script/workspace/loading.lua | 11 ++++++----- script/workspace/workspace.lua | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/script/workspace/loading.lua b/script/workspace/loading.lua index 468e19084..9344949c5 100644 --- a/script/workspace/loading.lua +++ b/script/workspace/loading.lua @@ -99,6 +99,7 @@ function mt:loadFile(uri, libraryUri) -- self._sets[#self._sets+1] = waker --end) files.setText(uri, content, false) + files.getState(uri) if not self._cache[uri] then files.addRef(uri) end @@ -147,9 +148,9 @@ function mt:loadFile(uri, libraryUri) end ---@async -function mt:loadAll() +function mt:loadAll(fileName) local startClock = os.clock() - log.info('Load files from disk:', self.scp:getName()) + log.info('Load files from disk:', fileName) while self.read < self.max do self:update() local loader = table.remove(self._stash) @@ -161,7 +162,7 @@ function mt:loadAll() end end local loadedClock = os.clock() - log.info(('Loaded files takes [%.3f] sec: %s'):format(loadedClock - startClock, self.scp:getName())) + log.info(('Loaded files takes [%.3f] sec: %s'):format(loadedClock - startClock, fileName)) self._bar:remove() self._bar = progress.create(self.scp.uri, lang.script('WORKSPACE_LOADING', self.scp.uri), 0) for i, set in ipairs(self._sets) do @@ -170,8 +171,8 @@ function mt:loadAll() self.read = i self:update() end - log.info(('Compile files takes [%.3f] sec: %s'):format(os.clock() - loadedClock, self.scp:getName())) - log.info('Loaded finish:', self.scp:getName()) + log.info(('Compile files takes [%.3f] sec: %s'):format(os.clock() - loadedClock, fileName)) + log.info('Loaded finish:', fileName) end function mt:remove() diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 9d2ad6373..1b94f389f 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -269,7 +269,7 @@ function m.awaitLoadFile(uri) scp:get('cachedUris')[uri] = true ld:loadFile(uri) end) - ld:loadAll() + ld:loadAll(uri) end function m.removeFile(uri) @@ -346,7 +346,7 @@ function m.awaitPreload(scp) await.sleep(0.1) log.info(('Found %d files at:'):format(ld.max), scp:getName()) - ld:loadAll() + ld:loadAll(scp:getName()) log.info('Preload finish at:', scp:getName()) end From 4405d927b86e14646d5134971dc18b1d519b76c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 20 Aug 2022 04:14:57 +0800 Subject: [PATCH 047/965] cleanup --- script/lazy-cacher.lua | 15 +++++-- script/lazytable.lua | 88 ++++++++++++++---------------------------- 2 files changed, 41 insertions(+), 62 deletions(-) diff --git a/script/lazy-cacher.lua b/script/lazy-cacher.lua index 963516f15..d6b29ba9d 100644 --- a/script/lazy-cacher.lua +++ b/script/lazy-cacher.lua @@ -1,6 +1,13 @@ local fs = require 'bee.filesystem' local linkedTable = require 'linked-table' +local setmt = setmetatable +local pairs = pairs +local iopen = io.open +local mmax = math.max + +_ENV = nil + ---@class lazy-cacher ---@field _opening linked-table ---@field _openingMap table @@ -32,7 +39,7 @@ function mt:_getFile(fileID) return self._openingMap[fileID] end local fullPath = self._dir .. '/' .. fileID - local file, err = io.open(fullPath, 'a+b') + local file, err = iopen(fullPath, 'a+b') if not file then return nil, err end @@ -68,7 +75,7 @@ function mt:writterAndReader(fileID) self:_closeFile(fileID) local fullPath = self._dir .. '/' .. fileID - local file, err = io.open(fullPath, 'wb') + local file, err = iopen(fullPath, 'wb') if not file then self.errorHandler(err) return @@ -115,7 +122,7 @@ function mt:writterAndReader(fileID) self.errorHandler(err) return false end - maxFileSize = math.max(maxFileSize, (offset + #code) * 2) + maxFileSize = mmax(maxFileSize, (offset + #code) * 2) end local suc, err = file:write(code) if not suc then @@ -154,7 +161,7 @@ end ---@return lazy-cacher? return function (dir, errorHandle) fs.create_directories(fs.path(dir)) - local self = setmetatable({ + local self = setmt({ _dir = dir, _opening = linkedTable(), _openingMap = {}, diff --git a/script/lazytable.lua b/script/lazytable.lua index 862924772..d162b4c83 100644 --- a/script/lazytable.lua +++ b/script/lazytable.lua @@ -1,3 +1,18 @@ +local type = type +local pairs = pairs +local error = error +local next = next +local load = load +local setmt = setmetatable +local rawset = rawset +local sdump = string.dump +local sbyte = string.byte +local smatch = string.match +local sformat = string.format +local tconcat = table.concat + +_ENV = nil + ---@class lazytable.builder ---@field source table ---@field codeMap table @@ -41,59 +56,21 @@ local RESERVED = { ---@return string local function formatKey(k) if type(k) == 'string' then - if not RESERVED[k] and k:match '^[%a_][%w_]*$' then + if not RESERVED[k] and smatch(k, '^[%a_][%w_]*$') then return k else - return ('[%q]'):format(k) + return sformat('[%q]', k) end end if type(k) == 'number' then - if math.type(k) == 'integer' then - local n10 = ('%d'):format(k) - local n16 = ('0x%X'):format(k) - if #n10 <= #n16 then - return '[' .. n10 .. ']' - else - return '[' .. n16 .. ']' - end - else - local n10 = ('%.16f'):format(k):gsub('0+$', '') - local n16 = ('%q'):format(k) - if #n10 <= #n16 then - return '[' .. n10 .. ']' - else - return '[' .. n16 .. ']' - end - end + return sformat('[%q]', k) end error('invalid key type: ' .. type(k)) end ---@param v string|number|boolean local function formatValue(v) - if type(v) == 'string' then - return ('%q'):format(v) - end - if type(v) == 'number' then - if math.type(v) == 'integer' then - local n10 = ('%d'):format(v) - local n16 = ('0x%X'):format(v) - if #n10 <= #n16 then - return n10 - else - return n16 - end - else - local n10 = ('%.16f'):format(v):gsub('0+$', '') - local n16 = ('%q'):format(v) - if #n10 <= #n16 then - return n10 - else - return n16 - end - end - end - return ('%q'):format(v) + return sformat('%q', v) end ---@param info {[1]: table, [2]: integer, [3]: table?} @@ -109,14 +86,14 @@ local function dump(info) else hasFields = true end - codeBuf[#codeBuf+1] = string.format('%s=%s' + codeBuf[#codeBuf+1] = sformat('%s=%s' , formatKey(k) , formatValue(v) ) end codeBuf[#codeBuf+1] = '}' - codeBuf[#codeBuf+1] = string.format(',%d', formatValue(info[2])) + codeBuf[#codeBuf+1] = sformat(',%d', formatValue(info[2])) if info[3] then codeBuf[#codeBuf+1] = ',{' @@ -127,7 +104,7 @@ local function dump(info) else hasFields = true end - codeBuf[#codeBuf+1] = string.format('%s=%s' + codeBuf[#codeBuf+1] = sformat('%s=%s' , formatKey(k) , formatValue(v) ) @@ -137,7 +114,7 @@ local function dump(info) codeBuf[#codeBuf + 1] = '}' - return table.concat(codeBuf) + return tconcat(codeBuf) end ---@param obj table|function|userdata|thread @@ -183,7 +160,7 @@ end ---@param writter fun(id: integer, code: string): boolean ---@param reader fun(id: integer): string? function mt:bind(writter, reader) - setmetatable(self.codeMap, { + setmt(self.codeMap, { __newindex = function (t, id, code) local suc = writter(id, code) if not suc then @@ -209,11 +186,6 @@ function mt:entry() local codeMap = self.codeMap local refMap = self.refMap local instMap = self.instMap - local load = load - local setmt = setmetatable - local sdump = string.dump - local type = type - local sbyte = string.byte local tableID = self.tableID ---@type table local idMap = {} @@ -230,9 +202,9 @@ function mt:entry() if not f then return nil end - if sbyte(code, 1, 1) ~= 27 then - codeMap[id] = sdump(f, true) - end + --if sbyte(code, 1, 1) ~= 27 then + -- codeMap[id] = sdump(f, true) + --end local info = f() map[t] = info return info @@ -333,9 +305,9 @@ function mt:entry() end, } - setmetatable(idMap, { __mode = 'k' }) + setmt(idMap, { __mode = 'k' }) - setmetatable(instMap, { + setmt(instMap, { __mode = 'v', __index = function (map, id) local inst = {} @@ -362,7 +334,7 @@ local m = {} ---@param reader? fun(id: integer): string? ---@return lazytable.builder function m.build(t, writter, reader) - local builder = setmetatable({ + local builder = setmt({ source = t, codeMap = {}, refMap = {}, From 82ff780ca08bb6b7070746b87a52cf4ac3b5068a Mon Sep 17 00:00:00 2001 From: CppCXY <812125110@qq.com> Date: Tue, 23 Aug 2022 10:19:10 +0800 Subject: [PATCH 048/965] =?UTF-8?q?=E6=B5=8B=E8=AF=95type=20format?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rd/EmmyLuaCodeStyle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 3ab6c9ff8..763d15e01 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 3ab6c9ff8b91e07c3135afaa6620bd528aa7628a +Subproject commit 763d15e0160aca5535f3c3b938b2230cbaea4c90 From 9431b01e34905dcb053cc971ebc9f17936ce0bac Mon Sep 17 00:00:00 2001 From: CppCXY <812125110@qq.com> Date: Tue, 23 Aug 2022 14:17:26 +0800 Subject: [PATCH 049/965] =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=A1=AB=E8=A1=A5table=5Fsep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rd/EmmyLuaCodeStyle | 2 +- script/config/template.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index 763d15e01..ec0311bf6 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit 763d15e0160aca5535f3c3b938b2230cbaea4c90 +Subproject commit ec0311bf65ce5655607437a76c98f1edc1319083 diff --git a/script/config/template.lua b/script/config/template.lua index 14c341e1a..09ba61eaf 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -375,7 +375,8 @@ local template = { ['Lua.typeFormat.config'] = Type.Hash(Type.String, Type.String) >> { format_line = "true", - auto_complete_end = "true" + auto_complete_end = "true", + auto_complete_table_sep = "true" }, ['Lua.spell.dict'] = Type.Array(Type.String), ['Lua.telemetry.enable'] = Type.Or(Type.Boolean >> false, Type.Nil) >> nil, From 47ae75485c5735d5f5960db84de8e706457fabe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 24 Aug 2022 21:18:22 +0800 Subject: [PATCH 050/965] cleanup document-symbol --- script/core/document-symbol.lua | 130 ++++++++++++---------------- test/document_symbol/init.lua | 149 +++++++++++++++++++++----------- 2 files changed, 153 insertions(+), 126 deletions(-) diff --git a/script/core/document-symbol.lua b/script/core/document-symbol.lua index 6629ccbc9..90d312e37 100644 --- a/script/core/document-symbol.lua +++ b/script/core/document-symbol.lua @@ -23,6 +23,12 @@ local function buildName(source, text) return text:sub(startOffset + 1, finishOffset) end end + if source.type == 'tableindex' then + if source.index then + local finishOffset = guide.positionToOffset(state, source.finish) + return text:sub(startOffset + 1, finishOffset) + end + end local finishOffset = guide.positionToOffset(state, source.finish) return text:sub(startOffset + 1, finishOffset) end @@ -46,39 +52,6 @@ local function buildFunctionParams(func) return table.concat(params, ', ') end -local function buildFunction(source, text, symbols) - local name = buildName(source, text) - local func = source.value - if source.type == 'tablefield' - or source.type == 'setfield' then - source = source.field - if not source then - return - end - end - local range, kind - if func.start > source.finish then - -- a = function() - range = { source.start, func.finish } - else - -- function f() - range = { func.start, func.finish } - end - if source.type == 'setmethod' then - kind = define.SymbolKind.Method - else - kind = define.SymbolKind.Function - end - symbols[#symbols+1] = { - name = name, - detail = ('function (%s)'):format(buildFunctionParams(func)), - kind = kind, - range = range, - selectionRange = { source.start, source.finish }, - valueRange = { func.start, func.finish }, - } -end - local function buildTable(tbl) local buf = {} for i = 1, 3 do @@ -91,107 +64,110 @@ local function buildTable(tbl) buf[#buf+1] = ('%s'):format(field.field[1]) end end + if #tbl > 3 then + buf[#buf+1] = ('...(+%d)'):format(#tbl - 3) + end return table.concat(buf, ', ') end -local function buildValue(source, text, symbols) +local function buildValue(source, text, used, symbols) local name = buildName(source, text) local range, sRange, valueRange, kind local details = {} - if source.type == 'local' then + if source.type == 'local' then if source.parent.type == 'funcargs' then - details[1] = 'param' - range = { source.start, source.finish } - sRange = { source.start, source.finish } - kind = define.SymbolKind.Constant + kind = define.SymbolKind.Constant else - details[1] = 'local' - range = { source.start, source.finish } - sRange = { source.start, source.finish } - kind = define.SymbolKind.Variable + kind = define.SymbolKind.Variable end + range = { source.start, source.finish } + sRange = { source.start, source.finish } elseif source.type == 'setlocal' then - details[1] = 'setlocal' range = { source.start, source.finish } sRange = { source.start, source.finish } - kind = define.SymbolKind.Variable elseif source.type == 'setglobal' then - details[1] = 'global' range = { source.start, source.finish } sRange = { source.start, source.finish } - kind = define.SymbolKind.Class elseif source.type == 'tablefield' then if not source.field then return end - details[1] = 'field' range = { source.field.start, source.field.finish } sRange = { source.field.start, source.field.finish } - kind = define.SymbolKind.Property + elseif source.type == 'tableindex' then + if not source.index then + return + end + range = { source.index.start, source.index.finish } + sRange = { source.index.start, source.index.finish } elseif source.type == 'setfield' then if not source.field then return end - details[1] = 'field' range = { source.field.start, source.field.finish } sRange = { source.field.start, source.field.finish } - kind = define.SymbolKind.Field + elseif source.type == 'setmethod' then + if not source.method then + return + end + range = { source.method.start, source.method.finish } + sRange = { source.start, source.finish } else return end if source.value then + used[source.value] = true local literal = source.value[1] if source.value.type == 'boolean' then - details[2] = ' boolean' + kind = define.SymbolKind.Boolean if literal ~= nil then - details[3] = ' = ' - details[4] = util.viewLiteral(source.value[1]) + details[#details+1] = util.viewLiteral(source.value[1]) end elseif source.value.type == 'string' then - details[2] = ' string' + kind = define.SymbolKind.String if literal ~= nil then - details[3] = ' = ' - details[4] = util.viewLiteral(source.value[1]) + details[#details+1] = util.viewLiteral(source.value[1]) end elseif source.value.type == 'number' or source.value.type == 'integer' then - details[2] = ' number' + kind = define.SymbolKind.Number if literal ~= nil then - details[3] = ' = ' - details[4] = util.viewLiteral(source.value[1]) + details[#details+1] = util.viewLiteral(source.value[1]) end elseif source.value.type == 'table' then - details[2] = ' {' - details[3] = buildTable(source.value) - details[4] = '}' + kind = define.SymbolKind.Object + if #source.value > 0 then + details[#details+1] = '{' + details[#details+1] = buildTable(source.value) + details[#details+1] = '}' + end valueRange = { source.value.start, source.value.finish } elseif source.value.type == 'select' then if source.value.vararg and source.value.vararg.type == 'call' then valueRange = { source.value.start, source.value.finish } end + elseif source.value.type == 'function' then + details[#details+1] = ('function (%s)'):format(buildFunctionParams(source.value)) + if source.type == 'setmethod' then + kind = define.SymbolKind.Method + else + kind = define.SymbolKind.Function + end + valueRange = { source.value.start, source.value.finish } + range[1] = math.min(source.value.start, source.start) end range = { range[1], source.value.finish } end symbols[#symbols+1] = { name = name, detail = table.concat(details), - kind = kind, + kind = kind or define.SymbolKind.Variable, range = range, selectionRange = sRange, valueRange = valueRange, } end -local function buildSet(source, text, used, symbols) - local value = source.value - if value and value.type == 'function' then - used[value] = true - buildFunction(source, text, symbols) - else - buildValue(source, text, symbols) - end -end - local function buildAnonymousFunction(source, text, used, symbols) if used[source] then return @@ -223,9 +199,11 @@ local function buildSource(source, text, used, symbols) or source.type == 'setglobal' or source.type == 'setfield' or source.type == 'setmethod' - or source.type == 'tablefield' then + or source.type == 'tablefield' + or source.type == 'tableexp' + or source.type == 'tableindex' then await.delay() - buildSet(source, text, used, symbols) + buildValue(source, text, used, symbols) elseif source.type == 'function' then await.delay() buildAnonymousFunction(source, text, used, symbols) diff --git a/test/document_symbol/init.lua b/test/document_symbol/init.lua index 4ce755738..2150e8790 100644 --- a/test/document_symbol/init.lua +++ b/test/document_symbol/init.lua @@ -62,8 +62,8 @@ A = 1 { [1] = { name = 'A', - detail = 'global number = 1', - kind = define.SymbolKind.Class, + detail = '1', + kind = define.SymbolKind.Number, range = {0, 5}, selectionRange = {0, 1}, } @@ -219,8 +219,8 @@ local z { [1] = { name = 'x', - detail = 'local number = 1', - kind = define.SymbolKind.Variable, + detail = '1', + kind = define.SymbolKind.Number, range = {6, 11}, selectionRange = {6, 7}, }, @@ -234,15 +234,15 @@ local z children = { [1] = { name = 'x', - detail = 'local string = "x"', - kind = define.SymbolKind.Variable, + detail = '"x"', + kind = define.SymbolKind.String, range = {20010, 20017}, selectionRange = {20010, 20011}, }, [2] = { name = 'y', - detail = 'local {}', - kind = define.SymbolKind.Variable, + detail = '', + kind = define.SymbolKind.Object, range = {30010, 30016}, selectionRange = {30010, 30011}, valueRange = {30014, 30016}, @@ -259,14 +259,14 @@ local z }, [3] = { name = 'y', - detail = 'local boolean = true', - kind = define.SymbolKind.Variable, + detail = 'true', + kind = define.SymbolKind.Boolean, range = {60006, 60014}, selectionRange = {60006, 60007}, }, [4] = { name = 'z', - detail = 'local', + detail = '', kind = define.SymbolKind.Variable, range = {70006, 70007}, selectionRange = {70006, 70007}, @@ -283,33 +283,82 @@ local t = { { [1] = { name = 't', - detail = 'local {a, b, c}', - kind = define.SymbolKind.Variable, + detail = '{a, b, c}', + kind = define.SymbolKind.Object, range = {6, 40001}, selectionRange = {6, 7}, valueRange = {10, 40001}, children = { [1] = { name = 'a', - detail = 'field number = 1', - kind = define.SymbolKind.Property, + detail = '1', + kind = define.SymbolKind.Number, + range = {10004, 10009}, + selectionRange = {10004, 10005}, + }, + [2] = { + name = 'b', + detail = '2', + kind = define.SymbolKind.Number, + range = {20004, 20009}, + selectionRange = {20004, 20005}, + }, + [3] = { + name = 'c', + detail = '3', + kind = define.SymbolKind.Number, + range = {30004, 30009}, + selectionRange = {30004, 30005}, + }, + } + } +} + +TEST [[ +local t = { + a = 1, + b = 2, + c = 3, + d = 4, +} +]] +{ + [1] = { + name = 't', + detail = '{a, b, c, ...(+1)}', + kind = define.SymbolKind.Object, + range = {6, 50001}, + selectionRange = {6, 7}, + valueRange = {10, 50001}, + children = { + [1] = { + name = 'a', + detail = '1', + kind = define.SymbolKind.Number, range = {10004, 10009}, selectionRange = {10004, 10005}, }, [2] = { name = 'b', - detail = 'field number = 2', - kind = define.SymbolKind.Property, + detail = '2', + kind = define.SymbolKind.Number, range = {20004, 20009}, selectionRange = {20004, 20005}, }, [3] = { name = 'c', - detail = 'field number = 3', - kind = define.SymbolKind.Property, + detail = '3', + kind = define.SymbolKind.Number, range = {30004, 30009}, selectionRange = {30004, 30005}, }, + [4] = { + name = 'd', + detail = '4', + kind = define.SymbolKind.Number, + range = {40004, 40009}, + selectionRange = {40004, 40005}, + }, } } } @@ -324,24 +373,24 @@ local t = { { [1] = { name = 't', - detail = 'local {a}', - kind = define.SymbolKind.Variable, + detail = '{a}', + kind = define.SymbolKind.Object, range = {6, 40001}, selectionRange = {6, 7}, valueRange = {10, 40001}, children = { [1] = { name = 'a', - detail = 'field {b}', - kind = define.SymbolKind.Property, + detail = '{b}', + kind = define.SymbolKind.Object, range = {10004, 30005}, selectionRange = {10004, 10005}, valueRange = {10008, 30005}, children = { [1] = { name = 'b', - detail = EXISTS, - kind = define.SymbolKind.Property, + detail = '1', + kind = define.SymbolKind.Number, range = {20008, 20013}, selectionRange = {20008, 20009}, } @@ -367,8 +416,8 @@ g = 1 }, [2] = { name = 'g', - detail = 'setlocal number = 1', - kind = define.SymbolKind.Variable, + detail = '1', + kind = define.SymbolKind.Number, range = {30000, 30005}, selectionRange = {30000, 30001}, } @@ -390,21 +439,21 @@ end children = { [1] = { name = 'a', - detail = 'param', + detail = '', kind = define.SymbolKind.Constant, range = {11, 12}, selectionRange = {11, 12}, }, [2] = { name = 'b', - detail = 'param', + detail = '', kind = define.SymbolKind.Constant, range = {14, 15}, selectionRange = {14, 15}, }, [3] = { name = 'x', - detail = 'local', + detail = '', kind = define.SymbolKind.Variable, range = {10010, 10017}, selectionRange = {10010, 10011}, @@ -423,8 +472,8 @@ local v = t ]]{ [1] = { name = 't', - detail = 'local {a, b}', - kind = define.SymbolKind.Variable, + detail = '{a, b}', + kind = define.SymbolKind.Object, range = {6, 30001}, selectionRange = {6, 7}, valueRange = {10, 30001}, @@ -432,7 +481,7 @@ local v = t }, [2] = { name = 'v', - detail = 'local', + detail = '', kind = define.SymbolKind.Variable, range = {50006, 50011}, selectionRange = {50006, 50007}, @@ -445,7 +494,7 @@ local function ]]{ [1] = { name = 'x', - detail = 'local', + detail = '', kind = define.SymbolKind.Variable, range = {6, 7}, selectionRange = {6, 7}, @@ -453,7 +502,7 @@ local function [2] = { name = "", detail = "function ()", - kind = 12, + kind = define.SymbolKind.Function, range = {10006, 10014}, selectionRange = {10006, 10014}, valueRange = {10006, 10014}, @@ -474,8 +523,8 @@ local a, b = { ]]{ [1] = { name = 'a', - detail = 'local {x1, y1, z1}', - kind = define.SymbolKind.Variable, + detail = '{x1, y1, z1}', + kind = define.SymbolKind.Object, range = {6, 40001}, selectionRange = {6, 7}, valueRange = {13, 40001}, @@ -483,8 +532,8 @@ local a, b = { }, [2] = { name = 'b', - detail = 'local {x2, y2, z2}', - kind = define.SymbolKind.Variable, + detail = '{x2, y2, z2}', + kind = define.SymbolKind.Object, range = {9, 80001}, selectionRange = {9, 10}, valueRange = {40003, 80001}, @@ -519,7 +568,7 @@ end children = { [1] = { name = 'c', - detail = 'local', + detail = '', kind = define.SymbolKind.Variable, range = {40010, 40011}, selectionRange = {40010, 40011}, @@ -536,7 +585,7 @@ local t = f({ { [1] = { name = 't', - detail = 'local', + detail = '', kind = define.SymbolKind.Variable, range = {6, 20002}, selectionRange = {6, 7}, @@ -544,8 +593,8 @@ local t = f({ children = { [1] = { name = 'k', - detail = 'field number = 1', - kind = define.SymbolKind.Property, + detail = '1', + kind = define.SymbolKind.Number, range = {10004, 10009}, selectionRange = {10004, 10005}, } @@ -562,8 +611,8 @@ end { [1] = { name = 't', - detail = 'local {}', - kind = define.SymbolKind.Variable, + detail = '', + kind = define.SymbolKind.Object, range = {6, 12}, selectionRange = {6, 7}, valueRange = {10, 12}, @@ -578,14 +627,14 @@ end children = { [1] = { name = 'a', - detail = 'param', + detail = '', kind = define.SymbolKind.Constant, range = {20017, 20018}, selectionRange = {20017, 20018}, }, [2] = { name = 'b', - detail = 'param', + detail = '', kind = define.SymbolKind.Constant, range = {20020, 20021}, selectionRange = {20020, 20021}, @@ -603,7 +652,7 @@ local a = f { { [1] = { name = 'a', - detail = 'local', + detail = '', kind = define.SymbolKind.Variable, range = {6, 30001}, selectionRange = {6, 7}, @@ -649,8 +698,8 @@ local root = { { [1] = { name = 'root', - detail = 'local {inner_function}', - kind = define.SymbolKind.Variable, + detail = '{inner_function}', + kind = define.SymbolKind.Object, range = {6, 50001}, selectionRange = {6, 10}, valueRange = {13, 50001}, From 95deef9c3415dfa83b39a4e4f039dc7728fce544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 25 Aug 2022 18:33:00 +0800 Subject: [PATCH 051/965] update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/bee.lua | 2 +- 3rd/luamake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index ec0311bf6..cd4708ea6 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit ec0311bf65ce5655607437a76c98f1edc1319083 +Subproject commit cd4708ea62d69af246e365dc99ec118470ade5bb diff --git a/3rd/bee.lua b/3rd/bee.lua index aae3d3092..301ad6090 160000 --- a/3rd/bee.lua +++ b/3rd/bee.lua @@ -1 +1 @@ -Subproject commit aae3d3092d144dedb594271be605ea6fdf078eeb +Subproject commit 301ad60903efb06e1b0fce621981bb2cb5ea8c3f diff --git a/3rd/luamake b/3rd/luamake index 6c1e8348b..db9d087a8 160000 --- a/3rd/luamake +++ b/3rd/luamake @@ -1 +1 @@ -Subproject commit 6c1e8348bfff93f0d2ac73f52bd667e0ab033f63 +Subproject commit db9d087a8f5574895c5558567fd957041cedabfd From f0375c8fb10c9205be49ec9cbbaa83a9c0638641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 25 Aug 2022 18:42:34 +0800 Subject: [PATCH 052/965] update document-symbol --- script/core/document-symbol.lua | 66 ++++++++++++++++++++++---- test/document_symbol/init.lua | 84 ++++++++++++++++++++------------- 2 files changed, 107 insertions(+), 43 deletions(-) diff --git a/script/core/document-symbol.lua b/script/core/document-symbol.lua index 90d312e37..2c9caafbe 100644 --- a/script/core/document-symbol.lua +++ b/script/core/document-symbol.lua @@ -3,6 +3,7 @@ local files = require 'files' local guide = require 'parser.guide' local define = require 'proto.define' local util = require 'utility' +local vm = require 'vm' local function buildName(source, text) local uri = guide.getUri(source) @@ -29,6 +30,9 @@ local function buildName(source, text) return text:sub(startOffset + 1, finishOffset) end end + if source.type == 'tableexp' then + return ('[%d]'):format(source.tindex) + end local finishOffset = guide.positionToOffset(state, source.finish) return text:sub(startOffset + 1, finishOffset) end @@ -53,8 +57,9 @@ local function buildFunctionParams(func) end local function buildTable(tbl) + local uri = guide.getUri(tbl) local buf = {} - for i = 1, 3 do + for i = 1, 5 do local field = tbl[i] if not field then break @@ -62,10 +67,34 @@ local function buildTable(tbl) if field.type == 'tablefield' and field.field then buf[#buf+1] = ('%s'):format(field.field[1]) + elseif field.type == 'tableindex' + and field.index then + local view = vm.getInfer(field.index):viewLiterals() + or vm.getInfer(field.index):view(uri) + buf[#buf+1] = ('[%s]'):format(view) + elseif field.type == 'tableexp' then + buf[#buf+1] = ('[%s]'):format(field.tindex) end end - if #tbl > 3 then - buf[#buf+1] = ('...(+%d)'):format(#tbl - 3) + if #tbl > 5 then + buf[#buf+1] = ('...(+%d)'):format(#tbl - 5) + end + return table.concat(buf, ', ') +end + +local function buildArray(tbl) + local uri = guide.getUri(tbl) + local buf = {} + for i = 1, 5 do + local field = tbl[i] + if not field then + break + end + buf[#buf+1] = vm.getInfer(field):viewLiterals() + or vm.getInfer(field):view(uri) + end + if #tbl > 5 then + buf[#buf+1] = ('...(+%d)'):format(#tbl - 5) end return table.concat(buf, ', ') end @@ -100,6 +129,9 @@ local function buildValue(source, text, used, symbols) end range = { source.index.start, source.index.finish } sRange = { source.index.start, source.index.finish } + elseif source.type == 'tableexp' then + range = { source.value.start, source.value.finish } + sRange = { source.value.start, source.value.finish } elseif source.type == 'setfield' then if not source.field then return @@ -136,10 +168,21 @@ local function buildValue(source, text, used, symbols) end elseif source.value.type == 'table' then kind = define.SymbolKind.Object + local lastField = source.value[#source.value] if #source.value > 0 then - details[#details+1] = '{' - details[#details+1] = buildTable(source.value) - details[#details+1] = '}' + if lastField.type == 'tableexp' + and lastField.tindex == #source.value then + -- Array + kind = define.SymbolKind.Array + details[#details+1] = '[' + details[#details+1] = buildArray(source.value) + details[#details+1] = ']' + else + -- Object + details[#details+1] = '{' + details[#details+1] = buildTable(source.value) + details[#details+1] = '}' + end end valueRange = { source.value.start, source.value.finish } elseif source.value.type == 'select' then @@ -192,7 +235,6 @@ local function buildAnonymousFunction(source, text, used, symbols) } end ----@async local function buildSource(source, text, used, symbols) if source.type == 'local' or source.type == 'setlocal' @@ -202,10 +244,8 @@ local function buildSource(source, text, used, symbols) or source.type == 'tablefield' or source.type == 'tableexp' or source.type == 'tableindex' then - await.delay() buildValue(source, text, used, symbols) elseif source.type == 'function' then - await.delay() buildAnonymousFunction(source, text, used, symbols) end end @@ -220,8 +260,14 @@ local function makeSymbol(uri) local symbols = {} local used = {} - guide.eachSource(ast.ast, function (source) ---@async + local i = 0 + ---@async + guide.eachSource(ast.ast, function (source) buildSource(source, text, used, symbols) + i = i + 1 + if i % 1000 == 0 then + await.delay() + end end) return symbols diff --git a/test/document_symbol/init.lua b/test/document_symbol/init.lua index 2150e8790..6f80287f1 100644 --- a/test/document_symbol/init.lua +++ b/test/document_symbol/init.lua @@ -320,46 +320,19 @@ local t = { b = 2, c = 3, d = 4, + e = 5, + f = 6, } ]] { [1] = { name = 't', - detail = '{a, b, c, ...(+1)}', + detail = '{a, b, c, d, e, ...(+1)}', kind = define.SymbolKind.Object, - range = {6, 50001}, + range = {6, 70001}, selectionRange = {6, 7}, - valueRange = {10, 50001}, - children = { - [1] = { - name = 'a', - detail = '1', - kind = define.SymbolKind.Number, - range = {10004, 10009}, - selectionRange = {10004, 10005}, - }, - [2] = { - name = 'b', - detail = '2', - kind = define.SymbolKind.Number, - range = {20004, 20009}, - selectionRange = {20004, 20005}, - }, - [3] = { - name = 'c', - detail = '3', - kind = define.SymbolKind.Number, - range = {30004, 30009}, - selectionRange = {30004, 30005}, - }, - [4] = { - name = 'd', - detail = '4', - kind = define.SymbolKind.Number, - range = {40004, 40009}, - selectionRange = {40004, 40005}, - }, - } + valueRange = {10, 70001}, + children = EXISTS, } } @@ -725,3 +698,48 @@ local root = { }, } } + +TEST [[ +local t = { 1, 2, 3 } +]] +{ + [1] = { + name = 't', + detail = '[1, 2, 3]', + kind = define.SymbolKind.Array, + range = {6, 21}, + selectionRange = {6, 7}, + valueRange = {10, 21}, + children = EXISTS + } +} + +TEST [[ +local t = { 1, 2, 3, 4, 5, 6 } +]] +{ + [1] = { + name = 't', + detail = '[1, 2, 3, 4, 5, ...(+1)]', + kind = define.SymbolKind.Array, + range = {6, 30}, + selectionRange = {6, 7}, + valueRange = {10, 30}, + children = EXISTS, + } +} + +TEST [[ +local t = { 1, 2, [5] = 3, [true] = 4, x = 5 } +]] +{ + [1] = { + name = 't', + detail = '{[1], [2], [5], [true], x}', + kind = define.SymbolKind.Object, + range = {6, 46}, + selectionRange = {6, 7}, + valueRange = {10, 46}, + children = EXISTS + } +} From cfda344c9e0db732e72128e74f40d2ad2b4ea3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 25 Aug 2022 19:09:49 +0800 Subject: [PATCH 053/965] update --- script/lazytable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lazytable.lua b/script/lazytable.lua index d162b4c83..f964f236c 100644 --- a/script/lazytable.lua +++ b/script/lazytable.lua @@ -340,7 +340,7 @@ function m.build(t, writter, reader) refMap = {}, instMap = {}, dumpMark = {}, - excludes = {}, + excludes = setmt({}, { __mode = 'k' }), }, mt) if writter and reader then From fa0fe1c857a83d8595d687e49205d7d548aba0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 29 Aug 2022 17:21:59 +0800 Subject: [PATCH 054/965] `document-symbol` supports block --- .luarc.json | 5 ++ changelog.md | 1 + script/core/document-symbol.lua | 113 ++++++++++++++++++++++---------- script/parser/compile.lua | 6 +- test/document_symbol/init.lua | 95 +++++++++++++++++++++++++++ 5 files changed, 181 insertions(+), 39 deletions(-) diff --git a/.luarc.json b/.luarc.json index 64e09c460..b441d4266 100644 --- a/.luarc.json +++ b/.luarc.json @@ -41,6 +41,11 @@ ], "checkThirdParty": false }, + "typeFormat": { + "config": { + "format_line": "false" + } + }, "type": { "castNumberToInteger": false } diff --git a/changelog.md b/changelog.md index f342fa69b..9ef807132 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 3.5.4 +* `CHG` `document-symbol`: redesigned to better support for `Sticky Scroll` feature of VSCode * `FIX` `diagnostics.workspaceDelay` can not prevent first workspace diagnostic * `FIX` [#1476](https://github.com/sumneko/lua-language-server/issues/1476) diff --git a/script/core/document-symbol.lua b/script/core/document-symbol.lua index 2c9caafbe..6fbd63f3d 100644 --- a/script/core/document-symbol.lua +++ b/script/core/document-symbol.lua @@ -3,38 +3,31 @@ local files = require 'files' local guide = require 'parser.guide' local define = require 'proto.define' local util = require 'utility' -local vm = require 'vm' +local subber = require 'core.substring' -local function buildName(source, text) - local uri = guide.getUri(source) - local state = files.getState(uri) - local startOffset = guide.positionToOffset(state, source.start) +local function buildName(source, sub) if source.type == 'setmethod' or source.type == 'getmethod' then if source.method then - local finishOffset = guide.positionToOffset(state, source.method.finish) - return text:sub(startOffset + 1, finishOffset) + return sub(source.start + 1, source.method.finish) end end if source.type == 'setfield' or source.type == 'tablefield' or source.type == 'getfield' then if source.field then - local finishOffset = guide.positionToOffset(state, source.field.finish) - return text:sub(startOffset + 1, finishOffset) + return sub(source.start + 1, source.field.finish) end end if source.type == 'tableindex' then if source.index then - local finishOffset = guide.positionToOffset(state, source.finish) - return text:sub(startOffset + 1, finishOffset) + return sub(source.start + 1, source.finish) end end if source.type == 'tableexp' then return ('[%d]'):format(source.tindex) end - local finishOffset = guide.positionToOffset(state, source.finish) - return text:sub(startOffset + 1, finishOffset) + return sub(source.start + 1, source.finish) end local function buildFunctionParams(func) @@ -56,8 +49,7 @@ local function buildFunctionParams(func) return table.concat(params, ', ') end -local function buildTable(tbl) - local uri = guide.getUri(tbl) +local function buildTable(tbl, sub) local buf = {} for i = 1, 5 do local field = tbl[i] @@ -69,9 +61,7 @@ local function buildTable(tbl) buf[#buf+1] = ('%s'):format(field.field[1]) elseif field.type == 'tableindex' and field.index then - local view = vm.getInfer(field.index):viewLiterals() - or vm.getInfer(field.index):view(uri) - buf[#buf+1] = ('[%s]'):format(view) + buf[#buf+1] = ('[%s]'):format(sub(field.index.start + 1, field.index.finish)) elseif field.type == 'tableexp' then buf[#buf+1] = ('[%s]'):format(field.tindex) end @@ -82,16 +72,14 @@ local function buildTable(tbl) return table.concat(buf, ', ') end -local function buildArray(tbl) - local uri = guide.getUri(tbl) +local function buildArray(tbl, sub) local buf = {} for i = 1, 5 do local field = tbl[i] if not field then break end - buf[#buf+1] = vm.getInfer(field):viewLiterals() - or vm.getInfer(field):view(uri) + buf[#buf+1] = sub(field.start + 1, field.finish) end if #tbl > 5 then buf[#buf+1] = ('...(+%d)'):format(#tbl - 5) @@ -99,8 +87,8 @@ local function buildArray(tbl) return table.concat(buf, ', ') end -local function buildValue(source, text, used, symbols) - local name = buildName(source, text) +local function buildValue(source, sub, used, symbols) + local name = buildName(source, sub) local range, sRange, valueRange, kind local details = {} if source.type == 'local' then @@ -175,12 +163,12 @@ local function buildValue(source, text, used, symbols) -- Array kind = define.SymbolKind.Array details[#details+1] = '[' - details[#details+1] = buildArray(source.value) + details[#details+1] = buildArray(source.value, sub) details[#details+1] = ']' else -- Object details[#details+1] = '{' - details[#details+1] = buildTable(source.value) + details[#details+1] = buildTable(source.value, sub) details[#details+1] = '}' end end @@ -211,7 +199,7 @@ local function buildValue(source, text, used, symbols) } end -local function buildAnonymousFunction(source, text, used, symbols) +local function buildAnonymousFunction(source, sub, used, symbols) if used[source] then return end @@ -223,7 +211,7 @@ local function buildAnonymousFunction(source, text, used, symbols) elseif parent.type == 'callargs' then local call = parent.parent local node = call.node - head = buildName(node, text) .. ' -> ' + head = buildName(node, sub) .. ' -> ' end symbols[#symbols+1] = { name = '', @@ -235,7 +223,54 @@ local function buildAnonymousFunction(source, text, used, symbols) } end -local function buildSource(source, text, used, symbols) +local function buildBlock(source, sub, used, symbols) + if used[source] then + return + end + used[source] = true + if source.type == 'if' then + for _, block in ipairs(source) do + symbols[#symbols+1] = { + name = block.type:gsub('block$', ''), + detail = sub(block.start + 1, block.keyword[4] or block.keyword[2]), + kind = define.SymbolKind.Package, + range = { block.start, block.finish }, + valueRange = { block.start, block.finish }, + selectionRange = { block.keyword[1], block.keyword[2] }, + } + end + elseif source.type == 'while' then + symbols[#symbols+1] = { + name = 'while', + detail = sub(source.start + 1, source.keyword[4] or source.keyword[2]), + kind = define.SymbolKind.Package, + range = { source.start, source.finish }, + valueRange = { source.start, source.finish }, + selectionRange = { source.keyword[1], source.keyword[2] }, + } + elseif source.type == 'repeat' then + symbols[#symbols+1] = { + name = 'repeat', + detail = source.filter and sub(source.keyword[3] + 1, source.filter.finish) or '', + kind = define.SymbolKind.Package, + range = { source.start, source.finish }, + valueRange = { source.start, source.finish }, + selectionRange = { source.keyword[1], source.keyword[2] }, + } + elseif source.type == 'loop' + or source.type == 'in' then + symbols[#symbols+1] = { + name = 'for', + detail = sub(source.start, source.keyword[4] or source.keyword[2]), + kind = define.SymbolKind.Package, + range = { source.start, source.finish }, + valueRange = { source.start, source.finish }, + selectionRange = { source.keyword[1], source.keyword[2] }, + } + end +end + +local function buildSource(source, sub, used, symbols) if source.type == 'local' or source.type == 'setlocal' or source.type == 'setglobal' @@ -244,26 +279,32 @@ local function buildSource(source, text, used, symbols) or source.type == 'tablefield' or source.type == 'tableexp' or source.type == 'tableindex' then - buildValue(source, text, used, symbols) + buildValue(source, sub, used, symbols) elseif source.type == 'function' then - buildAnonymousFunction(source, text, used, symbols) + buildAnonymousFunction(source, sub, used, symbols) + elseif source.type == 'if' + or source.type == 'while' + or source.type == 'in' + or source.type == 'loop' + or source.type == 'repeat' then + buildBlock(source, sub, used, symbols) end end ---@async local function makeSymbol(uri) - local ast = files.getState(uri) - local text = files.getText(uri) - if not ast or not text then + local state = files.getState(uri) + if not state then return nil end + local sub = subber(state) local symbols = {} local used = {} local i = 0 ---@async - guide.eachSource(ast.ast, function (source) - buildSource(source, text, used, symbols) + guide.eachSource(state.ast, function (source) + buildSource(source, sub, used, symbols) i = i + 1 if i % 1000 == 0 then await.delay() diff --git a/script/parser/compile.lua b/script/parser/compile.lua index 915a2764b..33ac4d699 100644 --- a/script/parser/compile.lua +++ b/script/parser/compile.lua @@ -3191,7 +3191,7 @@ local function parseIfBlock(parent) pushChunk(ifblock) parseActions() popChunk() - ifblock.finish = lastRightPosition() + ifblock.finish = getPosition(Tokens[Index], 'left') if ifblock.locals then LocalCount = LocalCount - #ifblock.locals end @@ -3250,7 +3250,7 @@ local function parseElseIfBlock(parent) pushChunk(elseifblock) parseActions() popChunk() - elseifblock.finish = lastRightPosition() + elseifblock.finish = getPosition(Tokens[Index], 'left') if elseifblock.locals then LocalCount = LocalCount - #elseifblock.locals end @@ -3275,7 +3275,7 @@ local function parseElseBlock(parent) pushChunk(elseblock) parseActions() popChunk() - elseblock.finish = lastRightPosition() + elseblock.finish = getPosition(Tokens[Index], 'left') if elseblock.locals then LocalCount = LocalCount - #elseblock.locals end diff --git a/test/document_symbol/init.lua b/test/document_symbol/init.lua index 6f80287f1..17728efc9 100644 --- a/test/document_symbol/init.lua +++ b/test/document_symbol/init.lua @@ -743,3 +743,98 @@ local t = { 1, 2, [5] = 3, [true] = 4, x = 5 } children = EXISTS } } + +TEST [[ +if 1 then + +elseif 2 then + +elseif 3 then + +else + +end +]] +{ + { + name = 'if', + detail = 'if 1 then', + kind = define.SymbolKind.Package, + range = {0, 20000}, + selectionRange = {0, 2}, + valueRange = {0, 20000}, + }, + { + name = 'elseif', + detail = 'elseif 2 then', + kind = define.SymbolKind.Package, + range = {20000, 40000}, + selectionRange = {20000, 20006}, + valueRange = {20000, 40000}, + }, + { + name = 'elseif', + detail = 'elseif 3 then', + kind = define.SymbolKind.Package, + range = {40000, 60000}, + selectionRange = {40000, 40006}, + valueRange = {40000, 60000}, + }, + { + name = 'else', + detail = 'else', + kind = define.SymbolKind.Package, + range = {60000, 80000}, + selectionRange = {60000, 60004}, + valueRange = {60000, 80000}, + }, +} + +TEST [[ +while true do + +end +]] +{ + { + name = 'while', + detail = 'while true do', + kind = define.SymbolKind.Package, + range = {0, 20003}, + selectionRange = {0, 5}, + valueRange = {0, 20003}, + }, +} + +TEST [[ +repeat + +until true +]] +{ + { + name = 'repeat', + detail = 'until true', + kind = define.SymbolKind.Package, + range = {0, 20010}, + selectionRange = {0, 6}, + valueRange = {0, 20010}, + }, +} + +TEST [[ +for i = 1, 10 do + +end +]] +{ + { + name = 'for', + detail = 'for i = 1, 10 do', + kind = define.SymbolKind.Package, + range = {0, 20003}, + selectionRange = {0, 3}, + valueRange = {0, 20003}, + children = EXISTS, + }, +} From 6391ccaa3b298d2f4d2b7704a592ada29ee06c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 29 Aug 2022 17:22:25 +0800 Subject: [PATCH 055/965] update submodules --- 3rd/EmmyLuaCodeStyle | 2 +- 3rd/lovr-api | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3rd/EmmyLuaCodeStyle b/3rd/EmmyLuaCodeStyle index cd4708ea6..7bd04b31c 160000 --- a/3rd/EmmyLuaCodeStyle +++ b/3rd/EmmyLuaCodeStyle @@ -1 +1 @@ -Subproject commit cd4708ea62d69af246e365dc99ec118470ade5bb +Subproject commit 7bd04b31ccb56422d0e22271c6599d1ed0743ddf diff --git a/3rd/lovr-api b/3rd/lovr-api index 987aa3d73..8fa189d7c 160000 --- a/3rd/lovr-api +++ b/3rd/lovr-api @@ -1 +1 @@ -Subproject commit 987aa3d73ea477f74bc8ed3e396414c7e96e75fb +Subproject commit 8fa189d7cd2529a8af32461c1cb92faa40efe094 From c700a5fc23e00f95166e883764276a6f61803d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 29 Aug 2022 17:23:09 +0800 Subject: [PATCH 056/965] build lovr --- meta/3rd/lovr/library/callback.lua | 2 +- meta/3rd/lovr/library/lovr/data.lua | 890 +++++ meta/3rd/lovr/library/lovr/event.lua | 3 +- meta/3rd/lovr/library/lovr/graphics.lua | 4033 ++++++++++------------- meta/3rd/lovr/library/lovr/headset.lua | 6 + meta/3rd/lovr/library/lovr/math.lua | 6 +- 6 files changed, 2597 insertions(+), 2343 deletions(-) diff --git a/meta/3rd/lovr/library/callback.lua b/meta/3rd/lovr/library/callback.lua index 13cbef519..a257b5f6b 100644 --- a/meta/3rd/lovr/library/callback.lua +++ b/meta/3rd/lovr/library/callback.lua @@ -35,7 +35,7 @@ lovr.conf = nil --- ---The display is cleared to the background color before this function is called. --- ----@type fun() +---@type fun(pass: lovr.Pass):boolean lovr.draw = nil --- diff --git a/meta/3rd/lovr/library/lovr/data.lua b/meta/3rd/lovr/library/lovr/data.lua index 9c53bab02..811433e71 100644 --- a/meta/3rd/lovr/library/lovr/data.lua +++ b/meta/3rd/lovr/library/lovr/data.lua @@ -268,6 +268,492 @@ function Image:setPixel(x, y, r, g, b, a) end ---@class lovr.ModelData local ModelData = {} +--- +---Returns the number of channels in an animation. +--- +---A channel is a set of keyframes for a single property of a node. +--- +---@overload fun(self: lovr.ModelData, name: string):number +---@param index number # The index of an animation. +---@return number count # The number of channels in the animation. +function ModelData:getAnimationChannelCount(index) end + +--- +---Returns the number of animations in the model. +--- +---@return number count # The number of animations in the model. +function ModelData:getAnimationCount() end + +--- +---Returns the duration of an animation. +--- +--- +---### NOTE: +---The duration of the animation is calculated as the latest timestamp of all of its channels. +--- +---@overload fun(self: lovr.ModelData, name: string):number +---@param index number # The index of the animation. +---@return number duration # The duration of the animation, in seconds. +function ModelData:getAnimationDuration(index) end + +--- +---Returns a single keyframe in a channel of an animation. +--- +---@overload fun(self: lovr.ModelData, name: string, channel: number, keyframe: number):number, number +---@param index number # The index of an animation. +---@param channel number # The index of a channel in the animation. +---@param keyframe number # The index of a keyframe in the channel. +---@return number time # The timestamp of the keyframe. +function ModelData:getAnimationKeyframe(index, channel, keyframe) end + +--- +---Returns the number of keyframes in a channel of an animation. +--- +---@overload fun(self: lovr.ModelData, name: string, channel: number):number +---@param index number # The index of an animation. +---@param channel number # The index of a channel in the animation. +---@return number count # The number of keyframes in the channel. +function ModelData:getAnimationKeyframeCount(index, channel) end + +--- +---Returns the name of an animation. +--- +--- +---### NOTE: +---If the animation does not have a name, this function returns `nil`. +--- +---@param index number # The index of the animation. +---@return string name # The name of the animation. +function ModelData:getAnimationName(index) end + +--- +---Returns the index of a node targeted by an animation's channel. +--- +---@overload fun(self: lovr.ModelData, name: string, channel: number):number +---@param index number # The index of an animation. +---@param channel number # The index of a channel in the animation. +---@return number node # The index of the node targeted by the channel. +function ModelData:getAnimationNode(index, channel) end + +--- +---Returns the property targeted by an animation's channel. +--- +---@overload fun(self: lovr.ModelData, name: string, channel: number):lovr.AnimationProperty +---@param index number # The index of an animation. +---@param channel number # The index of a channel in the animation. +---@return lovr.AnimationProperty property # The property (translation, rotation, scale) affected by the keyframes. +function ModelData:getAnimationProperty(index, channel) end + +--- +---Returns the smooth mode of a channel in an animation. +--- +---@overload fun(self: lovr.ModelData, name: string, channel: number):lovr.SmoothMode +---@param index number # The index of an animation. +---@param channel number # The index of a channel in the animation. +---@return lovr.SmoothMode smooth # The smooth mode of the keyframes. +function ModelData:getAnimationSmoothMode(index, channel) end + +--- +---Returns one of the Blobs in the model, by index. +--- +---@param index number # The index of the Blob to get. +---@return lovr.Blob blob # The Blob object. +function ModelData:getBlob(index) end + +--- +---Returns the number of Blobs in the model. +--- +---@return number count # The number of Blobs in the model. +function ModelData:getBlobCount() end + +--- +---Returns the 6 values of the model's axis-aligned bounding box. +--- +---@return number minx # The minimum x coordinate of the vertices in the model. +---@return number maxx # The maximum x coordinate of the vertices in the model. +---@return number miny # The minimum y coordinate of the vertices in the model. +---@return number maxy # The maximum y coordinate of the vertices in the model. +---@return number minz # The minimum z coordinate of the vertices in the model. +---@return number maxz # The maximum z coordinate of the vertices in the model. +function ModelData:getBoundingBox() end + +--- +---Returns a sphere approximately enclosing the vertices in the model. +--- +---@return number x # The x coordinate of the position of the sphere. +---@return number y # The y coordinate of the position of the sphere. +---@return number z # The z coordinate of the position of the sphere. +---@return number radius # The radius of the bounding sphere. +function ModelData:getBoundingSphere() end + +--- +---Returns the center of the model's axis-aligned bounding box, relative to the model's origin. +--- +---@return number x # The x offset of the center of the bounding box. +---@return number y # The y offset of the center of the bounding box. +---@return number z # The z offset of the center of the bounding box. +function ModelData:getCenter() end + +--- +---Returns the depth of the model, computed from its axis-aligned bounding box. +--- +---@return number depth # The depth of the model. +function ModelData:getDepth() end + +--- +---Returns the width, height, and depth of the model, computed from its axis-aligned bounding box. +--- +---@return number width # The width of the model. +---@return number height # The height of the model. +---@return number depth # The depth of the model. +function ModelData:getDimensions() end + +--- +---Returns the height of the model, computed from its axis-aligned bounding box. +--- +---@return number height # The height of the model. +function ModelData:getHeight() end + +--- +---Returns one of the Images in the model, by index. +--- +---@param index number # The index of the Image to get. +---@return lovr.Image image # The Image object. +function ModelData:getImage(index) end + +--- +---Returns the number of Images in the model. +--- +---@return number count # The number of Images in the model. +function ModelData:getImageCount() end + +--- +---Returns a table with all of the properties of a material. +--- +--- +---### NOTE: +---All images are optional and may be `nil`. +--- +---@overload fun(self: lovr.ModelData, name: string):table +---@param index number # The index of a material. +---@return {color: table, glow: table, uvShift: table, uvScale: table, metalness: number, roughness: number, clearcoat: number, clearcoatRoughness: number, occlusionStrength: number, normalScale: number, alphaCutoff: number, texture: number, glowTexture: number, occlusionTexture: number, metalnessTexture: number, roughnessTexture: number, clearcoatTexture: number, normalTexture: number} properties # The material properties. +function ModelData:getMaterial(index) end + +--- +---Returns the number of materials in the model. +--- +---@return number count # The number of materials in the model. +function ModelData:getMaterialCount() end + +--- +---Returns the name of a material in the model. +--- +---@param index number # The index of a material. +---@return string name # The name of the material, or nil if the material does not have a name. +function ModelData:getMaterialName(index) end + +--- +---Returns the number of meshes in the model. +--- +---@return number count # The number of meshes in the model. +function ModelData:getMeshCount() end + +--- +---Returns the draw mode of a mesh. +--- +---This controls how its vertices are connected together (points, lines, or triangles). +--- +---@param mesh number # The index of a mesh. +---@return lovr.DrawMode mode # The draw mode of the mesh. +function ModelData:getMeshDrawMode(mesh) end + +--- +---Returns one of the vertex indices in a mesh. +--- +---If a mesh has vertex indices, they define the order and connectivity of the vertices in the mesh, allowing a vertex to be reused multiple times without duplicating its data. +--- +---@param mesh number # The index of a mesh to get the vertex from. +---@param index number # The index of a vertex index in the mesh to retrieve. +---@return number vertexindex # The vertex index. Like all indices in Lua, this is 1-indexed. +function ModelData:getMeshIndex(mesh, index) end + +--- +---Returns the number of vertex indices in a mesh. +--- +---Vertex indices allow for vertices to be reused when defining triangles. +--- +--- +---### NOTE: +---This may return zero if the mesh does not use indices. +--- +---@param mesh number # The index of a mesh. +---@return number count # The number of vertex indices in the mesh. +function ModelData:getMeshIndexCount(mesh) end + +--- +---Returns the data format of vertex indices in a mesh. +--- +---If a mesh doesn't use vertex indices, this function returns nil. +--- +---@param mesh number # The index of a mesh. +---@return lovr.AttributeType type # The data type of each vertex index (always u16 or u32). +---@return number blob # The index of a Blob in the mesh where the binary data is stored. +---@return number offset # A byte offset into the Blob's data where the index data starts. +---@return number stride # The number of bytes between subsequent vertex indices. Indices are always tightly packed, so this will always be 2 or 4 depending on the data type. +function ModelData:getMeshIndexFormat(mesh) end + +--- +---Returns the index of the material applied to a mesh. +--- +---@param mesh number # The index of a mesh. +---@return number material # The index of the material applied to the mesh, or nil if the mesh does not have a material. +function ModelData:getMeshMaterial(mesh) end + +--- +---Returns the data for a single vertex in a mesh. +--- +---The data returned depends on the vertex format of a mesh, which is given by `ModelData:getMeshVertexFormat`. +--- +---@param mesh number # The index of a mesh to get the vertex from. +---@param vertex number # The index of a vertex in the mesh to retrieve. +function ModelData:getMeshVertex(mesh, vertex) end + +--- +---Returns the number of vertices in a mesh. +--- +---@param mesh number # The index of a mesh. +---@return number count # The number of vertices in the mesh. +function ModelData:getMeshVertexCount(mesh) end + +--- +---Returns the vertex format of a mesh. +--- +---The vertex format defines the properties associated with each vertex (position, color, etc.), including their types and binary data layout. +--- +--- +---### NOTE: +---The format is given as a table of vertex attributes. +--- +---Each attribute is a table containing the following: +--- +--- { name, type, components, blob, offset, stride } +--- +---- The `name` will be a `DefaultAttribute`. +---- The `type` will be an `AttributeType`. +---- The `component` count will be 1-4. +---- The `blob` is an index of one of the Blobs in the model (see `ModelData:getBlob`). +---- The `offset` is a byte offset from the start of the Blob where the attribute's data starts. +---- The `stride` is the number of bytes between consecutive values. +--- +---@param mesh number # The index of a mesh. +---@return table format # The vertex format of the mesh. +function ModelData:getMeshVertexFormat(mesh) end + +--- +---Returns extra information stored in the model file. +--- +---Currently this is only implemented for glTF models and returns the JSON string from the glTF or glb file. +--- +---The metadata can be used to get application-specific data or add support for glTF extensions not supported by LÖVR. +--- +---@return string metadata # The metadata from the model file. +function ModelData:getMetadata() end + +--- +---Given a parent node, this function returns a table with the indices of its children. +--- +--- +---### NOTE: +---If the node does not have any children, this function returns an empty table. +--- +---@overload fun(self: lovr.ModelData, name: string):table +---@param index number # The index of the parent node. +---@return table children # A table containing a node index for each child of the node. +function ModelData:getNodeChildren(index) end + +--- +---Returns the number of nodes in the model. +--- +---@return number count # The number of nodes in the model. +function ModelData:getNodeCount() end + +--- +---Returns a table of mesh indices attached to a node. +--- +---Meshes define the geometry and materials of a model, as opposed to the nodes which define the transforms and hierarchy. +--- +---A node can have multiple meshes, and meshes can be reused in multiple nodes. +--- +---@overload fun(self: lovr.ModelData, name: string):table +---@param index number # The index of the node. +---@return table meshes # A table with the node's mesh indices. +function ModelData:getNodeMeshes(index) end + +--- +---Returns the name of a node. +--- +--- +---### NOTE: +---If the node does not have a name, this function returns `nil`. +--- +---@param index number # The index of the node. +---@return string name # The name of the node. +function ModelData:getNodeName(index) end + +--- +---Returns local orientation of a node, relative to its parent. +--- +---@overload fun(self: lovr.ModelData, name: string):number, number, number, number +---@param index number # The index of the node. +---@return number angle # The number of radians the node is rotated around its axis of rotation. +---@return number ax # The x component of the axis of rotation. +---@return number ay # The y component of the axis of rotation. +---@return number az # The z component of the axis of rotation. +function ModelData:getNodeOrientation(index) end + +--- +---Given a child node, this function returns the index of its parent. +--- +---@overload fun(self: lovr.ModelData, name: string):number +---@param index number # The index of the child node. +---@return number parent # The index of the parent. +function ModelData:getNodeParent(index) end + +--- +---Returns local pose (position and orientation) of a node, relative to its parent. +--- +---@overload fun(self: lovr.ModelData, name: string):number, number, number, number, number, number, number +---@param index number # The index of the node. +---@return number x # The x coordinate. +---@return number y # The y coordinate. +---@return number z # The z coordinate. +---@return number angle # The number of radians the node is rotated around its axis of rotation. +---@return number ax # The x component of the axis of rotation. +---@return number ay # The y component of the axis of rotation. +---@return number az # The z component of the axis of rotation. +function ModelData:getNodePose(index) end + +--- +---Returns local position of a node, relative to its parent. +--- +---@overload fun(self: lovr.ModelData, name: string):number, number, number +---@param index number # The index of the node. +---@return number x # The x coordinate. +---@return number y # The y coordinate. +---@return number z # The z coordinate. +function ModelData:getNodePosition(index) end + +--- +---Returns local scale of a node, relative to its parent. +--- +---@overload fun(self: lovr.ModelData, name: string):number, number, number +---@param index number # The index of the node. +---@return number sx # The x scale. +---@return number sy # The y scale. +---@return number sz # The z scale. +function ModelData:getNodeScale(index) end + +--- +---Returns the index of the skin used by a node. +--- +---Skins are collections of joints used for skeletal animation. +--- +---A model can have multiple skins, and each node can use at most one skin to drive the animation of its meshes. +--- +---@overload fun(self: lovr.ModelData, name: string):number +---@param index number # The index of the node. +---@return number skin # The index of the node's skin, or nil if the node isn't skeletally animated. +function ModelData:getNodeSkin(index) end + +--- +---Returns local transform (position, orientation, and scale) of a node, relative to its parent. +--- +---@overload fun(self: lovr.ModelData, name: string):number, number, number, number, number, number, number, number, number, number +---@param index number # The index of the node. +---@return number x # The x coordinate. +---@return number y # The y coordinate. +---@return number z # The z coordinate. +---@return number sx # The x scale. +---@return number sy # The y scale. +---@return number sz # The z scale. +---@return number angle # The number of radians the node is rotated around its axis of rotation. +---@return number ax # The x component of the axis of rotation. +---@return number ay # The y component of the axis of rotation. +---@return number az # The z component of the axis of rotation. +function ModelData:getNodeTransform(index) end + +--- +---Returns the index of the model's root node. +--- +---@return number root # The index of the root node. +function ModelData:getRootNode() end + +--- +---Returns the number of skins in the model. +--- +---A skin is a collection of joints targeted by an animation. +--- +--- +---### NOTE: +---There is currently a maximum of 256 skins. +--- +---@return number count # The number of skins in the model. +function ModelData:getSkinCount() end + +--- +---Returns the inverse bind matrix for a joint in the skin. +--- +---@param skin number # The index of a skin. +---@param joint number # The index of a joint in the skin. +function ModelData:getSkinInverseBindMatrix(skin, joint) end + +--- +---Returns a table with the node indices of the joints in a skin. +--- +---@param skin number # The index of a skin. +---@return table joints # The joints in the skin. +function ModelData:getSkinJoints(skin) end + +--- +---Returns the total number of triangles in the model. +--- +---This count includes meshes that are attached to multiple nodes, and the count corresponds to the triangles returned by `ModelData:getTriangles`. +--- +---@return number count # The total number of triangles in the model. +function ModelData:getTriangleCount() end + +--- +---Returns the data for all triangles in the model. +--- +---There are a few differences between this and the mesh-specific functions like `ModelData:getMeshVertex` and `ModelData:getMeshIndex`: +--- +---- Only vertex positions are returned, not other vertex attributes. +---- Positions are relative to the origin of the whole model, instead of local to a node. +---- If a mesh is attached to more than one node, its vertices will be in the table multiple times. +---- Vertex indices will be relative to the whole triangle list instead of a mesh. +--- +--- +---### NOTE: +---After this function is called on a ModelData once, the result is cached. +--- +---@return table vertices # The triangle vertex positions, returned as a flat (non-nested) table of numbers. The position of each vertex is given as an x, y, and z coordinate. +---@return table indices # The vertex indices. Every 3 indices describes a triangle. +function ModelData:getTriangles() end + +--- +---Returns the total vertex count of a model. +--- +---This count includes meshes that are attached to multiple nodes, and the count corresponds to the vertices returned by `ModelData:getTriangles`. +--- +---@return number count # The total number of vertices in the model. +function ModelData:getVertexCount() end + +--- +---Returns the width of the model, computed from its axis-aligned bounding box. +--- +---@return number width # The width of the model. +function ModelData:getWidth() end + --- ---A Rasterizer is an object that parses a TTF file, decoding and rendering glyphs from it. --- @@ -533,6 +1019,56 @@ function Sound:isStream() end ---@return number count # The number of frames written. function Sound:setFrames(t, count, dstOffset, srcOffset) end +--- +---This indicates the different transform properties that can be animated. +--- +---@alias lovr.AnimationProperty +--- +---Node translation. +--- +---| "translation" +--- +---Node rotation. +--- +---| "rotation" +--- +---Node scale. +--- +---| "scale" + +--- +---These are the data types that can be used by vertex data in meshes. +--- +---@alias lovr.AttributeType +--- +---Signed 8 bit integers (-128 to 127). +--- +---| "i8" +--- +---Unsigned 8 bit integers (0 to 255). +--- +---| "u8" +--- +---Signed 16 bit integers (-32768 to 32767). +--- +---| "i16" +--- +---Unsigned 16 bit integers (0 to 65535). +--- +---| "u16" +--- +---Signed 32 bit integers (-2147483648 to 2147483647). +--- +---| "i32" +--- +---Unsigned 32 bit integers (0 to 429467295). +--- +---| "u32" +--- +---Floating point numbers. +--- +---| "f32" + --- ---Sounds can have different numbers of channels, and those channels can map to various speaker layouts. --- @@ -556,6 +1092,76 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end --- ---| "ambisonic" +--- +---These are the different types of attributes that may be present in meshes loaded from models. +--- +---@alias lovr.DefaultAttribute +--- +---Vertex positions. +--- +---| "position" +--- +---Vertex normal vectors. +--- +---| "normal" +--- +---Vertex texture coordinates. +--- +---| "uv" +--- +---Vertex colors. +--- +---| "color" +--- +---Vertex tangent vectors. +--- +---| "tangent" +--- +---Vertex joint indices. +--- +---| "joints" +--- +---Vertex joint weights. +--- +---| "weights" + +--- +---The DrawMode of a mesh determines how its vertices are connected together. +--- +---@alias lovr.DrawMode +--- +---Each vertex is draw as a single point. +--- +---| "points" +--- +---Every pair of vertices is drawn as a line. +--- +---| "lines" +--- +---Draws a single line through all of the vertices. +--- +---| "linestrip" +--- +---Draws a single line through all of the vertices, then connects back to the first vertex. +--- +---| "lineloop" +--- +---Vertices are rendered as triangles. +--- +---After the first 3 vertices, each subsequent vertex connects to the previous two. +--- +---| "strip" +--- +---Every 3 vertices forms a triangle. +--- +---| "triangles" +--- +---Vertices are rendered as triangles. +--- +---After the first 3 vertices, each subsequent vertex is connected to the previous vertex and the first vertex. +--- +---| "fan" + --- ---Sounds can store audio samples as 16 bit integers or 32 bit floats. --- @@ -568,3 +1174,287 @@ function Sound:setFrames(t, count, dstOffset, srcOffset) end ---16 bit integer samples (between -32768 and 32767). --- ---| "i16" + +--- +---Different ways to interpolate between animation keyframes. +--- +---@alias lovr.SmoothMode +--- +---The animated property will snap to the nearest keyframe. +--- +---| "step" +--- +---The animated property will linearly interpolate between keyframes. +--- +---| "linear" +--- +---The animated property will follow a smooth curve between nearby keyframes. +--- +---| "cubic" + +--- +---Different data layouts for pixels in `Image` and `Texture` objects. +--- +---Formats starting with `d` are depth formats, used for depth/stencil render targets. +--- +---Formats starting with `bc` and `astc` are compressed formats. +--- +---Compressed formats have better performance since they stay compressed on the CPU and GPU, reducing the amount of memory bandwidth required to look up all the pixels needed for shading. +--- +---Formats without the `f` suffix are unsigned normalized formats, which store values in the range `[0,1]`. +--- +---The `f` suffix indicates a floating point format which can store values outside this range, and is used for HDR rendering or storing data in a texture. +--- +---@alias lovr.TextureFormat +--- +---One 8-bit channel. +--- +---1 byte per pixel. +--- +---| "r8" +--- +---Two 8-bit channels. +--- +---2 bytes per pixel. +--- +---| "rg8" +--- +---Four 8-bit channels. +--- +---4 bytes per pixel. +--- +---| "rgba8" +--- +---One 16-bit channel. +--- +---2 bytes per pixel. +--- +---| "r16" +--- +---Two 16-bit channels. +--- +---4 bytes per pixel. +--- +---| "rg16" +--- +---Four 16-bit channels. +--- +---8 bytes per pixel. +--- +---| "rgba16" +--- +---One 16-bit floating point channel. +--- +---2 bytes per pixel. +--- +---| "r16f" +--- +---Two 16-bit floating point channels. +--- +---4 bytes per pixel. +--- +---| "rg16f" +--- +---Four 16-bit floating point channels. +--- +---8 bytes per pixel. +--- +---| "rgba16f" +--- +---One 32-bit floating point channel. +--- +---4 bytes per pixel. +--- +---| "r32f" +--- +---Two 32-bit floating point channels. +--- +---8 bytes per pixel. +--- +---| "rg32f" +--- +---Four 32-bit floating point channels. +--- +---16 bytes per pixel. +--- +---| "rgba32f" +--- +---Packs three channels into 16 bits. +--- +---2 bytes per pixel. +--- +---| "rgb565" +--- +---Packs four channels into 16 bits, with "cutout" alpha. +--- +---2 bytes per pixel. +--- +---| "rgb5a1" +--- +---Packs four channels into 32 bits. +--- +---4 bytes per pixel. +--- +---| "rgb10a2" +--- +---Packs three unsigned floating point channels into 32 bits. +--- +---4 bytes per pixel. +--- +---| "rg11b10f" +--- +---One 16-bit depth channel. +--- +---2 bytes per pixel. +--- +---| "d16" +--- +---One 24-bit depth channel and one 8-bit stencil channel. +--- +---4 bytes per pixel. +--- +---| "d24s8" +--- +---One 32-bit floating point depth channel. +--- +---4 bytes per pixel. +--- +---| "d32f" +--- +---3 channels. +--- +---8 bytes per 4x4 block, or 0.5 bytes per pixel. +--- +---Good for opaque images. +--- +---| "bc1" +--- +---Four channels. +--- +---16 bytes per 4x4 block or 1 byte per pixel. +--- +---Not good for anything, because it only has 16 distinct levels of alpha. +--- +---| "bc2" +--- +---Four channels. +--- +---16 bytes per 4x4 block or 1 byte per pixel. +--- +---Good for color images with transparency. +--- +---| "bc3" +--- +---One unsigned normalized channel. +--- +---8 bytes per 4x4 block or 0.5 bytes per pixel. +--- +---Good for grayscale images, like heightmaps. +--- +---| "bc4u" +--- +---One signed normalized channel. +--- +---8 bytes per 4x4 block or 0.5 bytes per pixel. +--- +---Similar to bc4u but has a range of -1 to 1. +--- +---| "bc4s" +--- +---Two unsigned normalized channels. +--- +---16 bytes per 4x4 block, or 1 byte per pixel. +--- +---Good for normal maps. +--- +---| "bc5u" +--- +---Two signed normalized channels. +--- +---16 bytes per 4x4 block or 1 byte per pixel. +--- +---Good for normal maps. +--- +---| "bc5s" +--- +---Three unsigned floating point channels. +--- +---16 bytes per 4x4 block or 1 byte per pixel. +--- +---Good for HDR images. +--- +---| "bc6uf" +--- +---Three floating point channels. +--- +---16 bytes per 4x4 block or 1 byte per pixel. +--- +---Good for HDR images. +--- +---| "bc6sf" +--- +---Four channels. +--- +---16 bytes per 4x4 block or 1 byte per pixel. +--- +---High quality. +--- +---Good for most color images, including transparency. +--- +---| "bc7" +--- +---Four channels, 16 bytes per 4x4 block or 1 byte per pixel. +--- +---| "astc4x4" +--- +---Four channels, 16 bytes per 5x4 block or 0.80 bytes per pixel. +--- +---| "astc5x4" +--- +---Four channels, 16 bytes per 5x5 block or 0.64 bytes per pixel. +--- +---| "astc5x5" +--- +---Four channels, 16 bytes per 6x5 block or 0.53 bytes per pixel. +--- +---| "astc6x5" +--- +---Four channels, 16 bytes per 6x6 block or 0.44 bytes per pixel. +--- +---| "astc6x6" +--- +---Four channels, 16 bytes per 8x5 block or 0.40 bytes per pixel. +--- +---| "astc8x5" +--- +---Four channels, 16 bytes per 8x6 block or 0.33 bytes per pixel. +--- +---| "astc8x6" +--- +---Four channels, 16 bytes per 8x8 block or 0.25 bytes per pixel. +--- +---| "astc8x8" +--- +---Four channels, 16 bytes per 10x5 block or 0.32 bytes per pixel. +--- +---| "astc10x5" +--- +---Four channels, 16 bytes per 10x6 block or 0.27 bytes per pixel. +--- +---| "astc10x6" +--- +---Four channels, 16 bytes per 10x8 block or 0.20 bytes per pixel. +--- +---| "astc10x8" +--- +---Four channels, 16 bytes per 10x10 block or 0.16 bytes per pixel. +--- +---| "astc10x10" +--- +---Four channels, 16 bytes per 12x10 block or 0.13 bytes per pixel. +--- +---| "astc12x10" +--- +---Four channels, 16 bytes per 12x12 block or 0.11 bytes per pixel. +--- +---| "astc12x12" diff --git a/meta/3rd/lovr/library/lovr/event.lua b/meta/3rd/lovr/library/lovr/event.lua index a515c1ab7..3acc9cc64 100644 --- a/meta/3rd/lovr/library/lovr/event.lua +++ b/meta/3rd/lovr/library/lovr/event.lua @@ -48,8 +48,7 @@ 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. ----@vararg any # The arguments for the event. Currently, up to 4 are supported. -function lovr.event.push(name, ...) end +function lovr.event.push(name) end --- ---Pushes an event to quit. diff --git a/meta/3rd/lovr/library/lovr/graphics.lua b/meta/3rd/lovr/library/lovr/graphics.lua index 88dd378be..5dd8f32ba 100644 --- a/meta/3rd/lovr/library/lovr/graphics.lua +++ b/meta/3rd/lovr/library/lovr/graphics.lua @@ -1,235 +1,25 @@ ---@meta --- ----The `lovr.graphics` module renders graphics to displays. ---- ----Anything rendered using this module will automatically show up in the VR headset if one is connected, otherwise it will just show up in a window on the desktop. +---The graphics module renders graphics and performs computation using the GPU. --- ---@class lovr.graphics lovr.graphics = {} --- ----Draws an arc. ---- ---- ----### 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) ----@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. ----@param z? number # The z coordinate of the center of the arc. ----@param radius? number # The radius of the arc, in meters. ----@param angle? number # The rotation of the arc around its rotation axis, in radians. ----@param ax? number # The x coordinate of the arc's axis of rotation. ----@param ay? number # The y coordinate of the arc's axis of rotation. ----@param az? number # The z coordinate of the arc's axis of rotation. ----@param start? number # The starting angle of the arc, in radians. ----@param end? number # The ending angle of the arc, in radians. ----@param segments? number # The number of segments to use for the full circle. A smaller number of segments will be used, depending on how long the arc is. -function lovr.graphics.arc(mode, x, y, z, radius, angle, ax, ay, az, start, end, segments) end - ---- ----Draws a box. ---- ----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(mode: lovr.DrawStyle, transform: lovr.mat4) ----@overload fun(material: lovr.Material, transform: lovr.mat4) ----@param mode lovr.DrawStyle # How to draw the box. ----@param x? number # The x coordinate of the center of the box. ----@param y? number # The y coordinate of the center of the box. ----@param z? number # The z coordinate of the center of the box. ----@param width? number # The width of the box, in meters. ----@param height? number # The height of the box, in meters. ----@param depth? number # The depth of the box, in meters. ----@param angle? number # The rotation of the box around its rotation axis, in radians. ----@param ax? number # The x coordinate of the axis of rotation. ----@param ay? number # The y coordinate of the axis of rotation. ----@param az? number # The z coordinate of the axis of rotation. -function lovr.graphics.box(mode, x, y, z, width, height, depth, angle, ax, ay, az) end - ---- ----Draws a 2D circle. ---- ---- ----### 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) ----@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. ----@param z? number # The z coordinate of the center of the circle. ----@param radius? number # The radius of the circle, in meters. ----@param angle? number # The rotation of the circle around its rotation axis, in radians. ----@param ax? number # The x coordinate of the circle's axis of rotation. ----@param ay? number # The y coordinate of the circle's axis of rotation. ----@param az? number # The z coordinate of the circle's axis of rotation. ----@param segments? number # The number of segments to use for the circle geometry. Higher numbers increase smoothness but increase rendering cost slightly. -function lovr.graphics.circle(mode, x, y, z, radius, angle, ax, ay, az, segments) end - ---- ----Clears the screen, resetting the color, depth, and stencil information to default values. ---- ----This function is called automatically by `lovr.run` at the beginning of each frame to clear out the data from the previous frame. ---- ---- ----### NOTE: ----The first two variants of this function can be mixed and matched, meaning you can use booleans for some of the values and numeric values for others. ---- ----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(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. ----@param stencil? boolean # Whether or not to clear the stencil information on the screen. -function lovr.graphics.clear(color, depth, stencil) end - ---- ----This function runs a compute shader on the GPU. ---- ----Compute shaders must be created with `lovr.graphics.newComputeShader` and they should implement the `void compute();` GLSL function. Running a compute shader doesn't actually do anything, but the Shader can modify data stored in `Texture`s or `ShaderBlock`s to get interesting things to happen. ---- ----When running the compute shader, you can specify the number of times to run it in 3 dimensions, which is useful to iterate over large numbers of elements like pixels or array elements. ---- ---- ----### NOTE: ----Only compute shaders created with `lovr.graphics.newComputeShader` can be used here. ---- ----There are GPU-specific limits on the `x`, `y`, and `z` values which can be queried in the `compute` entry of `lovr.graphics.getLimits`. ---- ----@param shader lovr.Shader # The compute shader to run. ----@param x? number # The amount of times to run in the x direction. ----@param y? number # The amount of times to run in the y direction. ----@param z? number # The amount of times to run in the z direction. -function lovr.graphics.compute(shader, x, y, z) end - ---- ----Create the desktop window, usually used to mirror the headset display. ---- ---- ----### NOTE: ----This function can only be called once. ---- ----It is normally called internally, but you can override this by setting window to `nil` in conf.lua. ---- ----See `lovr.conf` for more information. ---- ----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. -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(mode: lovr.DrawStyle, transform: lovr.mat4) ----@overload fun(material: lovr.Material, transform: lovr.mat4) ----@param mode lovr.DrawStyle # How to draw the cube. ----@param x? number # The x coordinate of the center of the cube. ----@param y? number # The y coordinate of the center of the cube. ----@param z? number # The z coordinate of the center of the cube. ----@param size? number # The size of the cube, in meters. ----@param angle? number # The rotation of the cube around its rotation axis, in radians. ----@param ax? number # The x coordinate of the cube's axis of rotation. ----@param ay? number # The y coordinate of the cube's axis of rotation. ----@param az? number # The z coordinate of the cube's axis of rotation. -function lovr.graphics.cube(mode, x, y, z, size, angle, ax, ay, az) end - ---- ----Draws a cylinder. ---- ---- ----### 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) ----@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. ----@param length? number # The length of the cylinder, in meters. ----@param angle? number # The rotation of the cylinder around its rotation axis, in radians. ----@param ax? number # The x coordinate of the cylinder's axis of rotation. ----@param ay? number # The y coordinate of the cylinder's axis of rotation. ----@param az? number # The z coordinate of the cylinder's axis of rotation. ----@param r1? number # The radius of one end of the cylinder. ----@param r2? number # The radius of the other end of the cylinder. ----@param capped? boolean # Whether the top and bottom should be rendered. ----@param segments? number # The number of radial segments to use for the cylinder. If nil, the segment count is automatically determined from the radii. -function lovr.graphics.cylinder(x, y, z, length, angle, ax, ay, az, r1, r2, capped, segments) end - ---- ----Discards pixel information in the active Canvas or display. ---- ----This is mostly used as an optimization hint for the GPU, and is usually most helpful on mobile devices. ---- ----@param color? boolean # Whether or not to discard color information. ----@param depth? boolean # Whether or not to discard depth information. ----@param stencil? boolean # Whether or not to discard stencil information. -function lovr.graphics.discard(color, depth, stencil) end - ---- ----Draws a fullscreen textured quad. ---- ---- ----### NOTE: ----This function ignores stereo rendering, so it will stretch the input across the entire Canvas if it's stereo. ---- ----Special shaders are currently required for correct stereo fills. ---- ----@overload fun() ----@param texture lovr.Texture # The texture to use. ----@param u? number # The x component of the uv offset. ----@param v? number # The y component of the uv offset. ----@param w? number # The width of the Texture to render, in uv coordinates. ----@param h? number # The height of the Texture to render, in uv coordinates. -function lovr.graphics.fill(texture, u, v, w, h) end - ---- ----Flushes the internal queue of draw batches. ---- ----Under normal circumstances this is done automatically when needed, but the ability to flush manually may be helpful if you're integrating a LÖVR project with some external rendering code. ---- -function lovr.graphics.flush() end - ---- ----Returns whether or not alpha sampling is enabled. ---- ----Alpha sampling is also known as alpha-to-coverage. ---- ----When it is enabled, the alpha channel of a pixel is factored into how antialiasing is computed, so the edges of a transparent texture will be correctly antialiased. ---- ---- ----### NOTE: ----- Alpha sampling is disabled by default. ----- This feature can be used for a simple transparency effect, pixels with an alpha of zero will ---- have their depth value discarded, allowing things behind them to show through (normally you ---- have to sort objects or write a shader for this). +---TODO --- ----@return boolean enabled # Whether or not alpha sampling is enabled. -function lovr.graphics.getAlphaSampling() end +---@param stage lovr.ShaderStage # TODO +---@param source lovr.ShaderSource # TODO +---@return lovr.Blob bytecode # TODO +function lovr.graphics.compileShader(stage, source) end --- ----Returns the current background color. ---- ----Color components are from 0.0 to 1.0. +---TODO --- --- ---### NOTE: ----The default background color is `(0.0, 0.0, 0.0, 1.0)`. +---TODO --- ---@return number r # The red component of the background color. ---@return number g # The green component of the background color. @@ -238,3030 +28,2597 @@ function lovr.graphics.getAlphaSampling() end function lovr.graphics.getBackgroundColor() end --- ----Returns the current blend mode. ---- ----The blend mode controls how each pixel's color is blended with the previous pixel's color when drawn. ---- ----If blending is disabled, `nil` will be returned. +---Creates a temporary Buffer. --- --- ---### NOTE: ----The default blend mode is `alpha` and `alphamultiply`. ---- ----@return lovr.BlendMode blend # The current blend mode. ----@return lovr.BlendAlphaMode alphaBlend # The current alpha blend mode. -function lovr.graphics.getBlendMode() end - ---- ----Returns the active Canvas. ---- ----Usually when you render something it will render directly to the headset. ---- ----If a Canvas object is active, things will be rendered to the textures attached to the Canvas instead. +---The format table can contain a list of `FieldType`s or a list of tables to provide extra information about each field. --- ----@return lovr.Canvas canvas # The active Canvas, or `nil` if no canvas is set. -function lovr.graphics.getCanvas() end - ---- ----Returns the current global color factor. ---- ----Color components are from 0.0 to 1.0. ---- ----Every pixel drawn will be multiplied (i.e. tinted) by this color. +---Each inner table has the following keys: --- +---- `type` is the `FieldType` of the field and is required. +---- `offset` is the byte offset of the field. --- ----### NOTE: ----The default color is `(1.0, 1.0, 1.0, 1.0)`. ---- ----@return number r # The red component of the color. ----@return number g # The green component of the color. ----@return number b # The blue component of the color. ----@return number a # The alpha component of the color. -function lovr.graphics.getColor() end - +---Any fields with a `nil` offset will be placed next +--- to each other sequentially in memory, subject to any padding required by the Buffer's layout. +--- In practice this means that you probably want to provide an `offset` for either all of the +--- fields or none of them. +---- `location` is the vertex attribute location of each field. --- ----Returns a boolean for each color channel (red, green, blue, alpha) indicating whether it is enabled. +---This is used to match up each +--- field with an attribute declared in a shader, and doesn't have any purpose when binding the +--- buffer as a uniform or storage buffer. --- ----When a color channel is enabled, it will be affected by drawing commands and clear commands. +---Any fields with a `nil` location will use an +--- autoincrementing location starting at zero. --- +---Named locations are not currently supported, but +--- may be added in the future. --- ----### NOTE: ----By default, all color channels are enabled. +---If no table or Blob is used to define the initial Buffer contents, its data will be undefined. --- ----Disabling all of the color channels can be useful if you only want to write to the depth buffer or the stencil buffer. +---There is currently a max of 16 fields. --- -function lovr.graphics.getColorMask() end +---@overload fun(data: table, type: lovr.FieldType):lovr.Buffer +---@overload fun(length: number, format: table):lovr.Buffer +---@overload fun(data: table, format: table):lovr.Buffer +---@overload fun(blob: lovr.Blob, type: lovr.FieldType):lovr.Buffer +---@overload fun(blob: lovr.Blob, format: table):lovr.Buffer +---@param length number # The length of the Buffer. +---@param type lovr.FieldType # The type of each item in the Buffer. +---@return lovr.Buffer buffer # The new Buffer. +function lovr.graphics.getBuffer(length, type) end --- ----Returns the default filter mode for new Textures. +---Returns the default Font. --- ----This controls how textures are sampled when they are minified, magnified, or stretched. +---The default font is Varela Round, created at 32px with a spread value of `4.0`. --- +---It's used by `Pass:text` if no Font is provided. --- ----### NOTE: ----The default filter is `trilinear`. ---- ----@return lovr.FilterMode mode # The filter mode. ----@return number anisotropy # The level of anisotropy. -function lovr.graphics.getDefaultFilter() end +---@return lovr.Font font # The default Font object. +function lovr.graphics.getDefaultFont() end --- ----Returns the current depth test settings. +---Returns information about the graphics device and driver. --- --- ---### NOTE: ----The depth test is an advanced technique to control how 3D objects overlap each other when they are rendered. +---The device and vendor ID numbers will usually be PCI IDs, which are standardized numbers consisting of 4 hex digits. --- ----It works as follows: +---Various online databases and system utilities can be used to look up these numbers. --- ----- Each pixel keeps track of its z value as well as its color. ----- If `write` is enabled when something is drawn, then any pixels that are drawn will have their ---- z values updated. ----- Additionally, anything drawn will first compare the existing z value of a pixel with the new z ---- value. +---Here are some example vendor IDs for a few popular GPU manufacturers: --- ----The `compareMode` setting determines how this comparison is performed. ---- ----If the ---- comparison succeeds, the new pixel will overwrite the previous one, otherwise that pixel won't ---- be rendered to. +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +---
IDVendor
0x1002Advanced Micro Devices, Inc.
0x8086Intel Corporation
0x10deNVIDIA Corporation
--- ----Smaller z values are closer to the camera. +---It is not currently possible to get the version of the driver, although this could be added. --- ----The default compare mode is `lequal`, which usually gives good results for normal 3D rendering. +---Regarding multiple GPUs: If OpenXR is enabled, the OpenXR runtime has control over which GPU is used, which ensures best compatibility with the VR headset. --- ----@return lovr.CompareMode compareMode # The current comparison method for depth testing. ----@return boolean write # Whether pixels will have their z value updated when rendered to. -function lovr.graphics.getDepthTest() end - +---Otherwise, the "first" GPU returned by the renderer will be used. --- ----Returns the dimensions of the desktop window. +---There is currently no other way to pick a GPU to use. --- ----@return number width # The width of the window, in pixels. ----@return number height # The height of the window, in pixels. -function lovr.graphics.getDimensions() end +---@return {id: number, vendor: number, name: string, renderer: string, subgroupSize: number, discrete: boolean} device # nil +function lovr.graphics.getDevice() end --- ----Returns whether certain features are supported by the system\'s graphics card. +---Returns a table indicating which features are supported by the GPU. --- ----@return {astc: boolean, compute: boolean, dxt: boolean, instancedstereo: boolean, multiview: boolean, timers: boolean} features # A table of features and whether or not they are supported. +---@return {textureBC: boolean, textureASTC: boolean, wireframe: boolean, depthClamp: boolean, indirectDrawFirstInstance: boolean, float64: boolean, int64: boolean, int16: boolean} features # function lovr.graphics.getFeatures() end --- ----Returns the active font. +---Returns limits of the current GPU. --- ----@return lovr.Font font # The active font object. -function lovr.graphics.getFont() end - --- ----Returns the height of the desktop window. +---### NOTE: +---The limit ranges are as follows: --- ----@return number height # The height of the window, in pixels. -function lovr.graphics.getHeight() end - +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +--- +---
LimitMinimumMaximum
textureSize2D4096
textureSize3D256
textureSizeCube4096
textureLayers256
renderSize{ 4096, 4096, 6 }
uniformBuffersPerStage932*
storageBuffersPerStage432*
sampledTexturesPerStage3232*
storageTexturesPerStage432*
samplersPerStage1532*
resourcesPerShader3232*
uniformBufferRange65536
storageBufferRange134217728 (128MB)1073741824 (1GB)*
uniformBufferAlign256
storageBufferAlign64
vertexAttributes1616*
vertexBufferStride204865535*
vertexShaderOutputs64
clipDistances0
cullDistances0
clipAndCullDistances0
computeDispatchCount{ 65536, 65536, 65536 }
computeWorkgroupSize{ 128, 128, 64 }
computeWorkgroupVolume128
computeSharedMemory16384 (16KB)
pushConstantSize128256*
indirectDrawCount1
instances134217727
anisotropy0.0
pointSize1.0
--- ----Returns information about the maximum limits of the graphics card, such as the maximum texture size or the amount of supported antialiasing. +---Note: in the table above, `*` means that LÖVR itself is imposing a cap on the limit, instead of the GPU. --- ----@return {anisotropy: number, blocksize: number, pointsize: number, texturemsaa: number, texturesize: number, compute: table} limits # The table of limits. +---@return {textureSize2D: number, textureSize3D: number, textureSizeCube: number, textureLayers: number, renderSize: table, uniformBuffersPerStage: number, storageBuffersPerStage: number, sampledTexturesPerStage: number, storageTexturesPerStage: number, samplersPerStage: number, resourcesPerShader: number, uniformBufferRange: number, storageBufferRange: number, uniformBufferAlign: number, storageBufferAlign: number, vertexAttributes: number, vertexBufferStride: number, vertexShaderOutputs: number, clipDistances: number, cullDistances: number, clipAndCullDistances: number, workgroupCount: table, workgroupSize: table, totalWorkgroupSize: number, computeSharedMemory: number, shaderConstantSize: number, indirectDrawCount: number, instances: number, anisotropy: number, pointSize: number} limits # function lovr.graphics.getLimits() end --- ----Returns the current line width. +---TODO --- +---@overload fun(type: lovr.PassType, texture: lovr.Texture):lovr.Pass +---@overload fun(type: lovr.PassType, canvas: table):lovr.Pass +---@param type lovr.PassType # TODO +---@return lovr.Pass pass # The new Pass. +function lovr.graphics.getPass(type) end + --- ----### NOTE: ----The default line width is `1`. +---TODO --- ----@return number width # The current line width, in pixels. -function lovr.graphics.getLineWidth() end +---@return {memory: {total: number, buffer: number, texture: number}, objects: {buffers: number, textures: number, samplers: number, shaders: number}, frame: {scratchMemory: number, renderPasses: number, computePasses: number, transferPasses: number, pipelineBinds: number, bundleBinds: number, drawCalls: number, dispatches: number, workgroups: number, copies: number}, internal: {blocks: number, canvases: number, pipelines: number, layouts: number, bunches: number}} stats # Graphics statistics. +function lovr.graphics.getStats() end --- ----Returns the pixel density of the window. +---Returns the window pass. --- ----On "high-dpi" displays, this will be `2.0`, indicating that there are 2 pixels for every window coordinate. +---This is a builtin render `Pass` object that renders to the desktop window texture. --- ----On a normal display it will be `1.0`, meaning that the pixel to window-coordinate ratio is 1:1. +---If the desktop window was not open when the graphics module was initialized, this function will return `nil`. --- --- ---### NOTE: ----If the window isn't created yet, this function will return 0. +---- TODO is the same pass always returned +---- TODO does the texture change +---- TODO what settings does the Pass use (incl conf.lua) +---- TODO is it reset --- ----@return number density # The pixel density of the window. -function lovr.graphics.getPixelDensity() end +---@return lovr.Pass pass # The window pass, or `nil` if there is no window. +function lovr.graphics.getWindowPass() end --- ----Returns the current point size. ---- ---- ----### NOTE: ----The default point size is `1.0`. +---TODO --- ----@return number size # The current point size, in pixels. -function lovr.graphics.getPointSize() end +---@param format lovr.TextureFormat # TODO +---@return boolean supported # TODO +function lovr.graphics.isFormatSupported(format) end --- ----Returns the projection for a single view. +---Creates a Buffer. --- --- ---### NOTE: ----Non-stereo rendering will only use the first view. ---- ----The projection matrices are available as the `mat4 lovrProjections[2]` variable in shaders. ---- ----The current projection matrix is available as `lovrProjection`. ---- ----@overload fun(view: number, matrix: lovr.Mat4):lovr.Mat4 ----@param view number # The view index. ----@return number left # The left field of view angle, in radians. ----@return number right # The right field of view angle, in radians. ----@return number up # The top field of view angle, in radians. ----@return number down # The bottom field of view angle, in radians. -function lovr.graphics.getProjection(view) end - ---- ----Returns the active shader. +---The format table can contain a list of `FieldType`s or a list of tables to provide extra information about each field. --- ----@return lovr.Shader shader # The active shader object, or `nil` if none is active. -function lovr.graphics.getShader() end - ---- ----Returns graphics-related performance statistics for the current frame. ---- ----@return {drawcalls: number, renderpasses: number, shaderswitches: number, buffers: number, textures: number, buffermemory: number, texturememory: number} stats # The table of stats. -function lovr.graphics.getStats() end - +---Each inner table has the following keys: --- ----Returns the current stencil test. +---- `type` is the `FieldType` of the field and is required. +---- `offset` is the byte offset of the field. --- ----The stencil test lets you mask out pixels that meet certain criteria, based on the contents of the stencil buffer. +---Any fields with a `nil` offset will be placed next +--- to each other sequentially in memory, subject to any padding required by the Buffer's layout. +--- In practice this means that you probably want to provide an `offset` for either all of the +--- fields or none of them. +---- `location` is the vertex attribute location of each field. --- ----The stencil buffer can be modified using `lovr.graphics.stencil`. +---This is used to match up each +--- field with an attribute declared in a shader, and doesn't have any purpose when binding the +--- buffer as a uniform or storage buffer. --- ----After rendering to the stencil buffer, the stencil test can be set to control how subsequent drawing functions are masked by the stencil buffer. +---Any fields with a `nil` location will use an +--- autoincrementing location starting at zero. --- +---Named locations are not currently supported, but +--- may be added in the future. --- ----### NOTE: ----Stencil values are between 0 and 255. +---If no table or Blob is used to define the initial Buffer contents, its data will be undefined. --- ----By default, the stencil test is disabled. +---There is currently a max of 16 fields. --- ----@return lovr.CompareMode compareMode # The comparison method used to decide if a pixel should be visible, or nil if the stencil test is disabled. ----@return number compareValue # The value stencil values are compared against, or nil if the stencil test is disabled. -function lovr.graphics.getStencilTest() end +---@overload fun(data: table, type: lovr.FieldType):lovr.Buffer +---@overload fun(length: number, format: table):lovr.Buffer +---@overload fun(data: table, format: table):lovr.Buffer +---@overload fun(blob: lovr.Blob, type: lovr.FieldType):lovr.Buffer +---@overload fun(blob: lovr.Blob, format: table):lovr.Buffer +---@param length number # The length of the Buffer. +---@param type lovr.FieldType # The type of each item in the Buffer. +---@return lovr.Buffer buffer # The new Buffer. +function lovr.graphics.newBuffer(length, type) end --- ----Get the pose of a single view. +---TODO --- ----@overload fun(view: number, matrix: lovr.Mat4, invert: boolean):lovr.Mat4 ----@param view number # The view index. ----@return number x # The x position of the viewer, in meters. ----@return number y # The y position of the viewer, in meters. ----@return number z # The z position of the viewer, in meters. ----@return number angle # The number of radians the viewer is rotated around its axis of rotation. ----@return number ax # The x component of the axis of rotation. ----@return number ay # The y component of the axis of rotation. ----@return number az # The z component of the axis of rotation. -function lovr.graphics.getViewPose(view) end +---@overload fun(blob: lovr.Blob, size?: number, spread?: number):lovr.Font +---@overload fun(size?: number, spread?: number):lovr.Font +---@overload fun(rasterizer: lovr.Rasterizer, spread?: number):lovr.Font +---@param filename string # TODO +---@param size? number # TODO +---@param spread? number # TODO +---@return lovr.Font font # The new Font. +function lovr.graphics.newFont(filename, size, spread) end --- ----Returns the width of the desktop window. +---TODO --- ----@return number width # The width of the window, in pixels. -function lovr.graphics.getWidth() end +---@overload fun(options: table):lovr.Material +---@param texture lovr.Texture # TODO +---@return lovr.Material material # TODO +function lovr.graphics.newMaterial(texture) end --- ----Returns the current polygon winding. +---TODO --- ----The winding direction determines which face of a triangle is the front face and which is the back face. ---- ----This lets the graphics engine cull the back faces of polygons, improving performance. ---- ---- ----### NOTE: ----Culling is initially disabled and must be enabled using `lovr.graphics.setCullingEnabled`. ---- ----The default winding direction is counterclockwise. ---- ----@return lovr.Winding winding # The current winding direction. -function lovr.graphics.getWinding() end +---@overload fun(blob: lovr.Blob, options: table):lovr.Model +---@overload fun(modelData: lovr.ModelData):lovr.Model +---@param filename string # TODO +---@param options {mipmaps: boolean} # Model options. +---@return lovr.Model model # The new Model. +function lovr.graphics.newModel(filename, options) end --- ----Returns whether the desktop window is currently created. +---TODO --- ---- ----### NOTE: ----Most of the `lovr.graphics` functionality will only work if a window is created. ---- ----@return boolean present # Whether a window is created. -function lovr.graphics.hasWindow() end +---@param options {filter: table, wrap: table, compare: lovr.CompareMode, anisotropy: number, mipmaprange: table} # TODO +---@return lovr.Sampler sampler # TODO +function lovr.graphics.newSampler(options) end --- ----Returns whether or not culling is active. ---- ----Culling is an optimization that avoids rendering the back face of polygons. ---- ----This improves performance by reducing the number of polygons drawn, but requires that the vertices in triangles are specified in a consistent clockwise or counter clockwise order. ---- ---- ----### NOTE: ----Culling is disabled by default. +---TODO --- ----@return boolean isEnabled # Whether or not culling is enabled. -function lovr.graphics.isCullingEnabled() end +---@overload fun(compute: lovr.ShaderSource, options: table):lovr.Shader +---@param vertex lovr.ShaderSource # TODO +---@param fragment lovr.ShaderSource # TODO +---@param options {flags: table, label: string} # Shader options. +---@return lovr.Shader shader # TODO +function lovr.graphics.newShader(vertex, fragment, options) end --- ----Returns a boolean indicating whether or not wireframe rendering is enabled. ---- ---- ----### NOTE: ----Wireframe rendering is initially disabled. ---- ----Wireframe rendering is only supported on desktop systems. +---TODO --- ----@return boolean isWireframe # Whether or not wireframe rendering is enabled. -function lovr.graphics.isWireframe() end +---@param type lovr.TallyType # The type of the Tally, which controls what "thing" it measures. +---@param count number # The number of slots in the Tally. Each slot performs one measurement. +---@param views? number # Tally objects with the `time` type can only be used in render passes with a certain number of views. This is ignored for other types of tallies. +---@return lovr.Tally tally # The new Tally. +function lovr.graphics.newTally(type, count, views) end --- ----Draws lines between points. ---- ----Each point will be connected to the previous point in the list. +---TODO --- ----@overload fun(points: table) ----@param x1 number # The x coordinate of the first point. ----@param y1 number # The y coordinate of the first point. ----@param z1 number # The z coordinate of the first point. ----@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. ----@vararg number # More points. -function lovr.graphics.line(x1, y1, z1, x2, y2, z2, ...) end +---@overload fun(width: number, height: number, options: table):lovr.Texture +---@overload fun(width: number, height: number, depth: number, options: table):lovr.Texture +---@overload fun(image: string, options: table):lovr.Texture +---@overload fun(images: table, options: table):lovr.Texture +---@param filename string # TODO +---@param options {type: lovr.TextureType, format: lovr.TextureFormat, linear: boolean, samples: number, mipmaps: number, usage: table, label: string} # Texture options. +---@return lovr.Texture texture # TODO +function lovr.graphics.newTexture(filename, options) end --- ----Creates a new Canvas. ---- ----You can specify Textures to attach to it, or just specify a width and height and attach textures later using `Canvas:setTexture`. ---- ----Once created, you can render to the Canvas using `Canvas:renderTo`, or `lovr.graphics.setCanvas`. ---- ---- ----### NOTE: ----Textures created by this function will have `clamp` as their `WrapMode`. ---- ----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 ----@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. ----@return lovr.Canvas canvas # The new Canvas. -function lovr.graphics.newCanvas(width, height, flags) end - +---Presents the window texture to the desktop window. --- ----Creates a new compute Shader, used for running generic compute operations on the GPU. +---This function is called automatically by the default implementation of `lovr.run`, so it normally does not need to be called. --- --- ---### NOTE: ----Compute shaders are not supported on all hardware, use `lovr.graphics.getFeatures` to check if they're available on the current system. ---- ----The source code for a compute shader needs to implement the `void compute();` GLSL function. This function doesn't return anything, but the compute shader is able to write data out to `Texture`s or `ShaderBlock`s. ---- ----The GLSL version used for compute shaders is GLSL 430. ---- ----Currently, up to 32 shader flags are supported. ---- ----@param source string # The code or filename of the compute shader. ----@param options? {flags: table} # Optional settings for the Shader. ----@return lovr.Shader shader # The new compute Shader. -function lovr.graphics.newComputeShader(source, options) end - ---- ----Creates a new Font. ---- ----It can be used to render text with `lovr.graphics.print`. +---This should be called after submitting the window pass (`lovr.graphics.getWindowPass`). --- ----Currently, the only supported font format is TTF. +---If the window texture has not been rendered to since the last present, this function does nothing. --- ---- ----### 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 ----@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. ----@param spread? number # The range of the distance field, in pixels. ----@return lovr.Font font # The new Font. -function lovr.graphics.newFont(filename, size, padding, spread) end +function lovr.graphics.present() end --- ----Creates a new Material. ---- ----Materials are sets of colors, textures, and other parameters that affect the appearance of objects. ---- ----They can be applied to `Model`s, `Mesh`es, and most graphics primitives accept a Material as an optional first argument. ---- ---- ----### NOTE: ----- Scalar properties will default to `1.0`. ----- Color properties will default to `(1.0, 1.0, 1.0, 1.0)`, except for `emissive` which will ---- 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 ----@return lovr.Material material # The new Material. -function lovr.graphics.newMaterial() end - ---- ----Creates a new Mesh. ---- ----Meshes contain the data for an arbitrary set of vertices, and can be drawn. You must specify either the capacity for the Mesh or an initial set of vertex data. ---- ----Optionally, a custom format table can be used to specify the set of vertex attributes the mesh will provide to the active shader. ---- ----The draw mode and usage hint can also optionally be specified. ---- ----The default data type for an attribute is `float`, and the default component count is 1. ---- ---- ----### NOTE: ----Once created, the size and format of the Mesh cannot be changed.' ---- ----The default mesh format is: ---- ---- { ---- { 'lovrPosition', 'float', 3 }, ---- { 'lovrNormal', 'float', 3 }, ---- { '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 ----@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. ----@param readable? boolean # Whether vertices from the Mesh can be read. ----@return lovr.Mesh mesh # The new Mesh. -function lovr.graphics.newMesh(size, mode, usage, readable) end - ---- ----Creates a new Model from a file. ---- ----The supported 3D file formats are OBJ, glTF, and STL. ---- ---- ----### NOTE: ----Diffuse and emissive textures will be loaded in the sRGB encoding, all other textures will be loaded as linear. ---- ----Currently, the following features are not supported by the model importer: ---- ----- OBJ: Quads are not supported (only triangles). ----- glTF: Sparse accessors are not supported. ----- glTF: Morph targets are not supported. ----- glTF: base64 images are not supported (base64 buffer data works though). ----- glTF: Only the default scene is loaded. ----- glTF: Currently, each skin in a Model can have up to 48 joints. ----- STL: ASCII STL files are not supported. ---- ----@overload fun(modelData: lovr.ModelData):lovr.Model ----@param filename string # The filename of the model to load. ----@return lovr.Model model # The new Model. -function lovr.graphics.newModel(filename) end - ---- ----Creates a new Shader. ---- ---- ----### NOTE: ----The `flags` table should contain string keys, with boolean or numeric values. ---- ----These flags can be used to customize the behavior of Shaders from Lua, by using the flags in the shader source code. ---- ----Numeric flags will be available as constants named `FLAG_`. ---- ----Boolean flags can be used with `#ifdef` and will only be defined if the value in the Lua table was `true`. ---- ----The following flags are used by shaders provided by LÖVR: ---- ----- `animated` is a boolean flag that will cause the shader to position vertices based on the pose ---- of an animated skeleton. ---- ----This should usually only be used for animated `Model`s, since it ---- needs a skeleton to work properly and is slower than normal rendering. ----- `alphaCutoff` is a numeric flag that can be used to implement simple "cutout" style ---- transparency, where pixels with alpha below a certain threshold will be discarded. ---- ----The value ---- of the flag should be a number between 0.0 and 1.0, representing the alpha threshold. ----- `uniformScale` is a boolean flag used for optimization. ---- ----If the Shader is only going to be ---- used with objects that have a *uniform* scale (i.e. the x, y, and z components of the scale ---- are all the same number), then this flag can be set to use a faster method to compute the ---- `lovrNormalMatrix` uniform variable. ----- `multicanvas` is a boolean flag that should be set when rendering to multiple Textures ---- attached to a `Canvas`. ---- ----When set, the fragment shader should implement the `colors` function ---- instead of the `color` function, and can write color values to the `lovrCanvas` array instead ---- of returning a single color. ---- ----Each color in the array gets written to the corresponding ---- texture attached to the canvas. ----- `highp` is a boolean flag specific to mobile GPUs that changes the default precision for ---- fragment shaders to use high precision instead of the default medium precision. ---- ----This can fix ---- visual issues caused by a lack of precision, but isn't guaranteed to be supported on some ---- lower-end systems. ----- The following flags are used only by the `standard` PBR shader: ---- - `normalMap` should be set to `true` to render objects with a normal map, providing a more ---- detailed, bumpy appearance. ---- ----Currently, this requires the model to have vertex tangents. ---- - `emissive` should be set to `true` to apply emissive maps to rendered objects. ---- ----This is ---- usually used to apply glowing lights or screens to objects, since the emissive texture is ---- not affected at all by lighting. ---- - `indirectLighting` is an *awesome* boolean flag that will apply realistic reflections and ---- lighting to the surface of an object, based on a specially-created skybox. ---- ----See the ---- `Standard Shader` guide for more information. ---- - `occlusion` is a boolean flag that uses the ambient occlusion texture in the model. ---- ----It only ---- affects indirect lighting, so it will only have an effect if the `indirectLighting` flag is ---- also enabled. ---- - `skipTonemap` is a flag that will skip the tonemapping process. ---- ----Tonemapping is an important ---- process that maps the high definition physical color values down to a 0 - 1 range for ---- display. ---- ----There are lots of different tonemapping algorithms that give different artistic ---- effects. ---- ----The default tonemapping in the standard shader is the ACES algorithm, but you can ---- use this flag to turn off ACES and use your own tonemapping. ---- ----Currently, up to 32 shader flags are supported. ---- ----The `stereo` option is only necessary for Android. ---- ----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 ----@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. ----@return lovr.Shader shader # The new Shader. -function lovr.graphics.newShader(vertex, fragment, options) end - ---- ----Creates a new ShaderBlock from a table of variable definitions with their names and types. ---- ---- ----### NOTE: ----`compute` blocks can only be true if compute shaders are supported, see `lovr.graphics.getFeatures`. ---- ----Compute blocks may be slightly slower than uniform blocks, but they can also be much, much larger. ---- ----Uniform blocks are usually limited to around 16 kilobytes in size, depending on hardware. ---- ----@param type lovr.BlockType # Whether the block will be used for read-only uniform data or compute shaders. ----@param uniforms table # A table where the keys are uniform names and the values are uniform types. Uniform arrays can be specified by supplying a table as the uniform's value containing the type and the array size. ----@param flags? {usage: lovr.BufferUsage, readable: boolean} # Optional settings. ----@return lovr.ShaderBlock shaderBlock # The new ShaderBlock. -function lovr.graphics.newShaderBlock(type, uniforms, flags) end - ---- ----Creates a new Texture from an image file. ---- ---- ----### NOTE: ----The "linear" flag should be set to true for textures that don't contain color information, such as normal maps. ---- ----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 ----@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. -function lovr.graphics.newTexture(filename, flags) end - ---- ----Resets the transformation to the origin. ---- ---- ----### NOTE: ----This is called at the beginning of every frame to reset the coordinate space. ---- -function lovr.graphics.origin() end - ---- ----Draws a plane with a given position, size, and orientation. ---- ---- ----### NOTE: ----The `u`, `v`, `w`, `h` arguments can be used to select a subregion of the diffuse texture to apply to the plane. ---- ----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) ----@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. ----@param z? number # The z coordinate of the center of the plane. ----@param width? number # The width of the plane, in meters. ----@param height? number # The height of the plane, in meters. ----@param angle? number # The number of radians to rotate around the rotation axis. ----@param ax? number # The x component of the rotation axis. ----@param ay? number # The y component of the rotation axis. ----@param az? number # The z component of the rotation axis. ----@param u? number # The u coordinate of the texture. ----@param v? number # The v coordinate of the texture. ----@param w? number # The width of the texture UVs to render. ----@param h? number # The height of the texture UVs to render. -function lovr.graphics.plane(mode, x, y, z, width, height, angle, ax, ay, az, u, v, w, h) end - ---- ----Draws one or more points. ---- ----@overload fun(points: table) ----@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. ----@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. ---- ---- ----### NOTE: ----An error is thrown if there isn't a transform to pop. ---- ----This can happen if you forget to call push before calling pop, or if you have an unbalanced sequence of pushes and pops. ---- -function lovr.graphics.pop() end - ---- ----Presents the results of pending drawing operations to the window. ---- ----This is automatically called after `lovr.draw` by the default `lovr.run` function. ---- -function lovr.graphics.present() end - ---- ----Draws text in 3D space using the active font. ---- ---- ----### NOTE: ----Unicode text is supported. ---- ----Use `\n` to add line breaks. ---- ----`\t` will be rendered as four spaces. ---- ----LÖVR uses a fancy technique for font rendering called multichannel signed distance fields. ---- ----This leads to crisp text in VR, but requires a special shader to use. ---- ----LÖVR internally switches to the appropriate shader, but only when the default shader is already set. ---- ----If you see strange font artifacts, make sure you switch back to the default shader by using `lovr.graphics.setShader()` before you draw text. ---- ----@param str string # The text to render. ----@param x? number # The x coordinate of the center of the text. ----@param y? number # The y coordinate of the center of the text. ----@param z? number # The z coordinate of the center of the text. ----@param scale? number # The scale of the text. ----@param angle? number # The number of radians to rotate the text around its rotation axis. ----@param ax? number # The x component of the axis of rotation. ----@param ay? number # The y component of the axis of rotation. ----@param az? number # The z component of the axis of rotation. ----@param wrap? number # The maximum width of each line, in meters (before scale is applied). Set to 0 or nil for no wrapping. ----@param halign? lovr.HorizontalAlign # The horizontal alignment. ----@param valign? lovr.VerticalAlign # The vertical alignment. -function lovr.graphics.print(str, x, y, z, scale, angle, ax, ay, az, wrap, halign, valign) end - ---- ----Pushes a copy of the current transform onto the transformation stack. ---- ----After changing the transform using `lovr.graphics.translate`, `lovr.graphics.rotate`, and `lovr.graphics.scale`, the original state can be restored using `lovr.graphics.pop`. ---- ---- ----### NOTE: ----An error is thrown if more than 64 matrices are pushed. ---- ----This can happen accidentally if a push isn't followed by a corresponding pop. ---- -function lovr.graphics.push() end - ---- ----Resets all graphics state to the initial values. ---- -function lovr.graphics.reset() end - ---- ----Rotates the coordinate system around an axis. ---- ----The rotation will last until `lovr.draw` returns or the transformation is popped off the transformation stack. ---- ---- ----### NOTE: ----Order matters when scaling, translating, and rotating the coordinate system. ---- ----@param angle? number # The amount to rotate the coordinate system by, in radians. ----@param ax? number # The x component of the axis of rotation. ----@param ay? number # The y component of the axis of rotation. ----@param az? number # The z component of the axis of rotation. -function lovr.graphics.rotate(angle, ax, ay, az) end - ---- ----Scales the coordinate system in 3 dimensions. ---- ----This will cause objects to appear bigger or smaller. ---- ----The scaling will last until `lovr.draw` returns or the transformation is popped off the transformation stack. ---- ---- ----### NOTE: ----Order matters when scaling, translating, and rotating the coordinate system. ---- ----@param x? number # The amount to scale on the x axis. ----@param y? number # The amount to scale on the y axis. ----@param z? number # The amount to scale on the z axis. -function lovr.graphics.scale(x, y, z) end - ---- ----Enables or disables alpha sampling. ---- ----Alpha sampling is also known as alpha-to-coverage. ---- ----When it is enabled, the alpha channel of a pixel is factored into how antialiasing is computed, so the edges of a transparent texture will be correctly antialiased. ---- ---- ----### NOTE: ----- Alpha sampling is disabled by default. ----- This feature can be used for a simple transparency effect, pixels with an alpha of zero will ---- have their depth value discarded, allowing things behind them to show through (normally you ---- have to sort objects or write a shader for this). ---- ----@param enabled boolean # Whether or not alpha sampling is enabled. -function lovr.graphics.setAlphaSampling(enabled) end - ---- ----Sets the background color used to clear the screen. ---- ----Color components are from 0.0 to 1.0. ---- ---- ----### NOTE: ----The default background color is `(0.0, 0.0, 0.0, 1.0)`. ---- ----@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. ----@param b number # The blue component of the background color. ----@param a? number # The alpha component of the background color. -function lovr.graphics.setBackgroundColor(r, g, b, a) end - ---- ----Sets the blend mode. ---- ----The blend mode controls how each pixel's color is blended with the previous pixel's color when drawn. ---- ---- ----### NOTE: ----The default blend mode is `alpha` and `alphamultiply`. ---- ----@overload fun() ----@param blend lovr.BlendMode # The blend mode. ----@param alphaBlend lovr.BlendAlphaMode # The alpha blend mode. -function lovr.graphics.setBlendMode(blend, alphaBlend) end - ---- ----Sets or disables the active Canvas object. ---- ----If there is an active Canvas, things will be rendered to the Textures attached to that Canvas instead of to the headset. ---- ----@param canvas? lovr.Canvas # The new active Canvas object, or `nil` to just render to the headset. -function lovr.graphics.setCanvas(canvas) end - ---- ----Sets the color used for drawing objects. ---- ----Color components are from 0.0 to 1.0. ---- ----Every pixel drawn will be multiplied (i.e. tinted) by this color. ---- ----This is a global setting, so it will affect all subsequent drawing operations. ---- ---- ----### NOTE: ----The default color is `(1.0, 1.0, 1.0, 1.0)`. ---- ----@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. ----@param b number # The blue component of the color. ----@param a? number # The alpha component of the color. -function lovr.graphics.setColor(r, g, b, a) end - ---- ----Enables and disables individual color channels. ---- ----When a color channel is enabled, it will be affected by drawing commands and clear commands. ---- ---- ----### NOTE: ----By default, all color channels are enabled. ---- ----Disabling all of the color channels can be useful if you only want to write to the depth buffer or the stencil buffer. ---- ----@param r boolean # Whether the red color channel should be enabled. ----@param g boolean # Whether the green color channel should be enabled. ----@param b boolean # Whether the blue color channel should be enabled. ----@param a boolean # Whether the alpha color channel should be enabled. -function lovr.graphics.setColorMask(r, g, b, a) end - ---- ----Enables or disables culling. ---- ----Culling is an optimization that avoids rendering the back face of polygons. ---- ----This improves performance by reducing the number of polygons drawn, but requires that the vertices in triangles are specified in a consistent clockwise or counter clockwise order. ---- ---- ----### NOTE: ----Culling is disabled by default. ---- ----@param isEnabled boolean # Whether or not culling should be enabled. -function lovr.graphics.setCullingEnabled(isEnabled) end - ---- ----Sets the default filter mode for new Textures. ---- ----This controls how textures are sampled when they are minified, magnified, or stretched. ---- ---- ----### NOTE: ----The default filter is `trilinear`. ---- ----The maximum supported anisotropy level can be queried using `lovr.graphics.getLimits`. ---- ----@param mode lovr.FilterMode # The filter mode. ----@param anisotropy number # The level of anisotropy to use. -function lovr.graphics.setDefaultFilter(mode, anisotropy) end - ---- ----Sets the current depth test. ---- ----The depth test controls how overlapping objects are rendered. ---- ---- ----### NOTE: ----The depth test is an advanced technique to control how 3D objects overlap each other when they are rendered. ---- ----It works as follows: ---- ----- Each pixel keeps track of its z value as well as its color. ----- If `write` is enabled when something is drawn, then any pixels that are drawn will have their ---- z values updated. ----- Additionally, anything drawn will first compare the existing z value of a pixel with the new z ---- value. ---- ----The `compareMode` setting determines how this comparison is performed. ---- ----If the ---- comparison succeeds, the new pixel will overwrite the previous one, otherwise that pixel won't ---- be rendered to. ---- ----Smaller z values are closer to the camera. ---- ----The default compare mode is `lequal`, which usually gives good results for normal 3D rendering. ---- ----@param compareMode? lovr.CompareMode # The new depth test. Use `nil` to disable the depth test. ----@param write? boolean # Whether pixels will have their z value updated when rendered to. -function lovr.graphics.setDepthTest(compareMode, write) end - ---- ----Sets the active font used to render text with `lovr.graphics.print`. ---- ----@param font? lovr.Font # The font to use. If `nil`, the default font is used (Varela Round). -function lovr.graphics.setFont(font) end - ---- ----Sets the width of lines rendered using `lovr.graphics.line`. ---- ---- ----### NOTE: ----The default line width is `1`. ---- ----GPU driver support for line widths is poor. ---- ----The actual width of lines may be different from what is set here. ---- ----In particular, some graphics drivers only support a line width of `1`. ---- ----Currently this function only supports integer values from 1 to 255. ---- ----@param width? number # The new line width, in pixels. -function lovr.graphics.setLineWidth(width) end - ---- ----Sets the width of drawn points, in pixels. ---- ---- ----### NOTE: ----The default point size is `1.0`. ---- ----@param size? number # The new point size. -function lovr.graphics.setPointSize(size) end - ---- ----Sets the projection for a single view. ---- ----4 field of view angles can be used, similar to the field of view returned by `lovr.headset.getViewAngles`. ---- ----Alternatively, a projection matrix can be used for other types of projections like orthographic, oblique, etc. ---- ----Two views are supported, one for each eye. ---- ----When rendering to the headset, both projections are changed to match the ones used by the headset. ---- ---- ----### NOTE: ----Non-stereo rendering will only use the first view. ---- ----The projection matrices are available as the `mat4 lovrProjections[2]` variable in shaders. ---- ----The current projection matrix is available as `lovrProjection`. ---- ----@overload fun(view: number, matrix: lovr.Mat4) ----@param view number # The index of the view to update. ----@param left number # The left field of view angle, in radians. ----@param right number # The right field of view angle, in radians. ----@param up number # The top field of view angle, in radians. ----@param down number # The bottom field of view angle, in radians. -function lovr.graphics.setProjection(view, left, right, up, down) end - ---- ----Sets or disables the Shader used for drawing. ---- ----@overload fun() ----@param shader lovr.Shader # The shader to use. -function lovr.graphics.setShader(shader) end - ---- ----Sets the stencil test. ---- ----The stencil test lets you mask out pixels that meet certain criteria, based on the contents of the stencil buffer. ---- ----The stencil buffer can be modified using `lovr.graphics.stencil`. ---- ----After rendering to the stencil buffer, the stencil test can be set to control how subsequent drawing functions are masked by the stencil buffer. ---- ---- ----### NOTE: ----Stencil values are between 0 and 255. ---- ----By default, the stencil test is disabled. ---- ----@overload fun() ----@param compareMode lovr.CompareMode # The comparison method used to decide if a pixel should be visible, or nil if the stencil test is disabled. ----@param compareValue number # The value to compare stencil values to. -function lovr.graphics.setStencilTest(compareMode, compareValue) end - ---- ----Sets the pose for a single view. ---- ----Objects rendered in this view will appear as though the camera is positioned using the given pose. ---- ----Two views are supported, one for each eye. ---- ----When rendering to the headset, both views are changed to match the estimated eye positions. ---- ----These view poses are also available using `lovr.headset.getViewPose`. ---- ---- ----### NOTE: ----Non-stereo rendering will only use the first view. ---- ----The inverted view poses (view matrices) are available as the `mat4 lovrViews[2]` variable in shaders. ---- ----The current view matrix is available as `lovrView`. ---- ----@overload fun(view: number, matrix: lovr.Mat4, inverted: boolean) ----@param view number # The index of the view to update. ----@param x number # The x position of the viewer, in meters. ----@param y number # The y position of the viewer, in meters. ----@param z number # The z position of the viewer, in meters. ----@param angle number # The number of radians the viewer is rotated around its axis of rotation. ----@param ax number # The x component of the axis of rotation. ----@param ay number # The y component of the axis of rotation. ----@param az number # The z component of the axis of rotation. -function lovr.graphics.setViewPose(view, x, y, z, angle, ax, ay, az) end - ---- ----Sets the polygon winding. ---- ----The winding direction determines which face of a triangle is the front face and which is the back face. ---- ----This lets the graphics engine cull the back faces of polygons, improving performance. ---- ----The default is counterclockwise. ---- ---- ----### NOTE: ----Culling is initially disabled and must be enabled using `lovr.graphics.setCullingEnabled`. ---- ----The default winding direction is counterclockwise. ---- ----@param winding lovr.Winding # The new winding direction. -function lovr.graphics.setWinding(winding) end - ---- ----Enables or disables wireframe rendering. ---- ----This is meant to be used as a debugging tool. ---- ---- ----### NOTE: ----Wireframe rendering is initially disabled. ---- ----Wireframe rendering is only supported on desktop systems. ---- ----@param wireframe boolean # Whether or not wireframe rendering should be enabled. -function lovr.graphics.setWireframe(wireframe) end - ---- ----Render a skybox from a texture. ---- ----Two common kinds of skybox textures are supported: A 2D equirectangular texture with a spherical coordinates can be used, or a "cubemap" texture created from 6 images. ---- ----@param texture lovr.Texture # The texture to use. -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) ----@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. ----@param radius? number # The radius of the sphere, in meters. ----@param angle? number # The rotation of the sphere around its rotation axis, in radians. ----@param ax? number # The x coordinate of the sphere's axis of rotation. ----@param ay? number # The y coordinate of the sphere's axis of rotation. ----@param az? number # The z coordinate of the sphere's axis of rotation. -function lovr.graphics.sphere(x, y, z, radius, angle, ax, ay, az) end - ---- ----Renders to the stencil buffer using a function. ---- ---- ----### NOTE: ----Stencil values are between 0 and 255. ---- ----@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. ----@param keep? boolean # If false, the stencil buffer will be cleared to zero before rendering. -function lovr.graphics.stencil(callback, action, value, keep) end - ---- ----Starts a named timer on the GPU, which can be stopped using `lovr.graphics.tock`. ---- ---- ----### NOTE: ----The timer can be stopped by calling `lovr.graphics.tock` using the same name. ---- ----All drawing commands between the tick and the tock will be timed. ---- ----It is not possible to nest calls to tick and tock. ---- ----GPU timers are not supported on all systems. ---- ----Check the `timers` feature using `lovr.graphics.getFeatures` to see if it is supported on the current system. ---- ----@param label string # The name of the timer. -function lovr.graphics.tick(label) end - ---- ----Stops a named timer on the GPU, previously started with `lovr.graphics.tick`. ---- ---- ----### NOTE: ----All drawing commands between tick and tock will be timed. ---- ----It is not possible to nest calls to tick and tock. ---- ----The results are delayed, and might be `nil` for the first few frames. ---- ----This function returns the most recent available timer value. ---- ----GPU timers are not supported on all systems. ---- ----Check the `timers` feature using `lovr.graphics.getFeatures` to see if it is supported on the current system. ---- ----@param label string # The name of the timer. ----@return number time # The number of seconds elapsed, or `nil` if the data isn't ready yet. -function lovr.graphics.tock(label) end - ---- ----Apply a transform to the coordinate system, changing its translation, rotation, and scale using a single function. ---- ----A `mat4` can also be used. ---- ----The transformation will last until `lovr.draw` returns or the transformation is popped off the transformation stack. ---- ----@overload fun(transform: lovr.mat4) ----@param x? number # The x component of the translation. ----@param y? number # The y component of the translation. ----@param z? number # The z component of the translation. ----@param sx? number # The x scale factor. ----@param sy? number # The y scale factor. ----@param sz? number # The z scale factor. ----@param angle? number # The number of radians to rotate around the rotation axis. ----@param ax? number # The x component of the axis of rotation. ----@param ay? number # The y component of the axis of rotation. ----@param az? number # The z component of the axis of rotation. -function lovr.graphics.transform(x, y, z, sx, sy, sz, angle, ax, ay, az) end - ---- ----Translates the coordinate system in three dimensions. ---- ----All graphics operations that use coordinates will behave as if they are offset by the translation value. ---- ----The translation will last until `lovr.draw` returns or the transformation is popped off the transformation stack. +---TODO --- --- ---### NOTE: ----Order matters when scaling, translating, and rotating the coordinate system. +---TODO --- ----@param x? number # The amount to translate on the x axis. ----@param y? number # The amount to translate on the y axis. ----@param z? number # The amount to translate on the z axis. -function lovr.graphics.translate(x, y, z) end +---@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. +---@param b number # The blue component of the background color. +---@param a? number # The alpha component of the background color. +function lovr.graphics.setBackgroundColor(r, g, b, a) end --- ----A Canvas is also known as a framebuffer or render-to-texture. +---TODO --- ----It allows you to render to a texture instead of directly to the screen. +---@overload fun(t: table):boolean +---@vararg lovr.Pass # The pass objects to submit. Falsy values will be skipped. +---@return boolean true # Always returns true, for convenience when returning from `lovr.draw`. +function lovr.graphics.submit(...) end + --- ----This lets you postprocess or transform the results later before finally rendering them to the screen. +---TODO --- ----After creating a Canvas, you can attach Textures to it using `Canvas:setTexture`. +function lovr.graphics.wait() end + --- +---A Buffer is a block of GPU memory. --- ----### NOTE: ----Up to four textures can be attached to a Canvas and anything rendered to the Canvas will be broadcast to all attached Textures. +---Buffers are similar to Lua tables or arrays: they have a length and store a list of values. --- ----If you want to do render different things to different textures, use the `multicanvas` shader flag when creating your shader and implement the `void colors` function instead of the usual `vec4 color` function. +---The length of a Buffer and its format (the type of each value) are declared upfront and can't be changed. --- ----You can then assign different output colors to `lovrCanvas[0]`, `lovrCanvas[1]`, etc. instead of returning a single color. Each color written to the array will end up in the corresponding texture attached to the Canvas. +---Each value of a Buffer consists of one or more fields, and each field has a type. --- ----@class lovr.Canvas -local Canvas = {} - +---For example, if a Buffer is used to store vertices, each value might store 3 fields for the position, normal vector, and UV coordinates of a vertex. --- ----Returns the depth buffer used by the Canvas as a Texture. +---Buffers are commonly used for: --- ----If the Canvas was not created with a readable depth buffer (the `depth.readable` flag in `lovr.graphics.newCanvas`), then this function will return `nil`. +---- Mesh data: Buffers hold the data that define the vertices in a mesh. Buffers also store the +--- vertex indices of a mesh, which define the order the vertices are connected together into +--- triangles. These are often called vertex buffers and index buffers. +---- Shader data: Buffers can be bound to a Shader, letting the Shader read arbitrary data. For +--- example, Lua code could create a Buffer with the positions and colors of all the lights in a +--- scene, which a Shader can use to do lighting calculations. +---- Compute: Compute shaders can write data to Buffers. --- ----@return lovr.Texture texture # The depth Texture of the Canvas. -function Canvas:getDepthTexture() end - +---This GPU-generated data can be used in +--- later rendering work or sent back to Lua. +---- Indirect: Indirect rendering is an advanced technique where instructions for rendering work +--- are recorded to a Buffer (potentially by a compute shader) and later drawn. --- ----Returns the dimensions of the Canvas, its Textures, and its depth buffer. +---There are two types of Buffers: --- +---- **Temporary** buffers are very inexpensive to create, and writing to them from Lua is fast. +--- However, they become invalid at the end of `lovr.draw` (i.e. when `lovr.graphics.submit` is +--- called). --- ----### NOTE: ----The dimensions of a Canvas can not be changed after it is created. +---The GPU is slightly slower at accessing data from temporary buffers, and compute +--- shaders can not write to them. --- ----@return number width # The width of the Canvas, in pixels. ----@return number height # The height of the Canvas, in pixels. -function Canvas:getDimensions() end - +---They are designed for storing data that changes every frame. +---- **Permanent** buffers are more expensive to create, and updating their contents requires a +--- transfer from CPU memory to VRAM. --- ----Returns the height of the Canvas, its Textures, and its depth buffer. +---They act like normal LÖVR objects and don't need to be +--- recreated every frame. --- +---They often have faster performance when used by the GPU, and compute +--- shaders can write to them. --- ----### NOTE: ----The height of a Canvas can not be changed after it is created. +---They are great for large pieces of data that are initialized once +--- at load time, or data that is updated infrequently. --- ----@return number height # The height of the Canvas, in pixels. -function Canvas:getHeight() end +---@class lovr.Buffer +local Buffer = {} --- ----Returns the number of multisample antialiasing samples to use when rendering to the Canvas. Increasing this number will make the contents of the Canvas appear more smooth at the cost of performance. +---Clears some or all of the data in the Buffer to zero. +--- +---This is supported for both temporary and permanent Buffers. --- ----It is common to use powers of 2 for this value. +---Permanent Buffers can also be cleared in a transfer pass using `Pass:clear`. --- --- ---### NOTE: ----All textures attached to the Canvas must be created with this MSAA value. +---Clearing a permanent buffer requires the byte offset and byte count of the cleared range to be a multiple of 4. --- ----@return number samples # The number of MSAA samples. -function Canvas:getMSAA() end +---This will usually be true for most field types. +--- +---@param index? number # The index of the first item to clear. +---@param count? number # The number of items to clear. If `nil`, clears as many items as possible. +function Buffer:clear(index, count) end --- ----Returns the set of Textures currently attached to the Canvas. +---Returns the format of the Buffer. --- +---This is the list of fields that comprise each item in the buffer. --- ----### NOTE: ----Up to 4 Textures can be attached at once. +---Each field has a type, byte offset, and vertex attribute location. --- -function Canvas:getTexture() end +---@return table format # The format of the Buffer. +function Buffer:getFormat() end --- ----Returns the width of the Canvas, its Textures, and its depth buffer. +---Returns the length of the Buffer. --- +---@return number length # The length of the Buffer. +function Buffer:getLength() end + --- ----### NOTE: ----The width of a Canvas can not be changed after it is created. +---Returns a raw pointer to the Buffer's memory as a lightuserdata, intended for use with the LuaJIT ffi or for passing to C libraries. --- ----@return number width # The width of the Canvas, in pixels. -function Canvas:getWidth() end +---This is only available for temporary buffers, and as such the pointer is only valid until `lovr.graphics.submit` is called. +--- +---@return lightuserdata pointer # A pointer to the Buffer's memory. +function Buffer:getPointer() end --- ----Returns whether the Canvas was created with the `stereo` flag. +---Returns the size of the Buffer, in bytes. --- ----Drawing something to a stereo Canvas will draw it to two viewports in the left and right half of the Canvas, using transform information from two different eyes. +---This is the same as `length * stride`. --- ----@return boolean stereo # Whether the Canvas is stereo. -function Canvas:isStereo() end +---@return number size # The size of the Buffer, in bytes. +function Buffer:getSize() end --- ----Returns a new Image containing the contents of a Texture attached to the Canvas. +---Returns the distance between each item in the Buffer, in bytes. --- --- ---### NOTE: ----The Image will have the same pixel format as the Texture that is read from. +---When a Buffer is created, the stride can be set explicitly, otherwise it will be automatically computed based on the fields in the Buffer. +--- +---Strides can not be zero, and can not be smaller than the size of a single item. --- ----@param index? number # The index of the Texture to read from. ----@return lovr.Image image # The new Image. -function Canvas:newImage(index) end +---To work around this, bind the Buffer as a storage buffer and fetch data from the buffer manually. +--- +---@return number stride # The stride of the Buffer, in bytes. +function Buffer:getStride() end --- ----Renders to the Canvas using a function. +---Returns whether the Buffer is temporary. --- ----All graphics functions inside the callback will affect the Canvas contents instead of directly rendering to the headset. +---@return boolean temporary # Whether the Buffer is temporary. +function Buffer:isTemporary() end + --- ----This can be used in `lovr.update`. +---Changes data in the Buffer using a table or a Blob. --- +---This is supported for both temporary and permanent buffers. --- ----### NOTE: ----Make sure you clear the contents of the canvas before rendering by using `lovr.graphics.clear`. Otherwise there might be data in the canvas left over from a previous frame. +---All passes submitted to the GPU will use the new data. --- ----Also note that the transform stack is not modified by this function. +---It is also possible to change the data in permanent buffers inside of a transfer pass using `Pass:copy`. --- ----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. +---Using a transfer pass allows the copy to happen after other passes in the frame. --- ----@param callback function # The function to use to render to the Canvas. ----@vararg any # Additional arguments to pass to the callback. -function Canvas:renderTo(callback, ...) end - --- ----Attaches one or more Textures to the Canvas. +---### NOTE: +---When using a table, the table can contain a nested table for each value in the Buffer, or it can be a flat list of field component values. --- ----When rendering to the Canvas, everything will be drawn to all attached Textures. +---It is not possible to mix both nested tables and flat values. --- ----You can attach different layers of an array, cubemap, or volume texture, and also attach different mipmap levels of Textures. +---For each item updated, components of each field in the item (according to the Buffer's format) are read from either the nested subtable or the table itself. --- +---A single number can be used to update a field with a scalar type. --- ----### NOTE: ----There are some restrictions on how textures can be attached: +---Multiple numbers or a `lovr.math` vector can be used to update a field with a vector or mat4 type. --- ----- Up to 4 textures can be attached at once. ----- Textures must have the same dimensions and multisample settings as the Canvas. +---Multiple numbers can be used to update mat2 and mat3 fields. --- ----To specify layers and mipmaps to attach, specify them after the Texture. +---When updating normalized field types, components read from the table will be clamped to the normalized range ([0,1] or [-1,1]). --- ----You can also optionally wrap them in a table. +---In the Buffer, each field is written at its byte offset according to the Buffer's format, and subsequent items are separated by the byte stride of the Buffer. --- ----@vararg any # One or more Textures to attach to the Canvas. -function Canvas:setTexture(...) end - +---Any missing components for an updated field will be set to zero. --- ----A Font is an object created from a TTF file. +---@overload fun(self: lovr.Buffer, blob: lovr.Blob, sourceOffset?: number, destinationOffset?: number, size?: number) +---@param data table # A flat or nested table of items to copy to the Buffer (see notes for format). +---@param sourceIndex? number # The index in the table to copy from. +---@param destinationIndex? number # The index of the first value in the Buffer to update. +---@param count? number # The number of values to update. `nil` will copy as many items as possible, based on the lengths of the source and destination. +function Buffer:setData(data, sourceIndex, destinationIndex, count) end + --- ----It can be used to render text with `lovr.graphics.print`. +---TODO --- ---@class lovr.Font local Font = {} --- ----Returns the maximum distance that any glyph will extend above the Font's baseline. +---TODO --- ----Units are generally in meters, see `Font:getPixelDensity`. ---- ----@return number ascent # The ascent of the Font. +---@return number ascent # TODO function Font:getAscent() end --- ----Returns the baseline of the Font. ---- ----This is where the characters "rest on", relative to the y coordinate of the drawn text. ---- ----Units are generally in meters, see `Font:setPixelDensity`. ---- ----@return number baseline # The baseline of the Font. -function Font:getBaseline() end - ---- ----Returns the maximum distance that any glyph will extend below the Font's baseline. +---TODO --- ----Units are generally in meters, see `Font:getPixelDensity` for more information. ---- ----Note that due to the coordinate system for fonts, this is a negative value. ---- ----@return number descent # The descent of the Font. +---@return number descent # TODO function Font:getDescent() end --- ----Returns the height of a line of text. +---TODO --- ----Units are in meters, see `Font:setPixelDensity`. ---- ----@return number height # The height of a rendered line of text. +---@return number height # TODO function Font:getHeight() end --- ----Returns the current line height multiplier of the Font. ---- ----The default is 1.0. +---TODO --- ----@return number lineHeight # The line height. -function Font:getLineHeight() end +---@param first lovr.Codepoint # TODO +---@param second lovr.Codepoint # TODO +---@return number kerning # TODO +function Font:getKerning(first, second) end --- ----Returns the current pixel density for the Font. +---TODO --- ----The default is 1.0. +---@return number spacing # TODO +function Font:getLineSpacing() end + +--- +---TODO --- ----Normally, this is in pixels per meter. +---@param text lovr.Text # TODO +---@param wrap number # TODO +---@return table lines # TODO +function Font:getLines(text, wrap) end + --- ----When rendering to a 2D texture, the units are pixels. +---TODO --- ----@return number pixelDensity # The current pixel density. +---@return number density # TODO function Font:getPixelDensity() end --- ----Returns the underlying `Rasterizer` object for a Font. +---TODO --- ----@return lovr.Rasterizer rasterizer # The rasterizer. +---@return lovr.Rasterizer rasterizer # The Rasterizer. function Font:getRasterizer() end --- ----Returns the width and line count of a string when rendered using the font, taking into account an optional wrap limit. +---Returns a table of vertices for a piece of text, along with a Material to use when rendering it. The Material may change over time if the Font's texture atlas needs to be resized to make room for more glyphs. --- --- ---### NOTE: ----To get the correct units returned, make sure the pixel density is set with ---- `Font:setPixelDensity`. ---- ----@param text string # The text to get the width of. ----@param wrap? number # The width at which to wrap lines, or 0 for no wrap. ----@return number width # The maximum width of any line in the text. ----@return number lines # The number of lines in the wrapped text. ----@return number lastwidth # The width of the last line of text (to assist in text layout). -function Font:getWidth(text, wrap) end - ---- ----Returns whether the Font has a set of glyphs. +---Each vertex is a table of 4 floating point numbers with the following data: --- ----Any combination of strings and numbers (corresponding to character codes) can be specified. +--- { x, y, u, v } --- ----This function will return true if the Font is able to render *all* of the glyphs. +---These could be placed in a vertex buffer using the following buffer format: --- +--- { 'vec2:VertexPosition', 'vec2:VertexUV' } --- ----### 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 +---@param text lovr.Text # TODO +---@param wrap number # TODO +---@param halign lovr.HorizontalAlign # TODO +---@param valign lovr.VerticalAlign # TODO +---@return table vertices # The table of vertices. See below for the format of each vertex. +---@return lovr.Material material # A Material to use when rendering the vertices. +function Font:getVertices(text, wrap, halign, valign) end --- ----Sets the line height of the Font, which controls how far lines apart lines are vertically separated. +---TODO --- ----This value is a ratio and the default is 1.0. ---- ----@param lineHeight number # The new line height. -function Font:setLineHeight(lineHeight) end +---@param text lovr.Text # TODO +---@return number width # TODO +function Font:getWidth(text) end --- ----Sets the pixel density for the Font. +---TODO --- ----Normally, this is in pixels per meter. +---@param spacing number # TODO +function Font:setLineSpacing(spacing) end + --- ----When rendering to a 2D texture, the units are pixels. +---TODO --- ----@overload fun(self: lovr.Font) ----@param pixelDensity number # The new pixel density. -function Font:setPixelDensity(pixelDensity) end +---@param density number # TODO +function Font:setPixelDensity(density) end --- ----A Material is an object used to control how objects appear, through coloring, texturing, and shading. ---- ----The Material itself holds sets of colors, textures, and other parameters that are made available to Shaders. +---TODO --- ---@class lovr.Material local Material = {} --- ----Returns a color property for a Material. ---- ----Different types of colors are supported for different lighting parameters. ---- ----Colors default to `(1.0, 1.0, 1.0, 1.0)` and are gamma corrected. ---- ----@param colorType? lovr.MaterialColor # The type of color to get. ----@return number r # The red component of the color. ----@return number g # The green component of the color. ----@return number b # The blue component of the color. ----@return number a # The alpha component of the color. -function Material:getColor(colorType) end - ---- ----Returns a numeric property of a Material. +---Returns the properties of the Material in a table. --- ----Scalar properties default to 1.0. ---- ----@param scalarType lovr.MaterialScalar # The type of property to get. ----@return number x # The value of the property. -function Material:getScalar(scalarType) end +---@return table properties # The Material properties. +function Material:getProperties() end --- ----Returns a texture for a Material. +---Sets a texture for a Material. --- ---Several predefined `MaterialTexture`s are supported. --- ---Any texture that is `nil` will use a single white pixel as a fallback. --- ----@param textureType? lovr.MaterialTexture # The type of texture to get. ----@return lovr.Texture texture # The texture that is set, or `nil` if no texture is set. -function Material:getTexture(textureType) end - ---- ----Returns the transformation applied to texture coordinates of the Material. ---- --- ---### NOTE: ----Although texture coordinates will automatically be transformed by the Material's transform, the material transform is exposed as the `mat3 lovrMaterialTransform` uniform variable in shaders, allowing it to be used for other purposes. +---Textures must have a `TextureType` of `2d` to be used with Materials. --- ----@return number ox # The texture coordinate x offset. ----@return number oy # The texture coordinate y offset. ----@return number sx # The texture coordinate x scale. ----@return number sy # The texture coordinate y scale. ----@return number angle # The texture coordinate rotation, in radians. -function Material:getTransform() end +---@overload fun(self: lovr.Material, texture: lovr.Texture) +---@param textureType? lovr.MaterialTexture # The type of texture to set. +---@param texture lovr.Texture # The texture to apply, or `nil` to use the default. +function Material:setTexture(textureType, texture) end --- ----Sets a color property for a Material. ---- ----Different types of colors are supported for different lighting parameters. ---- ----Colors default to `(1.0, 1.0, 1.0, 1.0)` and are gamma corrected. +---TODO --- ----@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. ----@param b number # The blue component of the color. ----@param a? number # The alpha component of the color. -function Material:setColor(colorType, r, g, b, a) end +---@class lovr.Model +local Model = {} --- ----Sets a numeric property of a Material. +---TODO --- ----Scalar properties default to 1.0. --- ----@param scalarType lovr.MaterialScalar # The type of property to set. ----@param x number # The value of the property. -function Material:setScalar(scalarType, x) end +---### NOTE: +---TODO What happens if the timestamp is before the first keyframe? TODO Does it loop? +--- +---@overload fun(self: lovr.Model, index: number, time: number, blend?: number) +---@param name string # The name of an animation in the model file. +---@param time number # The timestamp to evaluate the keyframes at, in seconds. +---@param blend? number # How much of the animation's pose to blend into the nodes, from 0 to 1. +function Model:animate(name, time, blend) end --- ----Sets a texture for a Material. +---Returns the number of animations in the Model. --- ----Several predefined `MaterialTexture`s are supported. +---@return number count # The number of animations in the Model. +function Model:getAnimationCount() end + --- ----Any texture that is `nil` will use a single white pixel as a fallback. +---TODO --- --- ---### NOTE: ----Textures must have a `TextureType` of `2d` to be used with Materials. +---TODO how is duration calculated? --- ----@overload fun(self: lovr.Material, texture: lovr.Texture) ----@param textureType? lovr.MaterialTexture # The type of texture to set. ----@param texture lovr.Texture # The texture to apply, or `nil` to use the default. -function Material:setTexture(textureType, texture) end +---@overload fun(self: lovr.Model, name: string):number +---@param index number # The animation index. +---@return number duration # TODO +function Model:getAnimationDuration(index) end --- ----Sets the transformation applied to texture coordinates of the Material. +---TODO +--- +---@param index number # TODO +---@return string name # The name of the animation. +function Model:getAnimationName(index) end + --- ----This lets you offset, scale, or rotate textures as they are applied to geometry. +---Returns the 6 values of the Model's axis-aligned bounding box. --- +---@return number minx # The minimum x coordinate of the vertices in the Model. +---@return number maxx # The maximum x coordinate of the vertices in the Model. +---@return number miny # The minimum y coordinate of the vertices in the Model. +---@return number maxy # The maximum y coordinate of the vertices in the Model. +---@return number minz # The minimum z coordinate of the vertices in the Model. +---@return number maxz # The maximum z coordinate of the vertices in the Model. +function Model:getBoundingBox() end + --- ----### NOTE: ----Although texture coordinates will automatically be transformed by the Material's transform, the material transform is exposed as the `mat3 lovrMaterialTransform` uniform variable in shaders, allowing it to be used for other purposes. +---Returns a sphere approximately enclosing the vertices in the Model. --- ----@param ox number # The texture coordinate x offset. ----@param oy number # The texture coordinate y offset. ----@param sx number # The texture coordinate x scale. ----@param sy number # The texture coordinate y scale. ----@param angle number # The texture coordinate rotation, in radians. -function Material:setTransform(ox, oy, sx, sy, angle) end +---@return number x # The x coordinate of the position of the sphere. +---@return number y # The y coordinate of the position of the sphere. +---@return number z # The z coordinate of the position of the sphere. +---@return number radius # The radius of the bounding sphere. +function Model:getBoundingSphere() end --- ----A Mesh is a low-level graphics object that stores and renders a list of vertices. +---Returns the center of the Model's axis-aligned bounding box, relative to the Model's origin. --- ----Meshes are really flexible since you can pack pretty much whatever you want in them. +---@return number x # The x offset of the center of the bounding box. +---@return number y # The y offset of the center of the bounding box. +---@return number z # The z offset of the center of the bounding box. +function Model:getCenter() end + --- ----This makes them great for rendering arbitrary geometry, but it also makes them kinda difficult to use since you have to place each vertex yourself. +---Returns the ModelData this Model was created from. --- ----It's possible to batch geometry with Meshes too. +---@return lovr.ModelData data # The ModelData. +function Model:getData() end + --- ----Instead of drawing a shape 100 times, it's much faster to pack 100 copies of the shape into a Mesh and draw the Mesh once. +---Returns the depth of the Model, computed from its axis-aligned bounding box. --- ----Even storing just one copy in the Mesh and drawing that 100 times is usually faster. +---@return number depth # The depth of the Model. +function Model:getDepth() end + --- ----Meshes are also a good choice if you have an object that changes its shape over time. +---Returns the width, height, and depth of the Model, computed from its axis-aligned bounding box. --- +---@return number width # The width of the Model. +---@return number height # The height of the Model. +---@return number depth # The depth of the Model. +function Model:getDimensions() end + --- ----### NOTE: ----Each vertex in a Mesh can hold several pieces of data. +---Returns the height of the Model, computed from its axis-aligned bounding box. --- ----For example, you might want a vertex to keep track of its position, color, and a weight. +---@return number height # The height of the Model. +function Model:getHeight() end + --- ----Each one of these pieces of information is called a vertex **attribute**. +---TODO --- ----A vertex attribute must have a name, a type, and a size. +---@return lovr.Buffer buffer # TODO +function Model:getIndexBuffer() end + --- ----Here's what the "position" attribute would look like as a Lua table: +---TODO --- ---- { 'vPosition', 'float', 3 } -- 3 floats, one for x, y, and z +---@overload fun(self: lovr.Model, index: number):lovr.Material +---@param name string # The name of the Material to return. +---@return lovr.Material material # The material. +function Model:getMaterial(name) end + --- ----Every vertex in a Mesh must have the same set of attributes. +---Returns the number of materials in the Model. --- ----We call this set of attributes the **format** of the Mesh, and it's specified as a simple table of attributes. +---@return number count # The number of materials in the Model. +function Model:getMaterialCount() end + --- ----For example, we could represent the format described above as: +---TODO --- ---- { ---- { 'vPosition', 'float', 3 }, ---- { 'vColor', 'byte', 4 }, ---- { 'vWeight', 'int', 1 } ---- } +---@param index number # TODO +---@return string name # The name of the material. +function Model:getMaterialName(index) end + --- ----When creating a Mesh, you can give it any format you want, or use the default. +---Returns extra information stored in the model file. --- ----The default Mesh format looks like this: +---Currently this is only implemented for glTF models and returns the JSON string from the glTF or glb file. --- ---- { ---- { 'lovrPosition', 'float', 3 }, ---- { 'lovrNormal', 'float', 3 }, ---- { 'lovrTexCoord', 'float', 2 } ---- } +---The metadata can be used to get application-specific data or add support for glTF extensions not supported by LÖVR. --- ----Great, so why do we go through the trouble of naming everything in our vertex and saying what type and size it is? The cool part is that we can access this data in a Shader. +---@return string metadata # The metadata from the model file. +function Model:getMetadata() end + --- ----We can write a vertex Shader that has `in` variables for every vertex attribute in our Mesh: +---Given a parent node, this function returns a table with the indices of its children. --- ---- in vec3 vPosition; ---- in vec4 vColor; ---- in int vWeight; --- ---- vec4 position(mat4 projection, mat4 transform, vec4 vertex) { ---- // Here we can access the vPosition, vColor, and vWeight of each vertex in the Mesh! ---- } +---### NOTE: +---If the node does not have any children, this function returns an empty table. --- ----Specifying custom vertex data is really powerful and is often used for lighting, animation, and more! +---@overload fun(self: lovr.Model, name: string):table +---@param index number # The index of the parent node. +---@return table children # A table containing a node index for each child of the node. +function Model:getNodeChildren(index) end + --- ----For more on the different data types available for the attributes, see `AttributeType`. +---Returns the number of nodes in the model. --- ----@class lovr.Mesh -local Mesh = {} +---@return number count # The number of nodes in the model. +function Model:getNodeCount() end --- ----Attaches attributes from another Mesh onto this one. +---TODO --- ----This can be used to share vertex data across multiple meshes without duplicating the data, and can also be used for instanced rendering by using the `divisor` parameter. +---@overload fun(self: lovr.Model, name: string, index: number):lovr.MeshMode, lovr.Material, number, number, number +---@param node number # The index of the node. +---@param index number # The index of the draw. +---@return lovr.MeshMode mode # Whether the vertices are points, lines, or triangles. +---@return lovr.Material material # The Material used by the draw. +---@return number start # The offset of the first vertex in the draw. +---@return number count # The number of vertices in the draw. +---@return number base # The base vertex of the draw (added to each instance value), or nil if the draw does not use an index buffer. +function Model:getNodeDraw(node, index) end + --- +---TODO --- ----### NOTE: ----The attribute divisor is a number used to control how the attribute data relates to instancing. If 0, then the attribute data is considered "per vertex", and each vertex will get the next element of the attribute's data. +---@overload fun(self: lovr.Model, name: string):number +---@param index number # The index of a node. +---@return number count # The number of draws in the node. +function Model:getNodeDrawCount(index) end + +--- +---TODO --- ----If the divisor 1 or more, then the attribute data is considered "per instance", and every N instances will get the next element of the attribute data. +---@param index number # TODO +---@return string name # TODO +function Model:getNodeName(index) end + --- ----To prevent cycles, it is not possible to attach attributes onto a Mesh that already has attributes attached to a different Mesh. +---TODO --- ----@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 +---@overload fun(self: lovr.Model, name: string, origin?: lovr.OriginType):number, number, number, number +---@param index number # The index of the node. +---@param origin? lovr.OriginType # Whether the orientation should be returned relative to the root node or the node's parent. +---@return number angle # The number of radians the node is rotated around its axis of rotation. +---@return number ax # The x component of the axis of rotation. +---@return number ay # The y component of the axis of rotation. +---@return number az # The z component of the axis of rotation. +function Model:getNodeOrientation(index, origin) end --- ----Detaches attributes that were attached using `Mesh:attachAttributes`. +---Given a child node, this function returns the index of its parent. --- ----@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, ...) ----@overload fun(self: lovr.Mesh, mesh: lovr.Mesh, attributes: table) ----@param mesh lovr.Mesh # A Mesh. The names of all of the attributes from this Mesh will be detached. -function Mesh:detachAttributes(mesh) end +---@overload fun(self: lovr.Model, name: string):number +---@param index number # The index of the child node. +---@return number parent # The index of the parent. +function Model:getNodeParent(index) end --- ----Draws the contents of the Mesh. +---TODO --- ----@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. ----@param scale? number # The scale to draw the Mesh at. ----@param angle? number # The angle to rotate the Mesh around the axis of rotation, in radians. ----@param ax? number # The x component of the axis of rotation. ----@param ay? number # The y component of the axis of rotation. ----@param az? number # The z component of the axis of rotation. ----@param instances? number # The number of copies of the Mesh to draw. -function Mesh:draw(x, y, z, scale, angle, ax, ay, az, instances) end +---@overload fun(self: lovr.Model, name: string, origin?: lovr.OriginType):number, number, number, number, number, number, number +---@param index number # The index of a node. +---@param origin? lovr.OriginType # Whether the pose should be returned relative to the root node or the node's parent. +---@return number x # The x position of the node. +---@return number y # The y position of the node. +---@return number z # The z position of the node. +---@return number angle # The number of radians the node is rotated around its axis of rotation. +---@return number ax # The x component of the axis of rotation. +---@return number ay # The y component of the axis of rotation. +---@return number az # The z component of the axis of rotation. +function Model:getNodePose(index, origin) end --- ----Get the draw mode of the Mesh, which controls how the vertices are connected together. +---TODO --- ----@return lovr.DrawMode mode # The draw mode of the Mesh. -function Mesh:getDrawMode() end +---@overload fun(self: lovr.Model, name: string, space?: lovr.OriginType):number, number, number +---@param index number # The index of the node. +---@param space? lovr.OriginType # Whether the position should be returned relative to the root node or the node's parent. +---@return number x # The x coordinate. +---@return number y # The y coordinate. +---@return number z # The z coordinate. +function Model:getNodePosition(index, space) end --- ----Retrieve the current draw range for the Mesh. +---TODO --- ----The draw range is a subset of the vertices of the Mesh that will be drawn. +---@overload fun(self: lovr.Model, name: string, origin?: lovr.OriginType):number, number, number +---@param index number # The index of the node. +---@param origin? lovr.OriginType # Whether the scale should be returned relative to the root node or the node's parent. +---@return number x # The x scale. +---@return number y # The y scale. +---@return number z # The z scale. +function Model:getNodeScale(index, origin) end + +--- +---TODO --- ----@return number start # The index of the first vertex that will be drawn, or nil if no draw range is set. ----@return number count # The number of vertices that will be drawn, or nil if no draw range is set. -function Mesh:getDrawRange() end +---@overload fun(self: lovr.Model, name: string, origin?: lovr.OriginType):number, number, number, number, number, number, number, number, number, number +---@param index number # The index of a node. +---@param origin? lovr.OriginType # Whether the transform should be returned relative to the root node or the node's parent. +---@return number x # The x position of the node. +---@return number y # The y position of the node. +---@return number z # The z position of the node. +---@return number sx # The x scale of the node. +---@return number sy # The y scale of the node. +---@return number sz # The z scale of the node. +---@return number angle # The number of radians the node is rotated around its axis of rotation. +---@return number ax # The x component of the axis of rotation. +---@return number ay # The y component of the axis of rotation. +---@return number az # The z component of the axis of rotation. +function Model:getNodeTransform(index, origin) end --- ----Get the Material applied to the Mesh. +---Returns the index of the model's root node. --- ----@return lovr.Material material # The current material applied to the Mesh. -function Mesh:getMaterial() end +---@return number root # The index of the root node. +function Model:getRootNode() end --- ----Gets the data for a single vertex in the Mesh. +---TODO --- ----The set of data returned depends on the Mesh's vertex format. +---@return lovr.Texture texture # TODO +function Model:getTexture() end + --- ----The default vertex format consists of 8 floating point numbers: the vertex position, the vertex normal, and the texture coordinates. +---Returns the number of textures in the Model. --- ----@param index number # The index of the vertex to retrieve. -function Mesh:getVertex(index) end +---@return number count # The number of textures in the Model. +function Model:getTextureCount() end --- ----Returns the components of a specific attribute of a single vertex in the Mesh. +---Returns the total number of triangles in the Model. --- --- ---### NOTE: ----Meshes without a custom format have the vertex position as their first attribute, the normal vector as the second attribute, and the texture coordinate as the third attribute. +---This isn't always related to the length of the vertex buffer, since a mesh in the Model could be drawn by multiple nodes. --- ----@param index number # The index of the vertex to retrieve the attribute of. ----@param attribute number # The index of the attribute to retrieve the components of. -function Mesh:getVertexAttribute(index, attribute) end +---@return number count # The total number of triangles in the Model. +function Model:getTriangleCount() end --- ----Returns the maximum number of vertices the Mesh can hold. +---Returns 2 tables containing mesh data for the Model. +--- +---The first table is a list of vertex positions and contains 3 numbers for the x, y, and z coordinate of each vertex. +--- +---The second table is a list of triangles and contains 1-based indices into the first table representing the first, second, and third vertices that make up each triangle. +--- +---The vertex positions will be affected by node transforms. --- --- ---### NOTE: ----The size can only be set when creating the Mesh, and cannot be changed afterwards. +---After this function is called on a Model once, the result is cached (in its ModelData). --- ----A subset of the Mesh's vertices can be rendered, see `Mesh:setDrawRange`. +---@return table vertices # The triangle vertex positions, returned as a flat (non-nested) table of numbers. The position of each vertex is given as an x, y, and z coordinate. +---@return table indices # The vertex indices. Every 3 indices describes a triangle. +function Model:getTriangles() end + --- ----@return number size # The number of vertices the Mesh can hold. -function Mesh:getVertexCount() end +---TODO +--- +---@return lovr.Buffer buffer # TODO +function Model:getVertexBuffer() end --- ----Get the format table of the Mesh's vertices. +---Returns the total vertex count of the Model. +--- +--- +---### NOTE: +---This isn't always the same as the length of the vertex buffer, since a mesh in the Model could be drawn by multiple nodes. +--- +---@return number count # The total number of vertices. +function Model:getVertexCount() end + --- ----The format table describes the set of data that each vertex contains. +---Returns the width of the Model, computed from its axis-aligned bounding box. --- ----@return table format # The table of vertex attributes. Each attribute is a table containing the name of the attribute, the `AttributeType`, and the number of components. -function Mesh:getVertexFormat() end +---@return number width # The width of the Model. +function Model:getWidth() end --- ----Returns the current vertex map for the Mesh. +---TODO --- ----The vertex map is a list of indices in the Mesh, allowing the reordering or reuse of vertices. --- ----@overload fun(self: lovr.Mesh, t: table):table ----@overload fun(self: lovr.Mesh, blob: lovr.Blob) ----@return table map # The list of indices in the vertex map, or `nil` if no vertex map is set. -function Mesh:getVertexMap() end +---### NOTE: +---TODO it's computed as skinCount TODO it's different from animationCount +--- +---@return boolean jointed # Whether the animation uses joints for skeletal animation. +function Model:hasJoints() end --- ----Returns whether or not a vertex attribute is enabled. +---TODO +--- +---@overload fun(self: lovr.Model, name: string, orientation: lovr.rotation, blend?: number) +---@param index number # The index of the node. +---@param orientation lovr.rotation # The target orientation. +---@param blend? number # A number from 0 to 1 indicating how much of the target orientation to blend in. A value of 0 will not change the node's orientation at all, whereas 1 will fully blend to the target orientation. +function Model:setNodeOrientation(index, orientation, blend) end + --- ----Disabled attributes won't be sent to shaders. +---TODO --- ----@param attribute string # The name of the attribute. ----@return boolean enabled # Whether or not the attribute is enabled when drawing the Mesh. -function Mesh:isAttributeEnabled(attribute) end +---@overload fun(self: lovr.Model, name: string, position: lovr.vector3, orientation: lovr.rotation, blend?: number) +---@param index number # The index of the node. +---@param position lovr.vector3 # The target position. +---@param orientation lovr.rotation # The target orientation. +---@param blend? number # A number from 0 to 1 indicating how much of the target pose to blend in. A value of 0 will not change the node's pose at all, whereas 1 will fully blend to the target pose. +function Model:setNodePose(index, position, orientation, blend) end --- ----Sets whether a vertex attribute is enabled. +---TODO +--- +---@overload fun(self: lovr.Model, name: string, position: lovr.vector3, blend?: number) +---@param index number # The index of the node. +---@param position lovr.vector3 # The target position. +---@param blend? number # A number from 0 to 1 indicating how much of the target position to blend in. A value of 0 will not change the node's position at all, whereas 1 will fully blend to the target position. +function Model:setNodePosition(index, position, blend) end + --- ----Disabled attributes won't be sent to shaders. +---TODO --- ----@param attribute string # The name of the attribute. ----@param enabled boolean # Whether or not the attribute is enabled when drawing the Mesh. -function Mesh:setAttributeEnabled(attribute, enabled) end +---@overload fun(self: lovr.Model, name: string, scale: lovr.vector3, blend?: number) +---@param index number # The index of the node. +---@param scale lovr.vector3 # The target scale. +---@param blend? number # A number from 0 to 1 indicating how much of the target scale to blend in. A value of 0 will not change the node's scale at all, whereas 1 will fully blend to the target scale. +function Model:setNodeScale(index, scale, blend) end --- ----Set a new draw mode for the Mesh. +---TODO --- ----@param mode lovr.DrawMode # The new draw mode for the Mesh. -function Mesh:setDrawMode(mode) end +---@overload fun(self: lovr.Model, name: string, transform: lovr.transform, blend?: number) +---@param index number # The index of the node. +---@param transform lovr.transform # The target transform. +---@param blend? number # A number from 0 to 1 indicating how much of the target transform to blend in. A value of 0 will not change the node's transform at all, whereas 1 will fully blend to the target transform. +function Model:setNodeTransform(index, transform, blend) end --- ----Set the draw range for the Mesh. +---TODO +--- +---@class lovr.Pass +local Pass = {} + --- ----The draw range is a subset of the vertices of the Mesh that will be drawn. +---TODO --- ----@overload fun(self: lovr.Mesh) ----@param start number # The first vertex that will be drawn. ----@param count number # The number of vertices that will be drawn. -function Mesh:setDrawRange(start, count) end +---@param src lovr.Texture # TODO +---@param dst lovr.Texture # TODO +---@param srcx? number # TODO +---@param srcy? number # TODO +---@param srcz? number # TODO +---@param dstx? number # TODO +---@param dsty? number # TODO +---@param dstz? number # TODO +---@param srcw? number # TODO +---@param srch? number # TODO +---@param srcd? number # TODO +---@param dstw? number # TODO +---@param dsth? number # TODO +---@param dstd? number # TODO +---@param srclevel? number # TODO +---@param dstlevel? number # TODO +function Pass:blit(src, dst, srcx, srcy, srcz, dstx, dsty, dstz, srcw, srch, srcd, dstw, dsth, dstd, srclevel, dstlevel) end --- ----Applies a Material to the Mesh. +---TODO +--- --- ----This will cause it to use the Material's properties whenever it is rendered. +---### NOTE: +---TODO --- ----@param material lovr.Material # The Material to apply. -function Mesh:setMaterial(material) end +---@param transform lovr.Transform3 # The transform to apply to the box. +---@param style? lovr.DrawStyle # Whether the box should be drawn filled or outlined. +function Pass:box(transform, style) end --- ----Update a single vertex in the Mesh. +---TODO --- --- ---### NOTE: ----Any unspecified components will be set to 0. +---TODO --- ----@param index number # The index of the vertex to set. ----@vararg number # The attributes of the vertex. -function Mesh:setVertex(index, ...) end +---@overload fun(self: lovr.Pass, p1: lovr.Point3, p2: lovr.Point3, segments?: number) +---@param transform lovr.TransformXY2 # The transform to apply to the capsule. The x and y scale is the radius, the z scale is the length. +---@param segments? number # The number of circular segments to render. +function Pass:capsule(transform, segments) end --- ----Set the components of a specific attribute of a vertex in the Mesh. +---TODO --- --- ---### NOTE: ----Meshes without a custom format have the vertex position as their first attribute, the normal vector as the second attribute, and the texture coordinate as the third attribute. +---TODO --- ----@param index number # The index of the vertex to update. ----@param attribute number # The index of the attribute to update. ----@vararg number # The new components for the attribute. -function Mesh:setVertexAttribute(index, attribute, ...) end +---@param transform lovr.Transform # The transform to apply to the circle. +---@param style? lovr.DrawStyle # Whether the circle should be filled or outlined. +---@param angle1? number # The angle of the beginning of the arc. +---@param angle2? number # angle of the end of the arc. +---@param segments? number # The number of segments to render. +function Pass:circle(transform, style, angle1, angle2, segments) end --- ----Sets the vertex map. +---TODO --- ----The vertex map is a list of indices in the Mesh, allowing the reordering or reuse of vertices. --- ----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. +---### NOTE: +---TODO --- ----@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 +---@overload fun(self: lovr.Pass, texture: lovr.Texture, color: lovr.Color, layer?: number, layers?: number, level?: number, levels?: number) +---@param buffer lovr.Buffer # The Buffer to clear. +---@param offset number # TODO +---@param extent number # TODO +function Pass:clear(buffer, offset, extent) end --- ----Updates multiple vertices in the Mesh. +---TODO --- --- ---### NOTE: ----The start index plus the number of vertices in the table should not exceed the maximum size of the Mesh. +---TODO --- ----@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. -function Mesh:setVertices(vertices, start, count) end +---@overload fun(self: lovr.Pass, buffer: lovr.Buffer, offset?: number) +---@param x? number # How many workgroups to dispatch in the x dimension. +---@param y? number # How many workgroups to dispatch in the y dimension. +---@param z? number # How many workgroups to dispatch in the z dimension. +function Pass:compute(x, y, z) end --- ----A Model is a drawable object loaded from a 3D file format. +---TODO --- ----The supported 3D file formats are OBJ, glTF, and STL. --- ----@class lovr.Model -local Model = {} +---### NOTE: +---TODO +--- +---@param transform lovr.TransformXY2 # The transform to apply to the cone. The x and y scale is the radius, the z scale is the length. +---@param segments? number # The number of circular segments to render. +function Pass:cone(transform, segments) end --- ----Applies an animation to the current pose of the Model. +---TODO --- ----The animation is evaluated at the specified timestamp, and mixed with the current pose of the Model using the alpha value. +---@overload fun(self: lovr.Pass, blob: lovr.Blob, bufferdst: lovr.Buffer, srcoffset?: number, dstoffset?: number, size?: number) +---@overload fun(self: lovr.Pass, buffersrc: lovr.Buffer, bufferdst: lovr.Buffer, srcoffset?: number, dstoffset?: number, size?: number) +---@overload fun(self: lovr.Pass, image: lovr.Image, texturedst: lovr.Texture, srcx?: number, srcy?: number, dstx?: number, dsty?: number, width?: number, height?: number, srclayer?: number, dstlayer?: number, layers?: number, srclevel?: number, dstlevel?: number) +---@overload fun(self: lovr.Pass, texturesrc: lovr.Texture, texturedst: lovr.Texture, srcx?: number, srcy?: number, dstx?: number, dsty?: number, width?: number, height?: number, srclayer?: number, dstlayer?: number, layers?: number, srclevel?: number, dstlevel?: number) +---@overload fun(self: lovr.Pass, tally: lovr.Tally, srcindex?: number, dstoffset?: number, count?: number) +---@param table table # TODO +---@param bufferdst lovr.Buffer # TODO +---@param srcindex? number # TODO +---@param dstindex? number # TODO +---@param count? number # TODO +function Pass:copy(table, bufferdst, srcindex, dstindex, count) end + --- ----An alpha value of 1.0 will completely override the pose of the Model with the animation's pose. +---TODO --- --- ---### NOTE: ----For animations to properly show up, use a Shader created with the `animated` flag set to `true`. See `lovr.graphics.newShader` for more. +---TODO --- ----Animations are always mixed in with the current pose, and the pose only ever changes by calling `Model:animate` and `Model:pose`. +---@param transform lovr.Transform # The transform to apply to the cube. +---@param style? lovr.DrawStyle # Whether the cube should be drawn filled or outlined. +function Pass:cube(transform, style) end + --- ----To clear the pose of a Model to the default, use `Model:pose(nil)`. +---TODO --- ----@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. -function Model:animate(name, time, alpha) end - --- ----Draw the Model. +---### NOTE: +---TODO --- ----@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. ----@param scale? number # The scale to draw the Model at. ----@param angle? number # The angle to rotate the Model around the axis of rotation, in radians. ----@param ax? number # The x component of the axis of rotation. ----@param ay? number # The y component of the axis of rotation. ----@param az? number # The z component of the axis of rotation. ----@param instances? number # The number of copies of the Model to draw. -function Model:draw(x, y, z, scale, angle, ax, ay, az, instances) end +---@overload fun(self: lovr.Pass, p1: lovr.Point3, p2: lovr.Point3, capped?: boolean, angle1?: number, angle2?: number, segments?: number) +---@param transform lovr.TransformXY2 # The transform to apply to the cylinder. The x and y scale is the radius, the z scale is the length. +---@param capped? boolean # Whether the tops and bottoms of the cylinder should be rendered. +---@param angle1? number # The angle of the beginning of the arc. +---@param angle2? number # angle of the end of the arc. +---@param segments? number # The number of circular segments to render. +function Pass:cylinder(transform, capped, angle1, angle2, segments) end --- ----Returns a bounding box that encloses the vertices of the Model. +---TODO --- ----@return number minx # The minimum x coordinate of the box. ----@return number maxx # The maximum x coordinate of the box. ----@return number miny # The minimum y coordinate of the box. ----@return number maxy # The maximum y coordinate of the box. ----@return number minz # The minimum z coordinate of the box. ----@return number maxz # The maximum z coordinate of the box. -function Model:getAABB() end +---@overload fun(self: lovr.Pass, model: lovr.Model, transform: lovr.Transform, nodename: string, children: boolean, instances: number) +---@param model lovr.Model # The model to draw. +---@param transform lovr.Transform # The transform of the object. +---@param nodeindex number # TODO +---@param children boolean # TODO +---@param instances number # TODO +function Pass:draw(model, transform, nodeindex, children, instances) end --- ----Returns the number of animations in the Model. +---TODO --- ----@return number count # The number of animations in the Model. -function Model:getAnimationCount() end +---@overload fun(self: lovr.Pass) +---@param texture lovr.Texture # The texture to fill. +function Pass:fill(texture) end --- ----Returns the duration of an animation in the Model, in seconds. +---TODO --- ----@overload fun(self: lovr.Model, index: number):number ----@param name string # The name of the animation. ----@return number duration # The duration of the animation, in seconds. -function Model:getAnimationDuration(name) end - --- ----Returns the name of one of the animations in the Model. +---### NOTE: +---TODO --- ----@param index number # The index of the animation to get the name of. ----@return string name # The name of the animation. -function Model:getAnimationName(index) end +---@return table clears # TODO +function Pass:getClear() end --- ----Returns a Material loaded from the Model, by name or index. ---- ----This includes `Texture` objects and other properties like colors, metalness/roughness, and more. +---TODO --- ----@overload fun(self: lovr.Model, index: number):lovr.Material ----@param name string # The name of the Material to return. ----@return lovr.Material material # The material. -function Model:getMaterial(name) end +---@return number width # TODO +---@return number height # TODO +function Pass:getDimensions() end --- ----Returns the number of materials in the Model. +---TODO --- ----@return number count # The number of materials in the Model. -function Model:getMaterialCount() end +---@return number height # TODO +function Pass:getHeight() end --- ----Returns the name of one of the materials in the Model. +---Returns the projection for a single view. --- ----@param index number # The index of the material to get the name of. ----@return string name # The name of the material. -function Model:getMaterialName(index) end +---@overload fun(self: lovr.Pass, view: number, matrix: lovr.Mat4):lovr.Mat4 +---@param view number # The view index. +---@return number left # The left field of view angle, in radians. +---@return number right # The right field of view angle, in radians. +---@return number up # The top field of view angle, in radians. +---@return number down # The bottom field of view angle, in radians. +function Pass:getProjection(view) end --- ----Returns the number of nodes (bones) in the Model. +---TODO --- ----@return number count # The number of nodes in the Model. -function Model:getNodeCount() end +---@return number samples # TODO +function Pass:getSampleCount() end --- ----Returns the name of one of the nodes (bones) in the Model. +---TODO --- ----@param index number # The index of the node to get the name of. ----@return string name # The name of the node. -function Model:getNodeName(index) end +---@return table target # TODO +function Pass:getTarget() end --- ----Returns the pose of a single node in the Model in a given `CoordinateSpace`. +---TODO --- +---@return lovr.PassType type # The type of the Pass. +function Pass:getType() end + --- ----### NOTE: ----For skinned nodes to render correctly, use a Shader created with the `animated` flag set to `true`. +---TODO --- ----See `lovr.graphics.newShader` for more. +---@return number views # TODO +function Pass:getViewCount() end + --- ----@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. ----@return number y # The y position of the node. ----@return number z # The z position of the node. ----@return number angle # The number of radians the node is rotated around its rotational axis. +---Get the pose of a single view. +--- +---@overload fun(self: lovr.Pass, view: number, matrix: lovr.Mat4, invert: boolean):lovr.Mat4 +---@param view number # The view index. +---@return number x # The x position of the viewer, in meters. +---@return number y # The y position of the viewer, in meters. +---@return number z # The z position of the viewer, in meters. +---@return number angle # The number of radians the viewer is rotated around its axis of rotation. ---@return number ax # The x component of the axis of rotation. ---@return number ay # The y component of the axis of rotation. ---@return number az # The z component of the axis of rotation. -function Model:getNodePose(name, space) end +function Pass:getViewPose(view) end --- ----Returns 2 tables containing mesh data for the Model. +---TODO --- ----The first table is a list of vertex positions and contains 3 numbers for the x, y, and z coordinate of each vertex. +---@return number width # TODO +function Pass:getWidth() end + --- ----The second table is a list of triangles and contains 1-based indices into the first table representing the first, second, and third vertices that make up each triangle. +---TODO --- ----The vertex positions will be affected by node transforms. --- ----@return table vertices # A flat table of numbers containing vertex positions. ----@return table indices # A flat table of numbers containing triangle vertex indices. -function Model:getTriangles() end - +---### NOTE: +---TODO --- ----Returns whether the Model has any nodes associated with animated joints. +---@overload fun(self: lovr.Pass, t: table) +---@overload fun(self: lovr.Pass, v1: lovr.Vec3, v2: lovr.Vec3, ...) +---@param x1 number # The x coordinate of the first point. +---@param y1 number # The y coordinate of the first point. +---@param z1 number # The z coordinate of the first point. +---@param x2 number # The x coordinate of the next point. +---@param y2 number # The y coordinate of the next point. +---@param z2 number # The z coordinate of the next point. +---@vararg any # More points to add to the line. +function Pass:line(x1, y1, z1, x2, y2, z2, ...) end + --- ----This can be used to approximately determine whether an animated shader needs to be used with an arbitrary Model. +---TODO --- --- ---### NOTE: ----A model can still be animated even if this function returns false, since node transforms can still be animated with keyframes without skinning. +---TODO --- ----These types of animations don't need to use a Shader with the `animated = true` flag, though. ---- ----@return boolean skeletal # Whether the Model has any nodes that use skeletal animation. -function Model:hasJoints() end +---@overload fun(self: lovr.Pass, vertices?: lovr.Buffer, indices: lovr.Buffer, transform: lovr.transform, start?: number, count?: number, instances?: number) +---@overload fun(self: lovr.Pass, vertices?: lovr.Buffer, indices: lovr.Buffer, draws: lovr.Buffer, drawcount: number, offset: number, stride: number) +---@param vertices? lovr.Buffer # TODO +---@param transform lovr.transform # The transform to apply to the mesh. +---@param start? number # The 1-based index of the first vertex to render from the vertex buffer (or the first index, when using an index buffer). +---@param count? number # The number of vertices to render (or the number of indices, when using an index buffer). When `nil`, as many vertices or indices as possible will be drawn (based on the length of the Buffers and `start`). +---@param instances? number # The number of copies of the mesh to render. +function Pass:mesh(vertices, transform, start, count, instances) end --- ----Applies a pose to a single node of the Model. +---TODO --- ----The input pose is assumed to be relative to the pose of the node's parent. +---@param texture lovr.Texture # TODO +---@param base? number # TODO +---@param count? number # TODO +function Pass:mipmap(texture, base, count) end + +--- +---TODO --- ----This is useful for applying inverse kinematics (IK) to a chain of bones in a skeleton. +function Pass:origin() end + --- ----The alpha parameter can be used to mix between the node's current pose and the input pose. +---TODO --- --- ---### NOTE: ----For skinned nodes to render correctly, use a Shader created with the `animated` flag set to `true`. ---- ----See `lovr.graphics.newShader` for more. +---TODO --- ----@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. ----@param y number # The y position. ----@param z number # The z position. ----@param angle number # The angle of rotation around the axis, in radians. ----@param ax number # The x component of the rotation axis. ----@param ay number # The y component of the rotation axis. ----@param az number # The z component of the rotation axis. ----@param alpha? number # How much of the pose to mix in, from 0 to 1. -function Model:pose(name, x, y, z, angle, ax, ay, az, alpha) end +---@param transform lovr.Transform2 # The transform to apply to the plane. +---@param style? lovr.DrawStyle # Whether the plane should be drawn filled or outlined. +---@param columns? number # The number of horizontal segments in the plane. +---@param rows? number # The number of vertical segments in the plane. +function Pass:plane(transform, style, columns, rows) end --- ----Shaders are GLSL programs that transform the way vertices and pixels show up on the screen. They can be used for lighting, postprocessing, particles, animation, and much more. +---TODO --- ----You can use `lovr.graphics.setShader` to change the active Shader. +--- +---### NOTE: +---TODO +--- +---@overload fun(self: lovr.Pass, t: table) +---@overload fun(self: lovr.Pass, v: lovr.Vec3, ...) +---@param x number # The x coordinate of the first point. +---@param y number # The y coordinate of the first point. +---@param z number # The z coordinate of the first point. +---@vararg any # More points. +function Pass:points(x, y, z, ...) end + +--- +---TODO --- --- ---### NOTE: ----GLSL version `330` is used on desktop systems, and `300 es` on WebGL/Android. +---TODO stack balancing/error +--- +---@param stack? lovr.StackType # The type of stack to pop. +function Pass:pop(stack) end + +--- +---TODO --- ----The default vertex shader: --- ---- vec4 position(mat4 projection, mat4 transform, vec4 vertex) { ---- return projection * transform * vertex; ---- } +---### NOTE: +---TODO stack balancing/error +--- +---@param stack? lovr.StackType # The type of stack to push. +function Pass:push(stack) end + --- ----The default fragment shader: +---TODO --- ---- vec4 color(vec4 graphicsColor, sampler2D image, vec2 uv) { ---- return graphicsColor * lovrDiffuseColor * lovrVertexColor * texture(image, uv); ---- } +---@overload fun(self: lovr.Pass, texture: lovr.Texture, x?: number, y?: number, layer?: number, level?: number, width?: number, height?: number):lovr.Readback +---@overload fun(self: lovr.Pass, tally: lovr.Tally, index: number, count: number):lovr.Readback +---@param buffer lovr.Buffer # TODO +---@param index number # TODO +---@param count number # TODO +---@return lovr.Readback readback # TODO +function Pass:read(buffer, index, count) end + --- ----Additionally, the following headers are prepended to the shader source, giving you convenient access to a default set of uniform variables and vertex attributes. +---TODO --- ----Vertex shader header: --- ---- in vec3 lovrPosition; // The vertex position ---- in vec3 lovrNormal; // The vertex normal vector ---- in vec2 lovrTexCoord; ---- in vec4 lovrVertexColor; ---- in vec3 lovrTangent; ---- in uvec4 lovrBones; ---- in vec4 lovrBoneWeights; ---- in uint lovrDrawID; ---- out vec4 lovrGraphicsColor; ---- uniform mat4 lovrModel; ---- uniform mat4 lovrView; ---- uniform mat4 lovrProjection; ---- uniform mat4 lovrTransform; // Model-View matrix ---- uniform mat3 lovrNormalMatrix; // Inverse-transpose of lovrModel ---- uniform mat3 lovrMaterialTransform; ---- uniform float lovrPointSize; ---- uniform mat4 lovrPose[48]; ---- uniform int lovrViewportCount; ---- uniform int lovrViewID; ---- const mat4 lovrPoseMatrix; // Bone-weighted pose ---- const int lovrInstanceID; // Current instance ID +---### NOTE: +---TODO axis does not need to be normalized TODO order matters --- ----Fragment shader header: +---@overload fun(self: lovr.Pass, q: lovr.Quat) +---@param angle? number # The number of radians to rotate around the axis of rotation. +---@param ax? number # The x component of the axis of rotation. +---@param ay? number # The y component of the axis of rotation. +---@param az? number # The z component of the axis of rotation. +function Pass:rotate(angle, ax, ay, az) end + --- ---- in vec2 lovrTexCoord; ---- in vec4 lovrVertexColor; ---- in vec4 lovrGraphicsColor; ---- out vec4 lovrCanvas[gl_MaxDrawBuffers]; ---- uniform float lovrMetalness; ---- uniform float lovrRoughness; ---- uniform vec4 lovrDiffuseColor; ---- uniform vec4 lovrEmissiveColor; ---- uniform sampler2D lovrDiffuseTexture; ---- uniform sampler2D lovrEmissiveTexture; ---- uniform sampler2D lovrMetalnessTexture; ---- uniform sampler2D lovrRoughnessTexture; ---- uniform sampler2D lovrOcclusionTexture; ---- uniform sampler2D lovrNormalTexture; ---- uniform samplerCube lovrEnvironmentTexture; ---- uniform int lovrViewportCount; ---- uniform int lovrViewID; +---TODO --- ----### Compute Shaders +---@overload fun(self: lovr.Pass, v: lovr.Vec3) +---@param x? number # The amount to scale the x axis. +---@param y? number # The amount to scale the y axis. +---@param z? number # The amount to scale the z axis. +function Pass:scale(x, y, z) end + --- ----Compute shaders can be created with `lovr.graphics.newComputeShader` and run with `lovr.graphics.compute`. +---TODO --- ----Currently, compute shaders are written with raw GLSL. --- ----There is no default compute shader, instead the `void compute();` function must be implemented. +---### NOTE: +---TODO --- ----You can use the `layout` qualifier to specify a local work group size: +---@overload fun(self: lovr.Pass, name: string, texture: lovr.Texture) +---@overload fun(self: lovr.Pass, name: string, sampler: lovr.Sampler) +---@overload fun(self: lovr.Pass, name: string, constant: any) +---@overload fun(self: lovr.Pass, binding: number, buffer: lovr.Buffer) +---@overload fun(self: lovr.Pass, binding: number, texture: lovr.Texture) +---@overload fun(self: lovr.Pass, binding: number, sampler: lovr.Sampler) +---@param name string # The name of the Shader variable. +---@param buffer lovr.Buffer # The Buffer to assign. +function Pass:send(name, buffer) end + --- ---- layout(local_size_x = X, local_size_y = Y, local_size_z = Z) in; +---TODO --- ----And the following built in variables can be used: +---@param enable boolean # Whether alpha to coverage should be enabled. +function Pass:setAlphaToCoverage(enable) end + --- ---- in uvec3 gl_NumWorkGroups; // The size passed to lovr.graphics.compute ---- in uvec3 gl_WorkGroupSize; // The local work group size ---- in uvec3 gl_WorkGroupID; // The current global work group ---- in uvec3 gl_LocalInvocationID; // The current local work group ---- in uvec3 gl_GlobalInvocationID; // A unique ID combining the global and local IDs ---- in uint gl_LocalInvocationIndex; // A 1D index of the LocalInvocationID +---TODO --- ----Compute shaders don't return anything but they can write data to `Texture`s or `ShaderBlock`s. To bind a texture in a way that can be written to a compute shader, declare the uniforms with a type of `image2D`, `imageCube`, etc. instead of the usual `sampler2D` or `samplerCube`. --- ----Once a texture is bound to an image uniform, you can use the `imageLoad` and `imageStore` GLSL functions to read and write pixels in the image. +---### NOTE: +---TODO --- ----Variables in `ShaderBlock`s can be written to using assignment syntax. +---@param blend lovr.BlendMode # The blend mode. +---@param alphaBlend lovr.BlendAlphaMode # The alpha blend mode. +function Pass:setBlendMode(blend, alphaBlend) end + --- ----LÖVR handles synchronization of textures and shader blocks so there is no need to use manual memory barriers to synchronize writes to resources from compute shaders. +---TODO --- ----@class lovr.Shader -local Shader = {} +---@param color lovr.Color # The new color. +function Pass:setColor(color) end --- ----Returns the type of the Shader, which will be "graphics" or "compute". +---TODO --- ----Graphics shaders are created with `lovr.graphics.newShader` and can be used for rendering with `lovr.graphics.setShader`. --- ----Compute shaders are created with `lovr.graphics.newComputeShader` and can be run using `lovr.graphics.compute`. +---### NOTE: +---TODO --- ----@return lovr.ShaderType type # The type of the Shader. -function Shader:getType() end +---@param r boolean # Whether the red component should be affected by drawing. +---@param g boolean # Whether the green component should be affected by drawing. +---@param b boolean # Whether the blue component should be affected by drawing. +---@param a boolean # Whether the alpha component should be affected by drawing. +function Pass:setColorWrite(r, g, b, a) end --- ----Returns whether a Shader has a block. +---TODO --- ----A block is added to the Shader code at creation time using `ShaderBlock:getShaderCode`. --- ----The block name (not the namespace) is used to link up the ShaderBlock object to the Shader. ---- ----This function can be used to check if a Shader was created with a block using the given name. +---### NOTE: +---TODO --- ----@param block string # The name of the block. ----@return boolean present # Whether the shader has the specified block. -function Shader:hasBlock(block) end +---@param mode? lovr.CullMode # Whether `front` faces, `back` faces, or `none` of the faces should be culled. +function Pass:setCullMode(mode) end --- ----Returns whether a Shader has a particular uniform variable. +---TODO --- --- ---### NOTE: ----If a uniform variable is defined but unused in the shader, the shader compiler will optimize it out and the uniform will not report itself as present. +---TODO depthClamp feature! --- ----@param uniform string # The name of the uniform variable. ----@return boolean present # Whether the shader has the specified uniform. -function Shader:hasUniform(uniform) end +---@param enable boolean # Whether depth clamp should be enabled. +function Pass:setDepthClamp(enable) end --- ----Updates a uniform variable in the Shader. +---TODO --- --- ---### NOTE: ----The shader does not need to be active to update its uniforms. ---- ----The following type combinations are supported: ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
Uniform typeLÖVR type
floatnumber
intnumber
vec2{ x, y }
vec3{ x, y, z } or vec3
vec4{ x, y, z, w }
ivec2{ x, y }
ivec3{ x, y, z }
ivec4{ x, y, z, w }
mat2{ x, ... }
mat3{ x, ... }
mat4{ x, ... } or mat4
samplerTexture
imageTexture
---- ----Uniform arrays can be wrapped in tables or passed as multiple arguments. +---TODO --- ----Textures must match the type of sampler or image they are being sent to. +---@param offset? number # The depth offset. +---@param sloped? number # The sloped depth offset. +function Pass:setDepthOffset(offset, sloped) end + --- ----The following sampler (and image) types are currently supported: +---TODO --- ----- `sampler2D` ----- `sampler3D` ----- `samplerCube` ----- `sampler2DArray` --- ----`Blob`s can be used to pass arbitrary binary data to Shader variables. +---### NOTE: +---TODO --- ----@param uniform string # The name of the uniform to update. ----@param value any # The new value of the uniform. ----@return boolean success # Whether the uniform exists and was updated. -function Shader:send(uniform, value) end +---@overload fun(self: lovr.Pass) +---@param test lovr.CompareMode # The new depth test to use. +function Pass:setDepthTest(test) end --- ----Sends a ShaderBlock to a Shader. ---- ----After the block is sent, you can update the data in the block without needing to resend the block. ---- ----The block can be sent to multiple shaders and they will all see the same data from the block. +---TODO --- --- ---### NOTE: ----The Shader does not need to be active to send it a block. +---TODO --- ----Make sure the ShaderBlock's variables line up with the block variables declared in the shader code, otherwise you'll get garbage data in the block. +---@param write boolean # The new depth write setting. +function Pass:setDepthWrite(write) end + --- ----An easy way to do this is to use `ShaderBlock:getShaderCode` to get a GLSL snippet that is compatible with the block. +---TODO --- ----@param name string # The name of the block to send to. ----@param block lovr.ShaderBlock # The ShaderBlock to associate with the specified block. ----@param access? lovr.UniformAccess # How the Shader will use this block (used as an optimization hint). -function Shader:sendBlock(name, block, access) end +---@param font lovr.Font # The Font to use when rendering text. +function Pass:setFont(font) end --- ----Sends a Texture to a Shader for writing. +---TODO --- ----This is meant to be used with compute shaders and only works with uniforms declared as `image2D`, `imageCube`, `image2DArray`, and `image3D`. +---@param material lovr.Material # TODO +function Pass:setMaterial(material) end + --- ----The normal `Shader:send` function accepts Textures and should be used most of the time. +---TODO --- ----@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. ----@param mipmap? number # The mipmap of the texture to use. ----@param access? lovr.UniformAccess # Whether the image will be read from, written to, or both. -function Shader:sendImage(name, texture, slice, mipmap, access) end +---@param mode lovr.MeshMode # TODO +function Pass:setMeshMode(mode) end --- ----ShaderBlocks are objects that can hold large amounts of data and can be sent to Shaders. +---Sets the projection for a single view. +--- +---4 field of view angles can be used, similar to the field of view returned by `lovr.headset.getViewAngles`. --- ----It is common to use "uniform" variables to send data to shaders, but uniforms are usually limited to a few kilobytes in size. +---Alternatively, a projection matrix can be used for other types of projections like orthographic, oblique, etc. --- ----ShaderBlocks are useful for a few reasons: +---There is also a shorthand string "orthographic" that can be used to configure an orthographic projection. --- ----- They can hold a lot more data. ----- Shaders can modify the data in them, which is really useful for compute shaders. ----- Setting the data in a ShaderBlock updates the data for all Shaders using the block, so you ---- don't need to go around setting the same uniforms in lots of different shaders. +---Up to 6 views are supported. --- ----On systems that support compute shaders, ShaderBlocks can optionally be "writable". +---When rendering to the headset, both projections are changed to match the ones used by the headset. --- ----A writable ShaderBlock is a little bit slower than a non-writable one, but shaders can modify its contents and it can be much, much larger than a non-writable ShaderBlock. +---This is also available by calling `lovr.headset.getViewAngles`. --- --- ---### NOTE: ----- A Shader can use up to 8 ShaderBlocks. ----- ShaderBlocks can not contain textures. ----- Some systems have bugs with `vec3` variables in ShaderBlocks. +---A far clipping plane of 0.0 can be used for an infinite far plane with reversed Z range. --- ----If you run into strange bugs, ---- try switching to a `vec4` for the variable. +---This is the default. --- ----@class lovr.ShaderBlock -local ShaderBlock = {} +---@overload fun(self: lovr.Pass, view: number, matrix: lovr.Mat4) +---@param view number # The index of the view to update. +---@param left number # The left field of view angle, in radians. +---@param right number # The right field of view angle, in radians. +---@param up number # The top field of view angle, in radians. +---@param down number # The bottom field of view angle, in radians. +---@param near? number # The near clipping plane distance, in meters. +---@param far? number # The far clipping plane distance, in meters. +function Pass:setProjection(view, left, right, up, down, near, far) end --- ----Returns the byte offset of a variable in a ShaderBlock. +---TODO --- ----This is useful if you want to manually send binary data to the ShaderBlock using a `Blob` in `ShaderBlock:send`. ---- ----@param field string # The name of the variable to get the offset of. ----@return number offset # The byte offset of the variable. -function ShaderBlock:getOffset(field) end +---@param sampler lovr.Sampler # TODO +function Pass:setSampler(sampler) end --- ----Before a ShaderBlock can be used in a Shader, the Shader has to have the block's variables defined in its source code. ---- ----This can be a tedious process, so you can call this function to return a GLSL string that contains this definition. +---TODO --- ----Roughly, it will look something like this: --- ---- layout(std140) uniform