From 1d90e8d5fd1c874ef07917a457d1b631c6985117 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= <sumneko@hotmail.com>
Date: Fri, 15 Oct 2021 18:08:51 +0800
Subject: [PATCH] schema supports short key

---
 setting/build.lua         |  12 ++-
 setting/schema-zh-cn.json | 150 ++++++++++++++++++++++++++++++++++++++
 setting/schema.json       | 150 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 308 insertions(+), 4 deletions(-)

diff --git a/setting/build.lua b/setting/build.lua
index b6fea70..c0b6f28 100644
--- a/setting/build.lua
+++ b/setting/build.lua
@@ -8,11 +8,15 @@ local function copyWithNLS(t, callback)
     local nt = {}
     for k, v in pairs(t) do
         if type(v) == 'string' then
-            nt[k] = callback(v) or v
+            v = callback(v) or v
         elseif type(v) == 'table' then
-            nt[k] = copyWithNLS(v, callback)
-        else
-            nt[k] = v
+            v = copyWithNLS(v, callback)
+        end
+        nt[k] = v
+        if type(k) == 'string' and k:sub(1, #'Lua.') == 'Lua.' then
+            nt[k:sub(#'Lua.' + 1)] = {
+                ['$ref'] = '#/properties/' .. k
+            }
         end
     end
     return nt
diff --git a/setting/schema-zh-cn.json b/setting/schema-zh-cn.json
index 154dfd5..0b0249c 100644
--- a/setting/schema-zh-cn.json
+++ b/setting/schema-zh-cn.json
@@ -1437,6 +1437,156 @@
             "markdownDescription": "在这里添加私有的第三方库适配文件路径,请参考内置的[配置文件路径](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)",
             "scope": "resource",
             "type": "array"
+        },
+        "color.mode": {
+            "$ref": "#/properties/Lua.color.mode"
+        },
+        "completion.autoRequire": {
+            "$ref": "#/properties/Lua.completion.autoRequire"
+        },
+        "completion.callSnippet": {
+            "$ref": "#/properties/Lua.completion.callSnippet"
+        },
+        "completion.displayContext": {
+            "$ref": "#/properties/Lua.completion.displayContext"
+        },
+        "completion.enable": {
+            "$ref": "#/properties/Lua.completion.enable"
+        },
+        "completion.keywordSnippet": {
+            "$ref": "#/properties/Lua.completion.keywordSnippet"
+        },
+        "completion.requireSeparator": {
+            "$ref": "#/properties/Lua.completion.requireSeparator"
+        },
+        "completion.showParams": {
+            "$ref": "#/properties/Lua.completion.showParams"
+        },
+        "completion.showWord": {
+            "$ref": "#/properties/Lua.completion.showWord"
+        },
+        "completion.workspaceWord": {
+            "$ref": "#/properties/Lua.completion.workspaceWord"
+        },
+        "diagnostics.disable": {
+            "$ref": "#/properties/Lua.diagnostics.disable"
+        },
+        "diagnostics.enable": {
+            "$ref": "#/properties/Lua.diagnostics.enable"
+        },
+        "diagnostics.globals": {
+            "$ref": "#/properties/Lua.diagnostics.globals"
+        },
+        "diagnostics.ignoredFiles": {
+            "$ref": "#/properties/Lua.diagnostics.ignoredFiles"
+        },
+        "diagnostics.libraryFiles": {
+            "$ref": "#/properties/Lua.diagnostics.libraryFiles"
+        },
+        "diagnostics.neededFileStatus": {
+            "$ref": "#/properties/Lua.diagnostics.neededFileStatus"
+        },
+        "diagnostics.severity": {
+            "$ref": "#/properties/Lua.diagnostics.severity"
+        },
+        "diagnostics.workspaceDelay": {
+            "$ref": "#/properties/Lua.diagnostics.workspaceDelay"
+        },
+        "diagnostics.workspaceRate": {
+            "$ref": "#/properties/Lua.diagnostics.workspaceRate"
+        },
+        "hint.enable": {
+            "$ref": "#/properties/Lua.hint.enable"
+        },
+        "hint.paramName": {
+            "$ref": "#/properties/Lua.hint.paramName"
+        },
+        "hint.paramType": {
+            "$ref": "#/properties/Lua.hint.paramType"
+        },
+        "hint.setType": {
+            "$ref": "#/properties/Lua.hint.setType"
+        },
+        "hover.enable": {
+            "$ref": "#/properties/Lua.hover.enable"
+        },
+        "hover.enumsLimit": {
+            "$ref": "#/properties/Lua.hover.enumsLimit"
+        },
+        "hover.previewFields": {
+            "$ref": "#/properties/Lua.hover.previewFields"
+        },
+        "hover.viewNumber": {
+            "$ref": "#/properties/Lua.hover.viewNumber"
+        },
+        "hover.viewString": {
+            "$ref": "#/properties/Lua.hover.viewString"
+        },
+        "hover.viewStringMax": {
+            "$ref": "#/properties/Lua.hover.viewStringMax"
+        },
+        "misc.parameters": {
+            "$ref": "#/properties/Lua.misc.parameters"
+        },
+        "runtime.builtin": {
+            "$ref": "#/properties/Lua.runtime.builtin"
+        },
+        "runtime.fileEncoding": {
+            "$ref": "#/properties/Lua.runtime.fileEncoding"
+        },
+        "runtime.nonstandardSymbol": {
+            "$ref": "#/properties/Lua.runtime.nonstandardSymbol"
+        },
+        "runtime.path": {
+            "$ref": "#/properties/Lua.runtime.path"
+        },
+        "runtime.plugin": {
+            "$ref": "#/properties/Lua.runtime.plugin"
+        },
+        "runtime.special": {
+            "$ref": "#/properties/Lua.runtime.special"
+        },
+        "runtime.unicodeName": {
+            "$ref": "#/properties/Lua.runtime.unicodeName"
+        },
+        "runtime.version": {
+            "$ref": "#/properties/Lua.runtime.version"
+        },
+        "signatureHelp.enable": {
+            "$ref": "#/properties/Lua.signatureHelp.enable"
+        },
+        "telemetry.enable": {
+            "$ref": "#/properties/Lua.telemetry.enable"
+        },
+        "window.progressBar": {
+            "$ref": "#/properties/Lua.window.progressBar"
+        },
+        "window.statusBar": {
+            "$ref": "#/properties/Lua.window.statusBar"
+        },
+        "workspace.checkThirdParty": {
+            "$ref": "#/properties/Lua.workspace.checkThirdParty"
+        },
+        "workspace.ignoreDir": {
+            "$ref": "#/properties/Lua.workspace.ignoreDir"
+        },
+        "workspace.ignoreSubmodules": {
+            "$ref": "#/properties/Lua.workspace.ignoreSubmodules"
+        },
+        "workspace.library": {
+            "$ref": "#/properties/Lua.workspace.library"
+        },
+        "workspace.maxPreload": {
+            "$ref": "#/properties/Lua.workspace.maxPreload"
+        },
+        "workspace.preloadFileSize": {
+            "$ref": "#/properties/Lua.workspace.preloadFileSize"
+        },
+        "workspace.useGitIgnore": {
+            "$ref": "#/properties/Lua.workspace.useGitIgnore"
+        },
+        "workspace.userThirdParty": {
+            "$ref": "#/properties/Lua.workspace.userThirdParty"
         }
     },
     "title": "setting",
