aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_json_schemas.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/gen_json_schemas.lua b/scripts/gen_json_schemas.lua
index e5e2421e..c6bef210 100644
--- a/scripts/gen_json_schemas.lua
+++ b/scripts/gen_json_schemas.lua
@@ -69,7 +69,7 @@ local index = {
vtsls = 'https://raw.githubusercontent.com/yioneko/vtsls/main/packages/service/configuration.schema.json',
vue_ls = 'https://raw.githubusercontent.com/vuejs/vetur/master/package.json',
yamlls = 'https://raw.githubusercontent.com/redhat-developer/vscode-yaml/master/package.json',
- zls = 'https://raw.githubusercontent.com/zigtools/zls-vscode/master/package.json',
+ zls = 'https://raw.githubusercontent.com/zigtools/zls/master/schema.json',
}
---@param url string
@@ -104,6 +104,7 @@ end
---@field package_url string url of the package.json of the LSP server
---@field settings_file string file of the settings json schema of the LSP server
---@field translate? boolean
+---@field prefix? string Prepend this string to each schema property.
--- @type table<string, LspSchema>
local overrides = {
@@ -125,6 +126,9 @@ local overrides = {
cssls = {
translate = true,
},
+ zls = {
+ prefix = 'zls.',
+ },
}
---Builds the effective schema configuration table for each server.
@@ -213,6 +217,17 @@ local function generate_server_schema(schema)
properties = config_schema.properties
end
+ -- `properties["enable_snippets"]` => `properties["zls.enable_snippets"]`
+ if schema.prefix then
+ if type(properties) == 'table' then
+ local new = vim.empty_dict()
+ for key, value in pairs(properties) do
+ new[schema.prefix .. key] = value
+ end
+ properties = new
+ end
+ end
+
local schema_json = {
['$schema'] = 'http://json-schema.org/draft-07/schema#',
description = package_json.description,