aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTechatrix <techatrix@mailbox.org>2026-04-28 00:30:12 +0200
committerGitHub <noreply@github.com>2026-04-27 18:30:12 -0400
commite87b93d56d72d1b3e477a28d0ac09ab2762c0ef5 (patch)
tree996747cf8893621518f9b428ae1ea04a2d5aa6c0 /scripts
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-e87b93d56d72d1b3e477a28d0ac09ab2762c0ef5.tar
nvim-lspconfig-e87b93d56d72d1b3e477a28d0ac09ab2762c0ef5.tar.gz
nvim-lspconfig-e87b93d56d72d1b3e477a28d0ac09ab2762c0ef5.tar.bz2
nvim-lspconfig-e87b93d56d72d1b3e477a28d0ac09ab2762c0ef5.tar.lz
nvim-lspconfig-e87b93d56d72d1b3e477a28d0ac09ab2762c0ef5.tar.xz
nvim-lspconfig-e87b93d56d72d1b3e477a28d0ac09ab2762c0ef5.tar.zst
nvim-lspconfig-e87b93d56d72d1b3e477a28d0ac09ab2762c0ef5.zip
fix(zls): update zls config schema #4405
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,