Skip to content
Snippets Groups Projects
Commit 462f017a authored by 最萌小汐's avatar 最萌小汐
Browse files

生成 setting 的 schema

parent 30d16466
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,23 @@ ...@@ -18,6 +18,23 @@
"stderr", "stderr",
], ],
}, },
{
"name": "导出配置文件",
"type": "lua",
"request": "launch",
"stopOnEntry": false,
"program": "${workspaceRoot}/setting.lua",
"arg": [
],
"luaexe": "${workspaceFolder}/server/bin/Windows/lua-language-server.exe",
"path": "${workspaceFolder}/?.lua;${workspaceFolder}/server/script/?.lua;${workspaceFolder}/server/script/?/init.lua",
"consoleCoding": "utf8",
"sourceCoding": "utf8",
"outputCapture": [
"print",
"stderr",
],
},
{ {
"type": "extensionHost", "type": "extensionHost",
"request": "launch", "request": "launch",
......
{
"$schema": "",
"description": "Setting of sumneko.lua",
"properties": {
"Lua.color.mode": {
"default": "Semantic",
"enum": [
"Grammar",
"Semantic"
],
"markdownDescription": "%config.color.mode%",
"markdownEnumDescriptions": [
"%config.color.mode.Grammar%",
"%config.color.mode.Semantic%"
],
"scope": "resource",
"type": "string"
},
"Lua.completion.callSnippet": {
"default": "Disable",
"enum": [
"Disable",
"Both",
"Replace"
],
"markdownDescription": "%config.completion.callSnippet%",
"markdownEnumDescriptions": [
"%config.completion.callSnippet.Disable%",
"%config.completion.callSnippet.Both%",
"%config.completion.callSnippet.Replace%"
],
"scope": "resource",
"type": "string"
},
"Lua.completion.enable": {
"default": true,
"markdownDescription": "%config.completion.enable%",
"scope": "resource",
"type": "boolean"
},
"Lua.completion.keywordSnippet": {
"default": "Replace",
"enum": [
"Disable",
"Both",
"Replace"
],
"markdownDescription": "%config.completion.keywordSnippet%",
"markdownEnumDescriptions": [
"%config.completion.keywordSnippet.Disable%",
"%config.completion.keywordSnippet.Both%",
"%config.completion.keywordSnippet.Replace%"
],
"scope": "resource",
"type": "string"
},
"Lua.develop.debuggerPort": {
"default": 11412,
"markdownDescription": "%config.develop.debuggerPort%",
"scope": "resource",
"type": "integer"
},
"Lua.develop.debuggerWait": {
"default": false,
"markdownDescription": "%config.develop.debuggerWait%",
"scope": "resource",
"type": "boolean"
},
"Lua.develop.enable": {
"default": false,
"markdownDescription": "%config.develop.enable%",
"scope": "resource",
"type": "boolean"
},
"Lua.diagnostics.disable": {
"items": {
"type": "string"
},
"markdownDescription": "%config.diagnostics.disable%",
"scope": "resource",
"type": "array"
},
"Lua.diagnostics.enable": {
"default": true,
"markdownDescription": "%config.diagnostics.enable%",
"scope": "resource",
"type": "boolean"
},
"Lua.diagnostics.globals": {
"items": {
"type": "string"
},
"markdownDescription": "%config.diagnostics.globals%",
"scope": "resource",
"type": "array"
},
"Lua.diagnostics.severity": {
"markdownDescription": "%config.diagnostics.severity%",
"properties": {
"ambiguity-1": {
"default": "Warning",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"duplicate-index": {
"default": "Warning",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"duplicate-method": {
"default": "Warning",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"emmy-lua": {
"default": "Warning",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"empty-block": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"global-in-nil-env": {
"default": "Warning",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"lowercase-global": {
"default": "Information",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"newfield-call": {
"default": "Warning",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"newline-call": {
"default": "Information",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"redefined-local": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"redundant-parameter": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"redundant-value": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"set-const": {
"default": "Error",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"trailing-space": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"undefined-env-child": {
"default": "Information",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"undefined-global": {
"default": "Warning",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"unused-function": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"unused-label": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"unused-local": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
},
"unused-vararg": {
"default": "Hint",
"enum": [
"Error",
"Warning",
"Information",
"Hint"
],
"scope": "resource",
"type": "string"
}
},
"scope": "resource",
"title": "severity",
"type": "object"
},
"Lua.runtime.path": {
"default": [
"?.lua",
"?/init.lua",
"?/?.lua"
],
"items": {
"type": "string"
},
"markdownDescription": "%config.runtime.path%",
"scope": "resource",
"type": "array"
},
"Lua.runtime.version": {
"default": "Lua 5.3",
"enum": [
"Lua 5.1",
"Lua 5.2",
"Lua 5.3",
"Lua 5.4",
"LuaJIT"
],
"markdownDescription": "%config.runtime.version%",
"scope": "resource",
"type": "string"
},
"Lua.workspace.ignoreDir": {
"default": [
".vscode"
],
"items": {
"type": "string"
},
"markdownDescription": "%config.workspace.ignoreDir%",
"scope": "resource",
"type": "array"
},
"Lua.workspace.ignoreSubmodules": {
"default": true,
"markdownDescription": "%config.workspace.ignoreSubmodules%",
"scope": "resource",
"type": "boolean"
},
"Lua.workspace.library": {
"markdownDescription": "%config.workspace.library%",
"scope": "resource",
"type": "object"
},
"Lua.workspace.maxPreload": {
"default": 300,
"markdownDescription": "%config.workspace.maxPreload%",
"scope": "resource",
"type": "integer"
},
"Lua.workspace.preloadFileSize": {
"default": 100,
"markdownDescription": "%config.workspace.preloadFileSize%",
"scope": "resource",
"type": "integer"
},
"Lua.workspace.useGitIgnore": {
"default": true,
"markdownDescription": "%config.workspace.useGitIgnore%",
"scope": "resource",
"type": "boolean"
}
},
"title": "setting",
"type": "object"
}
\ No newline at end of file
local fs = require 'bee.filesystem'
require 'utility'
local json = require 'json'
local configuration = require 'package.configuration'
local setting = {
['$schema'] = '',
title = 'setting',
description = 'Setting of sumneko.lua',
type = 'object',
properties = configuration,
}
io.save(fs.path'setting.json', json.encode(setting))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment