diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-06-24 14:45:29 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-06-24 14:45:29 +0800 |
commit | 68e04f690d1accf41f8a59b497bb8fb2222ecc02 (patch) | |
tree | 3fab69b1fee8b4b180bc54999f824683ba8086b2 /server | |
parent | 221b378fa69132808a5d396b777866338cbe65a0 (diff) | |
download | lua-language-server-68e04f690d1accf41f8a59b497bb8fb2222ecc02.zip |
配置加点例子
Diffstat (limited to 'server')
-rw-r--r-- | server/test/build_package.lua | 70 |
1 files changed, 52 insertions, 18 deletions
diff --git a/server/test/build_package.lua b/server/test/build_package.lua index 2bffc77f..a91d702f 100644 --- a/server/test/build_package.lua +++ b/server/test/build_package.lua @@ -49,7 +49,7 @@ local package = { "Lua 5.4", "LuaJIT" }, - description = "%config.runtime.version%" + markdownDescription = "%config.runtime.version%" }, ["Lua.runtime.path"] = { scope = "resource", @@ -66,18 +66,18 @@ local package = { scope = "resource", type = "array", items = "string", - description = "%config.diagnostics.disable%" + markdownDescription = "%config.diagnostics.disable%" }, ["Lua.diagnostics.globals"] = { scope = "resource", type = "array", items = "string", - description = "%config.diagnostics.globals%" + markdownDescription = "%config.diagnostics.globals%" }, ["Lua.diagnostics.severity"] = { scope = "resource", type = 'object', - description = "%config.diagnostics.severity%", + markdownDescription = "%config.diagnostics.severity%", title = "severity", properties = {} }, @@ -91,7 +91,7 @@ local package = { scope = "resource", type = "boolean", default = true, - description = "%config.workspace.ignoreSubmodules%" + markdownDescription = "%config.workspace.ignoreSubmodules%" }, ["Lua.workspace.useGitIgnore"] = { scope = "resource", @@ -103,13 +103,13 @@ local package = { scope = "resource", type = "integer", default = 300, - description = "%config.workspace.maxPreload%" + markdownDescription = "%config.workspace.maxPreload%" }, ["Lua.workspace.preloadFileSize"] = { scope = "resource", type = "integer", default = 100, - description = "%config.workspace.preloadFileSize%" + markdownDescription = "%config.workspace.preloadFileSize%" }, --["Lua.workspace.library"] = { -- scope = 'resource', @@ -155,7 +155,8 @@ package.version = VERSION io.save(ROOT:parent_path() / 'package.json', json.encode(package)) -local libraryExample = [[ +local example = { + library = [[ ```json "Lua.workspace.library": { "C:/lua": true, @@ -166,15 +167,48 @@ local libraryExample = [[ ] } ``` +]], + disable = [[ +```json +"Lua.diagnostics.disable" : [ + "unused-local", + "lowercase-global" +] +``` +]], + globals = [[ +```json +"Lua.diagnostics.globals" : [ + "GLOBAL1", + "GLOBAL2" +] +``` +]], + severity = [[ +```json +"Lua.diagnostics.severity" : { + "redefined-local" : "Warning", + "emmy-lua" : "Hint" +} +``` +]], + ignoreDir = [[ +```json +"Lua.workspace.ignoreDir" : [ + "temp/*.*", + "!temp/*.lua" +] +``` ]] +} 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.diagnostics.disable"] = "Disabled diagnostic (Use code in hover brackets).\n" .. example.disable, + ["config.diagnostics.globals"] = "Defined global variables.\n" .. example.globals, + ["config.diagnostics.severity"] = "Modified diagnostic severity.\n" .. example.severity, + ["config.workspace.ignoreDir"] = "Ignored directories (Use `.gitignore` grammar).\n" .. example.ignoreDir, ["config.workspace.ignoreSubmodules"] = "Ignore submodules.", ["config.workspace.useGitIgnore"] = "Ignore files list in `.gitignore` .", ["config.workspace.maxPreload"] = "Max preloaded files.", @@ -182,16 +216,16 @@ io.save(ROOT:parent_path() / 'package.nls.json', json.encode { ["config.workspace.library"] = [[ 加载的外部函数库。 下面这个例子表示加载`C:/lua`中的所有文件,以及加载`../lib`中的`.txt`与`.lua`文件,但不加载`../lib/temp`中的`.txt`文件。加载的文件最终会受文件关联的影响,因此需要设置`.txt`文件关联`lua`后`*.txt`才有意义。 -]] .. libraryExample, +]] .. example.library, }) 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.diagnostics.disable"] = "禁用的诊断(使用浮框括号内的代码)。\n" .. example.disable, + ["config.diagnostics.globals"] = "已定义的全局变量。\n" .. example.globals, + ["config.diagnostics.severity"] = "修改诊断等级。\n" .. example.severity, + ["config.workspace.ignoreDir"] = "忽略的目录(使用 `.gitignore` 语法)。\n" .. example.ignoreDir, ["config.workspace.ignoreSubmodules"] = "忽略子模块。", ["config.workspace.useGitIgnore"] = "忽略 `.gitignore` 中列举的文件。", ["config.workspace.maxPreload"] = "最大预加载文件数。", @@ -199,5 +233,5 @@ io.save(ROOT:parent_path() / 'package.nls.zh-cn.json', json.encode { ["config.workspace.library"] = [[ 加载的外部函数库。 下面这个例子表示加载`C:/lua`中的所有文件,以及加载`../lib`中的`.txt`与`.lua`文件,但不加载`../lib/temp`中的`.txt`文件。加载的文件最终会受文件关联的影响,因此需要设置`.txt`文件关联`lua`后`*.txt`才有意义。 -]] .. libraryExample, +]] .. example.library, }) |