1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

plugins/schemastore: use the correct LSP configuration keys for the new lsp module

The old lsp module wrapped (in plugins/lsp/language-servers/default.nix)
all configuration of the jsonls and yamlls servers in `json` and `yaml`
keys respectively, so the schemastore module never needed to add those
keys.

However, the new lsp module passes the configuration as-is instead. This
means that the schemastore module must be the one to wrap the
configuration in the `json` and `yaml` keys. Without this, jsonls does
not get its support enabled at all, and yamlls falls back to the
built-in support.
This commit is contained in:
Mateusz Majewski 2025-10-19 16:38:24 +02:00 committed by Gaétan Lepage
parent 0d7375b6b7
commit 5c1be58f6d

View file

@ -172,7 +172,7 @@ lib.nixvim.plugins.mkVimPlugin {
};
lsp.servers = {
jsonls.config.settings = mkIf cfg.json.enable {
jsonls.config.settings.json = mkIf cfg.json.enable {
schemas.__raw = ''
require('schemastore').json.schemas(${lib.nixvim.toLuaObject cfg.json.settings})
'';
@ -182,7 +182,7 @@ lib.nixvim.plugins.mkVimPlugin {
validate.enable = mkDefault true;
};
yamlls.config.settings = mkIf cfg.yaml.enable {
yamlls.config.settings.yaml = mkIf cfg.yaml.enable {
schemaStore = {
# From the README: "You must disable built-in schemaStore support if you want to use
# this plugin and its advanced options like `ignore`."