vim-lsp-settings
vim-lsp-settings copied to clipboard
customTags for yaml-language-server
Hi,
I am looking for a way to define customTags
for yaml-language-server
. I am editing ~/.local/share/vim-lsp-settings/settings.json
and have:
{
"yaml-language-server": {
"schemas": [
{
"fileMatch": ["mkdocs.yaml", "mkdocs.yml"],
"url": "file:///Users/avoss/src/mkdocs-material/mkdocs-material-fork/docs/schema.json"
}
],
"customTags": [
"!ENV scalar",
"!ENV sequence",
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji"
]
}
}
The schemas
part comes from vim-lsp-settings.txt
in the help. I assumed that I could add the customTags
attribute in the same way but it does not seem to have any effect. The tags I am trying to define come from Material for MkDocs.
What confuses me is that the format for the schema configuration is different from that shown in the documentation for the language server? Is there even a way to configure customTags
in the global settings?
For me setting the following in my vimrc worked:
let g:lsp_settings = {
\ "yaml-language-server": {
\ "workspace_config": {
\ "yaml": {
\ "customTags": [
\ "!reference sequence"
\ ]
\ }
\ }
\ }
\ }
Based on that I assume, you need to move customTags
into workspace_config>yaml
, e.g.:
{
"yaml-language-server": {
"schemas": [
{
"fileMatch": ["mkdocs.yaml", "mkdocs.yml"],
"url": "file:///Users/avoss/src/mkdocs-material/mkdocs-material-fork/docs/schema.json"
}
],
"workspace_config": {
"yaml": {
"customTags": [
"!ENV scalar",
"!ENV sequence",
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji"
]
}
}
}
}
Thanks, that did the trick!