summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-14 11:02:48 +0800
committersumneko <sumneko@hotmail.com>2019-05-14 11:02:48 +0800
commit91df1468e72dff445539e868048285840efc4a9e (patch)
treea8865cfc32affeb534c68493359b9bdf4d5e3cd5 /server/test
parentefb8c6f705a940831fbdb8b7246ba6206ddf9220 (diff)
downloadlua-language-server-91df1468e72dff445539e868048285840efc4a9e.zip
#13 诊断等级的配置
Diffstat (limited to 'server/test')
-rw-r--r--server/test/build_package.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/server/test/build_package.lua b/server/test/build_package.lua
index b68beb06..7a58487c 100644
--- a/server/test/build_package.lua
+++ b/server/test/build_package.lua
@@ -1,4 +1,5 @@
local json = require 'json'
+local diagDefault = require 'constant.DiagnosticDefaultSeverity'
local package = {
name = "lua",
@@ -71,6 +72,13 @@ local package = {
items = "string",
description = "%config.diagnostics.globals%"
},
+ ["Lua.diagnostics.severity"] = {
+ scope = "resource",
+ type = 'object',
+ description = "%config.diagnostics.severity",
+ title = "severity",
+ properties = {}
+ },
["Lua.workspace.ignoreDir"] = {
scope = "resource",
type = "array",
@@ -121,6 +129,21 @@ local package = {
}
}
+local DiagSeverity = package.contributes.configuration.properties["Lua.diagnostics.severity"].properties
+for name, level in pairs(diagDefault) do
+ DiagSeverity[name] = {
+ scope = 'resource',
+ type = 'string',
+ default = level,
+ enum = {
+ 'Error',
+ 'Warning',
+ 'Information',
+ 'Hint',
+ }
+ }
+end
+
package.version = "0.9.2"
io.save(ROOT:parent_path() / 'package.json', json.encode(package))