summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-18 10:04:43 +0800
committersumneko <sumneko@hotmail.com>2019-04-18 10:04:43 +0800
commit55002befa1da20dfb21a1b06e5cafa5cf4c1afa0 (patch)
treec9922814f4c8197670c4b66c8b653354ffe18ff9
parentedc5ccf6a3372aaec72c579f260d6bd6f7927486 (diff)
downloadlua-language-server-55002befa1da20dfb21a1b06e5cafa5cf4c1afa0.zip
更新require
-rw-r--r--server/libs/@lua/basic.lni12
-rw-r--r--server/locale/en-US/libs/@lua/basic.lni5
-rw-r--r--server/locale/zh-CN/libs/@lua/basic.lni7
3 files changed, 21 insertions, 3 deletions
diff --git a/server/libs/@lua/basic.lni b/server/libs/@lua/basic.lni
index 14320a58..a90a029e 100644
--- a/server/libs/@lua/basic.lni
+++ b/server/libs/@lua/basic.lni
@@ -550,6 +550,18 @@ name = 'modname'
type = 'string'
[[.returns]]
+["require Lua 5.4"]
+version = 'Lua 5.4'
+name = 'require'
+special = 'require'
+[[.args]]
+name = 'modname'
+type = 'string'
+[[.returns]]
+type = any
+``````````
+name = loaderdata
+
[unpack]
version = {'Lua 5.1', 'LuaJIT'}
[[.args]]
diff --git a/server/locale/en-US/libs/@lua/basic.lni b/server/locale/en-US/libs/@lua/basic.lni
index e7068c7e..f69128f9 100644
--- a/server/locale/en-US/libs/@lua/basic.lni
+++ b/server/locale/en-US/libs/@lua/basic.lni
@@ -230,7 +230,10 @@ description = 'Calls function `f` with the given arguments in protected mode wit
description = 'Calls function `f` in protected mode with a new message handler.'
[require]
-description = 'Loads the given module.'
+description = 'Loads the given module, returns any value returned by the given module(`true` when `nil`).'
+
+["require Lua 5.4"]
+description = 'Loads the given module, returns any value returned by the searcher(`true` when `nil`). Besides that value, also returns as a second result the loader data returned by the searcher, which indicates how `require` found the module. (For instance, if the module came from a file, this loader data is the file path.)'
[unpack]
description = [[
diff --git a/server/locale/zh-CN/libs/@lua/basic.lni b/server/locale/zh-CN/libs/@lua/basic.lni
index 183983e4..3dcd7802 100644
--- a/server/locale/zh-CN/libs/@lua/basic.lni
+++ b/server/locale/zh-CN/libs/@lua/basic.lni
@@ -221,11 +221,14 @@ description = '以给定消息发出一个警告。当`tocont`为 true 时,应
[xpcall]
description = '传入参数并设置一个消息处理器 `msgh`,以 *保护模式* 调用函数 `f` 。'
-['xpcall Lua 5.1']
+["xpcall Lua 5.1"]
description = '设置一个消息处理器 `err`,以 *保护模式* 调用函数 `f` 。'
[require]
-description = '加载一个模块。'
+description = '加载一个模块,返回该模块的返回值(`nil`时为`true`)。'
+
+["require Lua 5.4"]
+description = '加载一个模块,返回该模块的返回值(`nil`时为`true`)与搜索器返回的加载数据。默认搜索器的加载数据指示了加载位置,对于文件来说就是文件路径。'
[unpack]
description = [[