Skip to content

Commit 7b11052

Browse files
committed
refactor(lsp): update schemastore config with dynamic yaml schema loading
Use on_new_config hook in yamlls to extend schemas dynamically instead of static assignment. Also update plugin name to lowercase.
1 parent aa2b81d commit 7b11052

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

lazy-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
3-
"SchemaStore.nvim": { "branch": "main", "commit": "cd9e8c22f6ad2012ac395725080cc5737297d840" },
43
"auto-save.nvim": { "branch": "main", "commit": "37c82fd548e3f5ffc2d9d020a65dac1044584f44" },
54
"catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" },
65
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
@@ -56,6 +55,7 @@
5655
"precognition.nvim": { "branch": "main", "commit": "2aae2687207029b3611a0e19a289f9e1c7efbe16" },
5756
"reactive.nvim": { "branch": "master", "commit": "0588b5c2b0cf49bd2232fe4366b3516c32edee44" },
5857
"render-markdown.nvim": { "branch": "main", "commit": "c54380dd4d8d1738b9691a7c349ecad7967ac12e" },
58+
"schemastore.nvim": { "branch": "main", "commit": "9b6a3ab14cecc7da9f3aa4fa0ae2a7390748aca5" },
5959
"scrollEOF.nvim": { "branch": "master", "commit": "e462b9a07b8166c3e8011f1dcbc6bf68b67cd8d7" },
6060
"smart-splits.nvim": { "branch": "master", "commit": "5442c06d2003a342c27213e580f58af8ddd577c4" },
6161
"smartim": { "branch": "master", "commit": "37249fc0873522da69ebbf99e5863ef0a761e2c5" },

lsp/yamlls.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ return {
77
'docker-compose.yml',
88
'docker-compose.yaml',
99
},
10+
on_new_config = function(new_config)
11+
new_config.settings.yaml.schemas =
12+
vim.tbl_deep_extend('force', new_config.settings.yaml.schemas or {}, require('schemastore').yaml.schemas())
13+
end,
1014
settings = {
1115
yaml = {
1216
keyOrdering = false,
13-
schemas = require('schemastore').yaml.schemas(),
1417
},
1518
},
1619
}

lua/plugins/lang/json.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ return {
99
end,
1010
},
1111
{
12-
'b0o/SchemaStore.nvim',
12+
'b0o/schemastore.nvim',
1313
ft = { 'json', 'jsonc', 'json5' },
1414
},
1515
}

lua/plugins/lang/yaml.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ return {
2727
},
2828
},
2929
{
30-
'b0o/SchemaStore.nvim',
30+
'b0o/schemastore.nvim',
3131
ft = 'yaml',
3232
},
3333
}

0 commit comments

Comments
 (0)