aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgithub-actions <github-actions@github.com>2021-11-20 01:10:00 +0000
committergithub-actions <github-actions@github.com>2021-11-20 01:10:00 +0000
commit7f9d1477a738534f9908bba9ee30a1a3c251aeb8 (patch)
tree5535577d314b04b63f0e957024373cb8e3a31727
parentfeat: add spectral-language-server support (#1455) (diff)
downloadnvim-lspconfig-7f9d1477a738534f9908bba9ee30a1a3c251aeb8.tar
nvim-lspconfig-7f9d1477a738534f9908bba9ee30a1a3c251aeb8.tar.gz
nvim-lspconfig-7f9d1477a738534f9908bba9ee30a1a3c251aeb8.tar.bz2
nvim-lspconfig-7f9d1477a738534f9908bba9ee30a1a3c251aeb8.tar.lz
nvim-lspconfig-7f9d1477a738534f9908bba9ee30a1a3c251aeb8.tar.xz
nvim-lspconfig-7f9d1477a738534f9908bba9ee30a1a3c251aeb8.tar.zst
nvim-lspconfig-7f9d1477a738534f9908bba9ee30a1a3c251aeb8.zip
docs: update server_configurations.md
skip-checks: true
-rw-r--r--doc/server_configurations.md80
1 files changed, 79 insertions, 1 deletions
diff --git a/doc/server_configurations.md b/doc/server_configurations.md
index 70e76ecc..72502b79 100644
--- a/doc/server_configurations.md
+++ b/doc/server_configurations.md
@@ -96,6 +96,7 @@ that config.
- [solargraph](#solargraph)
- [sorbet](#sorbet)
- [sourcekit](#sourcekit)
+- [spectral_ls](#spectral_ls)
- [sqlls](#sqlls)
- [sqls](#sqls)
- [stylelint_lsp](#stylelint_lsp)
@@ -4988,7 +4989,7 @@ This server accepts configuration via the `settings` key.
- **`purescript.fullBuildOnSave`**: `boolean`
- Whether to perform a full build on save with the configured build command \(rather than IDE server fast rebuild\)\. This is not generally recommended because it is slow\, but it does mean that dependant modules are rebuilt as necessary\.
+ Whether to perform a full build on save with the configured build command \(rather than IDE server fast rebuild\)\. This is not generally recommended because it is slow\, but it does mean that dependent modules are rebuilt as necessary\.
- **`purescript.importsPreferredModules`**: `array`
@@ -6521,6 +6522,83 @@ require'lspconfig'.sourcekit.setup{}
```
+## spectral_ls
+
+https://github.com/luizcorreia/spectral-language-server
+ `A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.`
+
+`spectral-language-server` can be installed via `npm`:
+```sh
+npm i -g spectral-language-server
+```
+See [vscode-spectral](https://github.com/stoplightio/vscode-spectral#extension-settings) for configuration options.
+
+This server accepts configuration via the `settings` key.
+<details><summary>Available settings:</summary>
+
+- **`spectral.enable`**: `boolean`
+
+ Default: `true`
+
+ Controls whether or not Spectral is enabled\.
+
+- **`spectral.rulesetFile`**: `string`
+
+ Location of the ruleset file to use when validating\. If omitted\, the default is a \.spectral\.yml\/\.spectral\.json in the same folder as the document being validated\. Paths are relative to the workspace\.
+
+- **`spectral.run`**: `enum { "onSave", "onType" }`
+
+ Default: `"onType"`
+
+ Run the linter on save \(onSave\) or as you type \(onType\)\.
+
+- **`spectral.trace.server`**: `enum { "off", "messages", "verbose" }`
+
+ Default: `"off"`
+
+ Traces the communication between VS Code and the language server\.
+
+- **`spectral.validateFiles`**: `array`
+
+ Array items: `{type = "string"}`
+
+ An array of file globs \(e\.g\.\, \`\*\*\/\*\.yaml\`\) in minimatch glob format which should be validated by Spectral\. If language identifiers are also specified\, the file must match both in order to be validated\.
+
+- **`spectral.validateLanguages`**: `array`
+
+ Default: `{ "json", "yaml" }`
+
+ Array items: `{type = "string"}`
+
+ An array of language IDs which should be validated by Spectral\. If file globs are also specified\, the file must match both in order to be validated\.
+
+</details>
+
+
+**Snippet to enable the language server:**
+```lua
+require'lspconfig'.spectral_ls.setup{}
+```
+
+**Commands and default values:**
+```lua
+ Commands:
+
+ Default Values:
+ cmd = { "spectral-language-server", "--stdio" }
+ filetypes = { "yaml", "json", "yml" }
+ root_dir = function(startpath)
+ return M.search_ancestors(startpath, matcher)
+ end
+ settings = {
+ enable = true,
+ run = "onType",
+ validateLanguages = { "yaml", "json", "yml" }
+ }
+ single_file_support = true
+```
+
+
## sqlls
https://github.com/joe-re/sql-language-server