YAML support for lsp-mode using yaml-language-server.
Install yaml-language-server (>= v0.4.0) by npm.
$ npm install -g yaml-language-server
To enable lsp-yaml in yaml-mode buffer, with use-package,
(use-package lsp-yaml
:after lsp
:config
(add-hook 'yaml-mode-hook #'lsp))
Specify whether to enable YAML format feature.
Default is nil
.
Specify YAML format options as plist, alist or hash table.
Specified options are converted to JSON object under yaml.format
and sent to the server as is.
For example,
(:singleQuote t :bracketSpacing :json-false :proseWrap "preserve")
will be sent as
{
"yaml": {
"format": {
"singleQuote": true,
"bracketSpacing": false,
"proseWrap": "preserve"
}
}
}
Refer to Language Server Settings of yaml-language-server for the detail.
Default is nil
.
Directory where yaml-language-server is installed.
Default is yaml-language-server installed under global NPM prefix directory.
Schemas plist or alist that associates schema with glob patterns. This can be also a hash table.
For example,
(setq lsp-yaml-schemas '(:kubernetes "/*-k8s.yaml"))
Default is nil
.
Specify whether to enable YAML validation feature.
Default is t
.
Specify whether to enable hover feature.
Default is t
.
Specify whether to enable YAML autocompletion feature.
Default is t
.