diff --git a/setting/schema.json b/setting/schema.json
index 3efa3ef..53e89f0 100644
--- a/setting/schema.json
+++ b/setting/schema.json
@@ -1437,6 +1437,156 @@
             "markdownDescription": "Add private third-party library configuration file paths here, please refer to the built-in [configuration file path](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)",
             "scope": "resource",
             "type": "array"
+        },
+        "color.mode": {
+            "$ref": "#/properties/Lua.color.mode"
+        },
+        "completion.autoRequire": {
+            "$ref": "#/properties/Lua.completion.autoRequire"
+        },
+        "completion.callSnippet": {
+            "$ref": "#/properties/Lua.completion.callSnippet"
+        },
+        "completion.displayContext": {
+            "$ref": "#/properties/Lua.completion.displayContext"
+        },
+        "completion.enable": {
+            "$ref": "#/properties/Lua.completion.enable"
+        },
+        "completion.keywordSnippet": {
+            "$ref": "#/properties/Lua.completion.keywordSnippet"
+        },
+        "completion.requireSeparator": {
+            "$ref": "#/properties/Lua.completion.requireSeparator"
+        },
+        "completion.showParams": {
+            "$ref": "#/properties/Lua.completion.showParams"
+        },
+        "completion.showWord": {
+            "$ref": "#/properties/Lua.completion.showWord"
+        },
+        "completion.workspaceWord": {
+            "$ref": "#/properties/Lua.completion.workspaceWord"
+        },
+        "diagnostics.disable": {
+            "$ref": "#/properties/Lua.diagnostics.disable"
+        },
+        "diagnostics.enable": {
+            "$ref": "#/properties/Lua.diagnostics.enable"
+        },
+        "diagnostics.globals": {
+            "$ref": "#/properties/Lua.diagnostics.globals"
+        },
+        "diagnostics.ignoredFiles": {
+            "$ref": "#/properties/Lua.diagnostics.ignoredFiles"
+        },
+        "diagnostics.libraryFiles": {
+            "$ref": "#/properties/Lua.diagnostics.libraryFiles"
+        },
+        "diagnostics.neededFileStatus": {
+            "$ref": "#/properties/Lua.diagnostics.neededFileStatus"
+        },
+        "diagnostics.severity": {
+            "$ref": "#/properties/Lua.diagnostics.severity"
+        },
+        "diagnostics.workspaceDelay": {
+            "$ref": "#/properties/Lua.diagnostics.workspaceDelay"
+        },
+        "diagnostics.workspaceRate": {
+            "$ref": "#/properties/Lua.diagnostics.workspaceRate"
+        },
+        "hint.enable": {
+            "$ref": "#/properties/Lua.hint.enable"
+        },
+        "hint.paramName": {
+            "$ref": "#/properties/Lua.hint.paramName"
+        },
+        "hint.paramType": {
+            "$ref": "#/properties/Lua.hint.paramType"
+        },
+        "hint.setType": {
+            "$ref": "#/properties/Lua.hint.setType"
+        },
+        "hover.enable": {
+            "$ref": "#/properties/Lua.hover.enable"
+        },
+        "hover.enumsLimit": {
+            "$ref": "#/properties/Lua.hover.enumsLimit"
+        },
+        "hover.previewFields": {
+            "$ref": "#/properties/Lua.hover.previewFields"
+        },
+        "hover.viewNumber": {
+            "$ref": "#/properties/Lua.hover.viewNumber"
+        },
+        "hover.viewString": {
+            "$ref": "#/properties/Lua.hover.viewString"
+        },
+        "hover.viewStringMax": {
+            "$ref": "#/properties/Lua.hover.viewStringMax"
+        },
+        "misc.parameters": {
+            "$ref": "#/properties/Lua.misc.parameters"
+        },
+        "runtime.builtin": {
+            "$ref": "#/properties/Lua.runtime.builtin"
+        },
+        "runtime.fileEncoding": {
+            "$ref": "#/properties/Lua.runtime.fileEncoding"
+        },
+        "runtime.nonstandardSymbol": {
+            "$ref": "#/properties/Lua.runtime.nonstandardSymbol"
+        },
+        "runtime.path": {
+            "$ref": "#/properties/Lua.runtime.path"
+        },
+        "runtime.plugin": {
+            "$ref": "#/properties/Lua.runtime.plugin"
+        },
+        "runtime.special": {
+            "$ref": "#/properties/Lua.runtime.special"
+        },
+        "runtime.unicodeName": {
+            "$ref": "#/properties/Lua.runtime.unicodeName"
+        },
+        "runtime.version": {
+            "$ref": "#/properties/Lua.runtime.version"
+        },
+        "signatureHelp.enable": {
+            "$ref": "#/properties/Lua.signatureHelp.enable"
+        },
+        "telemetry.enable": {
+            "$ref": "#/properties/Lua.telemetry.enable"
+        },
+        "window.progressBar": {
+            "$ref": "#/properties/Lua.window.progressBar"
+        },
+        "window.statusBar": {
+            "$ref": "#/properties/Lua.window.statusBar"
+        },
+        "workspace.checkThirdParty": {
+            "$ref": "#/properties/Lua.workspace.checkThirdParty"
+        },
+        "workspace.ignoreDir": {
+            "$ref": "#/properties/Lua.workspace.ignoreDir"
+        },
+        "workspace.ignoreSubmodules": {
+            "$ref": "#/properties/Lua.workspace.ignoreSubmodules"
+        },
+        "workspace.library": {
+            "$ref": "#/properties/Lua.workspace.library"
+        },
+        "workspace.maxPreload": {
+            "$ref": "#/properties/Lua.workspace.maxPreload"
+        },
+        "workspace.preloadFileSize": {
+            "$ref": "#/properties/Lua.workspace.preloadFileSize"
+        },
+        "workspace.useGitIgnore": {
+            "$ref": "#/properties/Lua.workspace.useGitIgnore"
+        },
+        "workspace.userThirdParty": {
+            "$ref": "#/properties/Lua.workspace.userThirdParty"
         }
     },
     "title": "setting",
-- 
GitLab