summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
Diffstat (limited to 'server/test')
-rw-r--r--server/test/build_package.lua52
1 files changed, 52 insertions, 0 deletions
diff --git a/server/test/build_package.lua b/server/test/build_package.lua
index 0b7a5e99..052ac006 100644
--- a/server/test/build_package.lua
+++ b/server/test/build_package.lua
@@ -108,6 +108,11 @@ local package = {
type = "integer",
default = 100,
description = "%config.workspace.preloadFileSize%"
+ },
+ ["Lua.workspace.library"] = {
+ scope = 'resource',
+ type = 'object',
+ markdownDescription = "%config.workspace.library%"
}
}
},
@@ -147,3 +152,50 @@ end
package.version = "0.9.2"
io.save(ROOT:parent_path() / 'package.json', json.encode(package))
+
+local libraryExample = [[
+```json
+"Lua.workspace.library": {
+ "C:/lua": true,
+ "../lib": [
+ "*.txt",
+ "*.lua",
+ "!/temp/**/*.txt"
+ ]
+}
+```
+]]
+
+io.save(ROOT:parent_path() / 'package.nls.json', json.encode {
+ ["config.runtime.version"] = "Lua runtime version.",
+ ["config.runtime.path"] = "`package.path`",
+ ["config.diagnostics.disable"] = "Disabled diagnostic (Use code in hover brackets).",
+ ["config.diagnostics.globals"] = "Defined global variables.",
+ ["config.diagnostics.severity"] = "Modified diagnostic severity.",
+ ["config.workspace.ignoreDir"] = "Ignored directories (Use `.gitignore` grammar).",
+ ["config.workspace.ignoreSubmodules"] = "Ignore submodules.",
+ ["config.workspace.useGitIgnore"] = "Ignore files list in `.gitignore` .",
+ ["config.workspace.maxPreload"] = "Max preloaded files.",
+ ["config.workspace.preloadFileSize"] = "Skip files larger than this value (KB) when preloading.",
+ ["config.workspace.library"] = [[
+加载的外部函数库。
+下面这个例子表示加载`C:/lua`中的所有文件,以及加载`../lib`中的`.txt`与`.lua`文件,但不加载`../lib/temp`中的`.txt`文件。加载的文件最终会受设置中文件关联的影响,因此需要设置`.txt`文件关联`lua`后`*.txt`才有意义。
+]] .. libraryExample,
+})
+
+io.save(ROOT:parent_path() / 'package.nls.zh-cn.json', json.encode {
+ ["config.runtime.version"] = "Lua运行版本。",
+ ["config.runtime.path"] = "`package.path`",
+ ["config.diagnostics.disable"] = "禁用的诊断(使用浮框括号内的代码)。",
+ ["config.diagnostics.globals"] = "已定义的全局变量。",
+ ["config.diagnostics.severity"] = "修改诊断等级。",
+ ["config.workspace.ignoreDir"] = "忽略的目录(使用 `.gitignore` 语法)。",
+ ["config.workspace.ignoreSubmodules"] = "忽略子模块。",
+ ["config.workspace.useGitIgnore"] = "忽略 `.gitignore` 中列举的文件。",
+ ["config.workspace.maxPreload"] = "最大预加载文件数。",
+ ["config.workspace.preloadFileSize"] = "预加载时跳过大小大于该值(KB)的文件。",
+ ["config.workspace.library"] = [[
+加载的外部函数库。
+下面这个例子表示加载`C:/lua`中的所有文件,以及加载`../lib`中的`.txt`与`.lua`文件,但不加载`../lib/temp`中的`.txt`文件。加载的文件最终会受设置中文件关联的影响,因此需要设置`.txt`文件关联`lua`后`*.txt`才有意义。
+]] .. libraryExample,
+})