Skip to content

Commit 1d90e8d

Browse files
committed
schema supports short key
1 parent 7d30ba5 commit 1d90e8d

File tree

3 files changed

+308
-4
lines changed

3 files changed

+308
-4
lines changed

setting/build.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ local function copyWithNLS(t, callback)
88
local nt = {}
99
for k, v in pairs(t) do
1010
if type(v) == 'string' then
11-
nt[k] = callback(v) or v
11+
v = callback(v) or v
1212
elseif type(v) == 'table' then
13-
nt[k] = copyWithNLS(v, callback)
14-
else
15-
nt[k] = v
13+
v = copyWithNLS(v, callback)
14+
end
15+
nt[k] = v
16+
if type(k) == 'string' and k:sub(1, #'Lua.') == 'Lua.' then
17+
nt[k:sub(#'Lua.' + 1)] = {
18+
['$ref'] = '#/properties/' .. k
19+
}
1620
end
1721
end
1822
return nt

setting/schema-zh-cn.json

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,156 @@
14371437
"markdownDescription": "在这里添加私有的第三方库适配文件路径,请参考内置的[配置文件路径](https://github.com/sumneko/lua-language-server/tree/master/meta/3rd)",
14381438
"scope": "resource",
14391439
"type": "array"
1440+
},
1441+
"color.mode": {
1442+
"$ref": "#/properties/Lua.color.mode"
1443+
},
1444+
"completion.autoRequire": {
1445+
"$ref": "#/properties/Lua.completion.autoRequire"
1446+
},
1447+
"completion.callSnippet": {
1448+
"$ref": "#/properties/Lua.completion.callSnippet"
1449+
},
1450+
"completion.displayContext": {
1451+
"$ref": "#/properties/Lua.completion.displayContext"
1452+
},
1453+
"completion.enable": {
1454+
"$ref": "#/properties/Lua.completion.enable"
1455+
},
1456+
"completion.keywordSnippet": {
1457+
"$ref": "#/properties/Lua.completion.keywordSnippet"
1458+
},
1459+
"completion.requireSeparator": {
1460+
"$ref": "#/properties/Lua.completion.requireSeparator"
1461+
},
1462+
"completion.showParams": {
1463+
"$ref": "#/properties/Lua.completion.showParams"
1464+
},
1465+
"completion.showWord": {
1466+
"$ref": "#/properties/Lua.completion.showWord"
1467+
},
1468+
"completion.workspaceWord": {
1469+
"$ref": "#/properties/Lua.completion.workspaceWord"
1470+
},
1471+
"diagnostics.disable": {
1472+
"$ref": "#/properties/Lua.diagnostics.disable"
1473+
},
1474+
"diagnostics.enable": {
1475+
"$ref": "#/properties/Lua.diagnostics.enable"
1476+
},
1477+
"diagnostics.globals": {
1478+
"$ref": "#/properties/Lua.diagnostics.globals"
1479+
},
1480+
"diagnostics.ignoredFiles": {
1481+
"$ref": "#/properties/Lua.diagnostics.ignoredFiles"
1482+
},
1483+
"diagnostics.libraryFiles": {
1484+
"$ref": "#/properties/Lua.diagnostics.libraryFiles"
1485+
},
1486+
"diagnostics.neededFileStatus": {
1487+
"$ref": "#/properties/Lua.diagnostics.neededFileStatus"
1488+
},
1489+
"diagnostics.severity": {
1490+
"$ref": "#/properties/Lua.diagnostics.severity"
1491+
},
1492+
"diagnostics.workspaceDelay": {
1493+
"$ref": "#/properties/Lua.diagnostics.workspaceDelay"
1494+
},
1495+
"diagnostics.workspaceRate": {
1496+
"$ref": "#/properties/Lua.diagnostics.workspaceRate"
1497+
},
1498+
"hint.enable": {
1499+
"$ref": "#/properties/Lua.hint.enable"
1500+
},
1501+
"hint.paramName": {
1502+
"$ref": "#/properties/Lua.hint.paramName"
1503+
},
1504+
"hint.paramType": {
1505+
"$ref": "#/properties/Lua.hint.paramType"
1506+
},
1507+
"hint.setType": {
1508+
"$ref": "#/properties/Lua.hint.setType"
1509+
},
1510+
"hover.enable": {
1511+
"$ref": "#/properties/Lua.hover.enable"
1512+
},
1513+
"hover.enumsLimit": {
1514+
"$ref": "#/properties/Lua.hover.enumsLimit"
1515+
},
1516+
"hover.previewFields": {
1517+
"$ref": "#/properties/Lua.hover.previewFields"
1518+
},
1519+
"hover.viewNumber": {
1520+
"$ref": "#/properties/Lua.hover.viewNumber"
1521+
},
1522+
"hover.viewString": {
1523+
"$ref": "#/properties/Lua.hover.viewString"
1524+
},
1525+
"hover.viewStringMax": {
1526+
"$ref": "#/properties/Lua.hover.viewStringMax"
1527+
},
1528+
"misc.parameters": {
1529+
"$ref": "#/properties/Lua.misc.parameters"
1530+
},
1531+
"runtime.builtin": {
1532+
"$ref": "#/properties/Lua.runtime.builtin"
1533+
},
1534+
"runtime.fileEncoding": {
1535+
"$ref": "#/properties/Lua.runtime.fileEncoding"
1536+
},
1537+
"runtime.nonstandardSymbol": {
1538+
"$ref": "#/properties/Lua.runtime.nonstandardSymbol"
1539+
},
1540+
"runtime.path": {
1541+
"$ref": "#/properties/Lua.runtime.path"
1542+
},
1543+
"runtime.plugin": {
1544+
"$ref": "#/properties/Lua.runtime.plugin"
1545+
},
1546+
"runtime.special": {
1547+
"$ref": "#/properties/Lua.runtime.special"
1548+
},
1549+
"runtime.unicodeName": {
1550+
"$ref": "#/properties/Lua.runtime.unicodeName"
1551+
},
1552+
"runtime.version": {
1553+
"$ref": "#/properties/Lua.runtime.version"
1554+
},
1555+
"signatureHelp.enable": {
1556+
"$ref": "#/properties/Lua.signatureHelp.enable"
1557+
},
1558+
"telemetry.enable": {
1559+
"$ref": "#/properties/Lua.telemetry.enable"
1560+
},
1561+
"window.progressBar": {
1562+
"$ref": "#/properties/Lua.window.progressBar"
1563+
},
1564+
"window.statusBar": {
1565+
"$ref": "#/properties/Lua.window.statusBar"
1566+
},
1567+
"workspace.checkThirdParty": {
1568+
"$ref": "#/properties/Lua.workspace.checkThirdParty"
1569+
},
1570+
"workspace.ignoreDir": {
1571+
"$ref": "#/properties/Lua.workspace.ignoreDir"
1572+
},
1573+
"workspace.ignoreSubmodules": {
1574+
"$ref": "#/properties/Lua.workspace.ignoreSubmodules"
1575+
},
1576+
"workspace.library": {
1577+
"$ref": "#/properties/Lua.workspace.library"
1578+
},
1579+
"workspace.maxPreload": {
1580+
"$ref": "#/properties/Lua.workspace.maxPreload"
1581+
},
1582+
"workspace.preloadFileSize": {
1583+
"$ref": "#/properties/Lua.workspace.preloadFileSize"
1584+
},
1585+
"workspace.useGitIgnore": {
1586+
"$ref": "#/properties/Lua.workspace.useGitIgnore"
1587+
},
1588+
"workspace.userThirdParty": {
1589+
"$ref": "#/properties/Lua.workspace.userThirdParty"
14401590
}
14411591
},
14421592
"title": "setting",

