https://github.com/iquiw/lsp-yaml
[DEPRECATED] YAML support for lsp-mode (YAML support is included in lsp-mode)
https://github.com/iquiw/lsp-yaml
emacs language-server-protocol yaml
Last synced: 6 months ago
JSON representation
[DEPRECATED] YAML support for lsp-mode (YAML support is included in lsp-mode)
- Host: GitHub
- URL: https://github.com/iquiw/lsp-yaml
- Owner: iquiw
- Created: 2018-04-15T14:29:48.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-09T14:51:30.000Z (about 7 years ago)
- Last Synced: 2024-08-05T06:04:38.161Z (almost 2 years ago)
- Topics: emacs, language-server-protocol, yaml
- Language: Emacs Lisp
- Homepage:
- Size: 24.4 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lsp-yaml
[](https://circleci.com/gh/iquiw/lsp-yaml)
[](https://coveralls.io/github/iquiw/lsp-yaml?branch=master)
YAML support for lsp-mode using [yaml-language-server](https://github.com/redhat-developer/yaml-language-server).
## Setup
### Prerequisite
Install yaml-language-server (>= v0.4.0) by npm.
``` console
$ npm install -g yaml-language-server
```
### Dependency
* [lsp-mode](https://github.com/emacs-lsp/lsp-mode)
### Configuration
To enable lsp-yaml in yaml-mode buffer, with [use-package](https://github.com/jwiegley/use-package),
``` emacs-lisp
(use-package lsp-yaml
:after lsp
:config
(add-hook 'yaml-mode-hook #'lsp))
```
### Customization
#### `lsp-yaml-format-enable`
Specify whether to enable YAML format feature.
Default is `nil`.
#### `lsp-yaml-format-options`
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,
``` emacs-lisp
(:singleQuote t :bracketSpacing :json-false :proseWrap "preserve")
```
will be sent as
``` json
{
"yaml": {
"format": {
"singleQuote": true,
"bracketSpacing": false,
"proseWrap": "preserve"
}
}
}
```
Refer to [Language Server Settings](https://github.com/redhat-developer/yaml-language-server#language-server-settings) of yaml-language-server for the detail.
Default is `nil`.
#### `lsp-yaml-language-server-dir`
Directory where yaml-language-server is installed.
Default is yaml-language-server installed under global NPM prefix directory.
#### `lsp-yaml-schemas`
Schemas plist or alist that associates schema with glob patterns.
This can be also a hash table.
For example,
``` emacs-lisp
(setq lsp-yaml-schemas '(:kubernetes "/*-k8s.yaml"))
```
Default is `nil`.
#### `lsp-yaml-validate`
Specify whether to enable YAML validation feature.
Default is `t`.
#### `lsp-yaml-hover`
Specify whether to enable hover feature.
Default is `t`.
#### `lsp-yaml-completion`
Specify whether to enable YAML autocompletion feature.
Default is `t`.