diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-11-24 23:01:07 -0500 |
|---|---|---|
| committer | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-11-25 23:46:21 -0500 |
| commit | 6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e (patch) | |
| tree | 7f2bf25ca5456b23304295dba8fe0005e85a5c10 /lua/lspconfig/yamlls.lua | |
| parent | fix: only set cmd_cwd if filepath exists (#1485) (diff) | |
| download | nvim-lspconfig-6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e.tar nvim-lspconfig-6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e.tar.gz nvim-lspconfig-6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e.tar.bz2 nvim-lspconfig-6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e.tar.lz nvim-lspconfig-6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e.tar.xz nvim-lspconfig-6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e.tar.zst nvim-lspconfig-6c2fb86c6a03e20abea5ddd17d735885f0b7cb5e.zip | |
feat: expose configs
Diffstat (limited to 'lua/lspconfig/yamlls.lua')
| -rw-r--r-- | lua/lspconfig/yamlls.lua | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/lua/lspconfig/yamlls.lua b/lua/lspconfig/yamlls.lua deleted file mode 100644 index 12fc2670..00000000 --- a/lua/lspconfig/yamlls.lua +++ /dev/null @@ -1,85 +0,0 @@ -local configs = require 'lspconfig/configs' -local util = require 'lspconfig/util' - -local server_name = 'yamlls' -local bin_name = 'yaml-language-server' - -configs[server_name] = { - default_config = { - cmd = { bin_name, '--stdio' }, - filetypes = { 'yaml' }, - root_dir = util.find_git_ancestor, - single_file_support = true, - settings = { - -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting - redhat = { telemetry = { enabled = false } }, - }, - }, - docs = { - package_json = 'https://raw.githubusercontent.com/redhat-developer/vscode-yaml/master/package.json', - description = [[ -https://github.com/redhat-developer/yaml-language-server - -`yaml-language-server` can be installed via `yarn`: -```sh -yarn global add yaml-language-server -``` - -To use a schema for validation, there are two options: - -1. Add a modeline to the file. A modeline is a comment of the form: - -``` -# yaml-language-server: $schema=<urlToTheSchema|relativeFilePath|absoluteFilePath}> -``` - -where the relative filepath is the path relative to the open yaml file, and the absolute filepath -is the filepath relative to the filesystem root ('/' on unix systems) - -2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to -the a glob pattern relative to the detected project root. Check `:LspInfo` to determine the resolved project -root. - -```lua -require('lspconfig').yamlls.setup { - ... -- other configuration for setup {} - settings = { - yaml = { - ... -- other settings. note this overrides the lspconfig defaults. - schemas = { - ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*" - ["../path/relative/to/file.yml"] = "/.github/workflows/*" - ["/path/from/root/of/project"] = "/.github/workflows/*" - }, - }, - } -} -``` - -Currently, kubernetes is special-cased in yammls, see the following upstream issues: -* [#211](https://github.com/redhat-developer/yaml-language-server/issues/211). -* [#307](https://github.com/redhat-developer/yaml-language-server/issues/307). - -To override a schema to use a specific k8s schema version (for example, to use 1.18): - -```lua -require('lspconfig').yamlls.setup { - ... -- other configuration for setup {} - settings = { - yaml = { - ... -- other settings. note this overrides the lspconfig defaults. - schemas = { - ["https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json"] = "/*.k8s.yaml", - ... -- other schemas - }, - }, - } -} -``` - -]], - default_config = { - root_dir = [[util.find_git_ancestor]], - }, - }, -} |