setting/schema.json

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,156 @@
14371437
"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)",
14381438
"scope": "resource",
14391439
"type": "array"
1440+
},
1441+
"color.mode": {
1442+
"$ref": "#/properties/Lua.color.mode"
1443+
},
1444+
"completion.autoRequire": {
1445+
"$ref": "#/properties/Lua.completion.autoRequire"
1446+
},
1447+
"completion.callSnippet": {
1448+
"$ref": "#/properties/Lua.completion.callSnippet"
1449+
},
1450+
"completion.displayContext": {
1451+
"$ref": "#/properties/Lua.completion.displayContext"
1452+
},
1453+
"completion.enable": {
1454+
"$ref": "#/properties/Lua.completion.enable"
1455+
},
1456+
"completion.keywordSnippet": {
1457+
"$ref": "#/properties/Lua.completion.keywordSnippet"
1458+
},
1459+
"completion.requireSeparator": {
1460+
"$ref": "#/properties/Lua.completion.requireSeparator"
1461+
},
1462+
"completion.showParams": {
1463+
"$ref": "#/properties/Lua.completion.showParams"
1464+
},
1465+
"completion.showWord": {
1466+
"$ref": "#/properties/Lua.completion.showWord"
1467+
},
1468+
"completion.workspaceWord": {
1469+
"$ref": "#/properties/Lua.completion.workspaceWord"
1470+
},
1471+
"diagnostics.disable": {
1472+
"$ref": "#/properties/Lua.diagnostics.disable"
1473+
},
1474+
"diagnostics.enable": {
1475+
"$ref": "#/properties/Lua.diagnostics.enable"
1476+
},
1477+
"diagnostics.globals": {
1478+
"$ref": "#/properties/Lua.diagnostics.globals"
1479+
},
1480+
"diagnostics.ignoredFiles": {
1481+
"$ref": "#/properties/Lua.diagnostics.ignoredFiles"
1482+
},
1483+
"diagnostics.libraryFiles": {
1484+
"$ref": "#/properties/Lua.diagnostics.libraryFiles"
1485+
},
1486+
"diagnostics.neededFileStatus": {
1487+
"$ref": "#/properties/Lua.diagnostics.neededFileStatus"
1488+
},
1489+
"diagnostics.severity": {
1490+
"$ref": "#/properties/Lua.diagnostics.severity"
1491+
},
1492+
"diagnostics.workspaceDelay": {
1493+
"$ref": "#/properties/Lua.diagnostics.workspaceDelay"
1494+
},
1495+
"diagnostics.workspaceRate": {
1496+
"$ref": "#/properties/Lua.diagnostics.workspaceRate"
1497+
},
1498+
"hint.enable": {
1499+
"$ref": "#/properties/Lua.hint.enable"
1500+
},
1501+
"hint.paramName": {
1502+
"$ref": "#/properties/Lua.hint.paramName"
1503+
},
1504+
"hint.paramType": {
1505+
"$ref": "#/properties/Lua.hint.paramType"
1506+
},
1507+
"hint.setType": {
1508+
"$ref": "#/properties/Lua.hint.setType"
1509+
},
1510+
"hover.enable": {
1511+
"$ref": "#/properties/Lua.hover.enable"
1512+
},
1513+
"hover.enumsLimit": {
1514+
"$ref": "#/properties/Lua.hover.enumsLimit"
1515+
},
1516+
"hover.previewFields": {
1517+
"$ref": "#/properties/Lua.hover.previewFields"
1518+
},
1519+
"hover.viewNumber": {
1520+
"$ref": "#/properties/Lua.hover.viewNumber"
1521+
},
1522+
"hover.viewString": {
1523+
"$ref": "#/properties/Lua.hover.viewString"
1524+
},
1525+
"hover.viewStringMax": {
1526+
"$ref": "#/properties/Lua.hover.viewStringMax"
1527+
},
1528+
"misc.parameters": {
1529+
"$ref": "#/properties/Lua.misc.parameters"
1530+
},
1531+
"runtime.builtin": {
1532+
"$ref": "#/properties/Lua.runtime.builtin"
1533+
},
1534+
"runtime.fileEncoding": {
1535+
"$ref": "#/properties/Lua.runtime.fileEncoding"
1536+
},
1537+
"runtime.nonstandardSymbol": {
1538+
"$ref": "#/properties/Lua.runtime.nonstandardSymbol"
1539+
},
1540+
"runtime.path": {
1541+
"$ref": "#/properties/Lua.runtime.path"
1542+
},
1543+
"runtime.plugin": {
1544+
"$ref": "#/properties/Lua.runtime.plugin"
1545+
},
1546+
"runtime.special": {
1547+
"$ref": "#/properties/Lua.runtime.special"
1548+
},
1549+
"runtime.unicodeName": {
1550+
"$ref": "#/properties/Lua.runtime.unicodeName"
1551+
},
1552+
"runtime.version": {
1553+
"$ref": "#/properties/Lua.runtime.version"
1554+
},
1555+
"signatureHelp.enable": {
1556+
"$ref": "#/properties/Lua.signatureHelp.enable"
1557+
},
1558+
"telemetry.enable": {
1559+
"$ref": "#/properties/Lua.telemetry.enable"
1560+
},
1561+
"window.progressBar": {
1562+
"$ref": "#/properties/Lua.window.progressBar"
1563+
},
1564+
"window.statusBar": {
1565+
"$ref": "#/properties/Lua.window.statusBar"
1566+
},
1567+
"workspace.checkThirdParty": {
1568+
"$ref": "#/properties/Lua.workspace.checkThirdParty"
1569+
},
1570+
"workspace.ignoreDir": {
1571+
"$ref": "#/properties/Lua.workspace.ignoreDir"
1572+
},
1573+
"workspace.ignoreSubmodules": {
1574+
"$ref": "#/properties/Lua.workspace.ignoreSubmodules"
1575+
},
1576+
"workspace.library": {
1577+
"$ref": "#/properties/Lua.workspace.library"
1578+
},
1579+
"workspace.maxPreload": {
1580+
"$ref": "#/properties/Lua.workspace.maxPreload"
1581+
},
1582+
"workspace.preloadFileSize": {
1583+
"$ref": "#/properties/Lua.workspace.preloadFileSize"
1584+
},
1585+
"workspace.useGitIgnore": {
1586+
"$ref": "#/properties/Lua.workspace.useGitIgnore"
1587+
},
1588+
"workspace.userThirdParty": {
1589+
"$ref": "#/properties/Lua.workspace.userThirdParty"
14401590
}
14411591
},
14421592
"title": "setting",

0 commit comments

Comments
 (0)